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

Free Support Forum - aspose.com

Cannot Format DataLabel Containing Defined Text

I have created a Powerpoint presentation with a barchart. I have created custom labels for each bar but I am unable to change the Font Height or Font Type.

If I use the Category Name, Series Name or Value the formatting works properly.

Thanks,
Brian

Hi Brian,

I have observed the requirements shared by you and suggest you to please visit this documentation link for your kind reference. The link describes how to format different chart entities including the ones requested by you. Please share, if I may help you further in this regard.

Many Thanks,

Thank you for your prompt response, but I had already viewed that section of code and could not find anything relating to my issue in it.


In a bar chart I am adding data labels to the bars and I cannot set the fonts if I use the “TextFrameForOverriding”. See the code below, the first two series format correctly but the third does not.

FontData fd1 = new FontData(“Arial”);

//create custom labels for each of categories for new series

series.Labels.DefaultDataLabelFormat.TextFormat.PortionFormat.FontHeight = 8;

series.Labels.DefaultDataLabelFormat.TextFormat.PortionFormat.LatinFont = fd1;


//first label will show Category name

Aspose.Slides.Charts.IDataLabel lbl = series.DataPoints[0].Label;

lbl.DataLabelFormat.ShowCategoryName = true;

        //Second Label will show category name<br/>
        lbl = series.DataPoints[1].Label;<br/>
        lbl.DataLabelFormat.ShowSeriesName = true;<br/><br/>

        //Third Label will be a custom name<br/>
        lbl = series.DataPoints[2].Label;<br/>
        lbl.TextFrameForOverriding.Text = "Custom Label";<br/>

Never mind, I found the error in my code.


Thanks!

Hi Brian,

That is appreciable that you have been able to identify the issue in your code and things have started to work on your end. Please share, if I may help you further in this regard.

Many Thanks,