We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to display times over 24 hours in Aspose slides chart

Hi,

I try to set my chart’s value axis to display [h]:mm:ss (as you can do in excel) with a view to display over 24-hour values in the chart value axis labels and series labels. Is this supported at the current Aspose Slides for .NET? I have looked at your documentation and found the following table in this link:

http://www.aspose.com/docs/display/slidesnet/Setting+Number+Format+for+Chart+Data+Cell

Unfortunately what I look for is not present in the list of supported preset number formats.

Can you please let me know whether this is possible to implement or if you can add it as an option to a future release?

What I currently try to do is:

Dim chart As ChartEx
chart.ValueAxis.NumberFormat = “[h]:mm:ss”

Dim series As ChartSeriesEx = chart.ChartData.Series(id)
series.Labels.NumberFormat = "[h]:mm:ss"

Many thanks,

Christos

Hi Christos,

To set the custom number format of chart series labels, please see the following sample code.

'Instantiate the presentation
Using pres As New PresentationEx()
    'Access the first presentation slide
    Dim slide As SlideEx = pres.Slides(0)

    'Adding a defautlt clustered column chart
    Dim chart As ChartEx = slide.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 50, 50, 500, 400)

    'Accessing the chart series collection
    Dim series As ChartSeriesExCollection = chart.ChartData.Series

    'Setting the custom number format
    'Traverse through every chart series
    For Each ser As ChartSeriesEx In series
        'Traverse through every data cell in series
        For Each cell As ChartDataCell In ser.Values
            'Setting the number format
            cell.CustomNumberFormat = "[h]:mm:ss"
        Next cell
    Next ser

    'Saving presentation
    pres.Write("C:\data\PresetNumberFormat.pptx")

In case you still face any issue, please share a sample of your required PPTX with us. We will further check it and get back to you soon.

Thanks & Regards,

Hi Ahmad,

Thanks for your quick reply.

This works partially for me. It’s good for my exported chart to PowerPoint but not good for the chart thumbnail that I display in my application. I attach a sample code example for you to have a look and assist further.

To run this example you will need to link to the Northwind database. For the sake of this example, I have treated the UnitsInStock Integer value as a value that I want to convert into the custom “[hh]:mm:ss” time format.

Please run the example and first press Generate to load the Thumbnail. Then press Export to export to PowerPoint. It should be easy to spot the difference at the time formats between the two.

To summarise what doesnt’ work in the thumbnail, it a) displays “:mm:ss” instead of “[hh]:mm:ss” and b) there is 1 second added to all labels and y-axis values!

I will be waiting for your answer.

Many thanks,

Christos

Hi Christos,

Thank you for sharing the sample application.

I am able to reproduce your mentioned issue after an initial test. The issue has been registered in our issue tracking system with issue id: SLIDESNET-35071. You will be notified via this forum thread once the issue gets resolved.

Sorry for inconvenience,

Hi Ahmad,

Thanks for opening a ticket to resolve this issue.

As this is a client requirement, we will need a fast resolution or at least an indication of how long it can take until it gets resolved. Can you please give me an estimate of when I should expect to see a solution in a future update?

Many thanks,

Christos

Hi Christos,

I would like to share that your reported issue is currently pending for investigation. Our development team will schedule and investigate the issue on its due turn based on first come and first serve policy for normal support queries. However, first priority is given to the paid Priority Support and Enterprise Support customers / queries. I will be able to share further feedback with you as soon as the issue will get scheduled and investigated by our development team.

Sorry for the inconvenience,

The issues you have found earlier (filed as SLIDESNET-35071) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.