How Do I Format Value Axis Labels in a ChartEx Chart?

How do I set the value labels on a chart to display as percentage? I have tried to change the ChartEx.ChartData.Labels.ValueFormatString but Labels is always null.

Hi Jason,

Thanks for your interest in Aspose.Slides.

An
issue with ID SLIDESNET-29560 already exists in our issue tracking system to resolved this issue. This
thread has also been linked with the same issue, so that you may be
automatically notified, once the issue is resolved.

We apologize for your inconvenience.

Can you confirm that setting the ChartEx.ChartData.Labels.ValueFormatString is the correct way to set the formatting of Value Axis labels? If this that is the case and this bug prevents me from setting the format, is ther a suggested workaround? Do you have an ETA on the bug fix?

Hi Jason,

I have verified from our issue tracking system and have found that this issue has been schedule for detail investigation for week 41th
of 2011.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(3)

I am trying to format the DataLabel and the format string is not being applied. Here is the line of Code I am using:


newChart.ChartData.Series[0].Labels.ShowValue = true;
newChart.ChartData.Series[0].Labels.NumberFormat = “{0:0.0%}”;

newChart is a ChartEx object.

The value 0.645777 is displayed but given the string format, 64.6% should be displayed.

Hi Jason,

Please accept my apology for late response. It would be great, If you can share your presentation file which contain the chart shape for investigation purposes. Please find a code example of chart data labels.

I am having the exact same issue. It also does not carry these settings if you are using a template slide with a chart in it. Once run thru aspose most label settings in the template are being overwritten.

Hi Cuneyt,

Thanks for your interest in Aspose.Slides.

Jason is facing problem with number formatting, are you facing the same problem? Please share your presentation file along with code for investigation purposes. It would be great, If you can share more information about your issue. We really keen to help you but need your cooperation.

Thanks for the quick response,

I have attached a simple test replicating the issue.

The template has the chart data labels set as percents. When the aspx page clones the template slide and changes the data values the formatting is lost.

If I were to try to format data labels as percents within the aspx code, it still has no effect and this time the resulting pptx data labels can no longer be modified.

Thanks for your help.
Cuneyt


Hi Cuneyt,

Please accept my apology for late response. I have not faced any issue by using your code with latest version of Aspose.Slides for .NET 5.6.0. Please use latest version of Aspose.Slides for .NET 5.6.0.

If you are using the latest version then please share your OS information and development environment. I am using Windows 7 (64 bit), .NET framework 2.0. Please find the generated PPTX file with Aspose.Slides in attachment.

I believe there’s a miscommunication and I apologize for that.
The problem is : I was trying to format the data labels as percents and the attached generated pptx file the data labels are not in percent format (first column value = 0.43 and i want to show it as 43%)

I am using .NET 5.6.0 framework 4.0 on windows server 2003 VS2010

I also wonder why the chart in your output seems to be an image rather than a native powerpoint chart object?

Thanks
Cuneyt

Hi Cuneyt,

Please accept my apology for late response. I have tested the scenario and I am able to
reproduce the same problem.

For the sake of correction, I have logged this issue as SLIDESNET-32141 in our issue tracking system. Our team will look
into this issue and you will be updated via this forum thread once it is
resolved.

We apologize for your inconvenience.

Is there a way to get a sense of timing in terms of a solution for this issue?

Hi Cuneyt,

I have asked for the ETA of this issue from our development team. As soon as, any information is shared by them I will be more then happy to share that with you.

Is there is a solution for this problem yet?

Hi Cuneyt,


I am pleased to inform you that the issue specified is marked as resolved in our issue tracking system and fix for it will be available in Aspose.Slides for .NET 5.8.0 which is scheduled for delivery by next weekend. We will share further news with you as soon as it is available.

Many Thanks,

Hi Cuneyt,


Please use the following code snippet in order to display the percentage along with chart values. I am currently verifying the product release Aspose.Slides for .NET 5.8.0 and will release that by tonight. You may test the code snippet with specified release once you get update about product release.

Private Sub updatechartdata(ByRef sld As SlideEx)
'Chart object to hold charts
Dim chart As ChartEx = Nothing

'Traversing through shapes to find chart
For Each shape As ShapeEx In sld.Shapes

If TypeOf shape Is ChartEx Then

'Add chart with default data
chart = CType(shape, ChartEx)

'Setting the index of chart data sheet
Dim defaultWorksheetIndex As Integer = 0

'Getting the chart data worksheet
Dim fact As ChartDataCellFactory = chart.ChartData.ChartDataCellFactory

'Take first chart series
Dim series As ChartSeriesEx = chart.ChartData.Series(0)

'IF THIS SECTION IS NOT EXECUTED
’ resulting pptx data labels can be edited manually
’ but if it is executed
’ it has no effect on the labels being formatted as percents but
’ it cannot be modified manually on the resulting pptx

chart.ChartData.Series(0).Labels.ShowValue = True
chart.ChartData.Series(0).Labels.NumberFormat = “0.0%”
chart.ChartData.Series(0).Labels.LinkedSource = False ’ (default is true)

End If

Next
End Sub

Many Thanks,

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Even though this issue is marked as fixed, I am still not able to format the Data Series or the Value Labels of a chart.


Will you provide a code example where you are formatting the value axis labels or the data series labels as percentage?

Thanks,

Jason