How to set the font style to the data labels and colors to the series of a Pie MSO chart?

Hi,

I am not able to set the style to the data labels and
setting the color to the slices(series) of the Pai chart.

In line/column chart, if I am not setting the color/marker to the series, all the series are coming as a single color/marker.

Please find the attached sample application and the image for more details.

Thanks,
Laxmikanta

Hi Laxmikanta,


I have observed the three requirements shared by you and will address them one by one.

For issue related to setting the Pie chart sectors color, I like to share that presently the feature is unavailable. An issue with ID SLIDESNET-33589 has already been created in our issue tracking system for this and it has been fixed as well. But the fix will be available in upcoming release of Aspose.Slides for .NET 6.7.0, which is scheduled for release in first decade of October 2012. I have linked this thread with concerned issue so that you will be notified once the fix will be available online.

For, requirement related to setting the font related properties of pie chart default labels, I like to share that this issue is already added in our issue tracking system for resolution with ID SLIDESNET-33620. However, a workaround approach for adding the series labels with custom font related properties, a workaround approach has been shared by me over this thread link. You may use the sample code and add it accordingly in your sample code to fulfill the requirements for the time being until the issue is resolved.

For, issue related to setting the series line and marker color, I have added the respective code snippet in your sample project. You can set the marker symbol, its size and color even. Please share, if I may help you further in this regard.

Many Thanks,

Hi Mudassir,

Do we have any option to set the chart.ChartArea font style in MSO chart and setting the Show Leader Lines of data labels?

Thanks,
Laxmikanta

Hi Laxmikanta,

I like to share that currently support adding and showing/hiding the leader lines for Pie chart is unavailable in Aspose.Slides. An issue with ID SLIDESNET-33622 has already been created in our issue tracking system to provide the feature support. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

However, for your requirements related to chart area font styles, can you please elaborate in detail with example so that I may help you better in this regard.

We are sorry for your inconvenience,

Please find the image for more details?

Hi Laxmikanta,

Thanks for sharing the image. From image, I have perceived that you are trying to set the font related properties for labels of the Pie charts. I like to sahre that you may have probably share this requirement in your very first post of this thread link. You may use the sample code and add it accordingly in your sample code to fulfill the requirements for the time being until the issue is resolved.

Many Thanks,

Hi Mudassir,

Thanks for your response. Sorry in the last image sent by me, I focused to data labels. But actually I was asking, how to set the font properties to the chart area not the data labels. If I am able to set the font properties to the chart area, than each object inside the chart area will have same font style.

Thanks,
Laxmikanta

Hi Laxmikanta,


Thanks for your elaboration. I have observed your requirement and like to share that presently the feature or property for getting chart area is available in Aspose.Slides for .NET. One can set the font related properties for all entities independently. An issue with ID SLIDESNET-33742 has been created in our issue tracking system as new feature request to provide this feature. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

Hi Mudassir,

If presently the feature or property for getting chart area is available in Aspose.Slides for .NET. Please provide me the code snippet.

And how one can set the font related properties for all entities independently? Please provide me the code snippet for this also.

Thanks,
Laxmikanta

Hi Laxmikanta,


Please use the following code snippet where by I have manged the font related properties for legends, category axis and value axis. For your convenience, I have also attached the genarted presentation.

public static void MangChartProperties()
{
PresentationEx pres = new PresentationEx();
SlideEx slide = pres.Slides[0];
ChartEx chart = slide.Shapes.AddChart(ChartTypeEx.ClusteredColumn, 50, 50, 500, 400);
TextFrameEx txt = chart.CategoryAxis.TextProperties;

txt.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
txt.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 20;
txt.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontItalic = NullableBool.True;
txt.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid; ;
txt.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;

TextFrameEx txt2 = chart.ValueAxis.TextProperties;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 20;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontItalic = NullableBool.True;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid; ;
txt2.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;


TextFrameEx txt3 = chart.Legend.TextProperties;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontHeight = 20;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontItalic = NullableBool.True;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid; ;
txt3.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;
pres.Write(“D:\Aspose Data\AxisValue.pptx”);

}

Many Thanks,

Hi Laxmikanta,

I like to share that feature for setting the pie chart color has been added in Aspose.Slides for .NET 6.7.0. Please visit this documentation link for your kind reference. We will share the notification with you once Aspose.Slides for .NET 6.7.0 will be made available by tonight.

Many Thanks,

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


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

May I know the status of the issue with ID SLIDESNET-33742, SLIDESNET-33620 and SLIDESNET-33622.

Hi Laxmikanta,


I have verified from our issue tracking system and regret to share that the issues are not yet scheduled. Actually, the issues are scheduled on priority and then first come first serve basis from users. Then issues are resolved on the basis of complexity. However, I have requested our development team to share the road map for scheduling the issue and will share the information with you as soon as it will be shared by them.

Many Thanks,

Hi Laxmikanta,


Please try using the following code snippet for setting the font related properties for the default Pie chart labels.

public static void SetPieDefaultLabels()
{
PresentationEx pres = new PresentationEx();

SlideEx sld = pres.Slides[0];

Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.Pie3D, 100, 100, 400, 400);

ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;

chart.ChartData.Series.Clear();

chart.ChartData.Categories.Clear();

chart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, “First Qtr”));

chart.ChartData.Categories.Add(fact.GetCell(0, 2, 0, “2nd Qtr”));

chart.ChartData.Categories.Add(fact.GetCell(0, 3, 0, “3rd Qtr”));

chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “Series 1”), chart.Type);

ChartSeriesEx series = chart.ChartData.Series[0];

series.Values.Add(fact.GetCell(0, 1, 1, 20000));

series.Values.Add(fact.GetCell(0, 2, 1, 50000));

series.Values.Add(fact.GetCell(0, 3, 1, 30000));

series.Labels.ShowValue = true;

series.Labels.ShowPercentage = true;

series.Labels.ShowLegendKey = false;

// chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “Series 1”), chart.Type);
series.Labels.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold = NullableBool.True;
series.Labels.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.FillType = FillTypeEx.Solid;
series.Labels.TextProperties.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FillFormat.SolidFillColor.Color = Color.Blue;


pres.Write(@“D:\Aspose Data\PieChart.pptx”);
}

Many Thanks,

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


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

How to set the font property to a data labels of a MSO Pie chart?

Please look at the attached image for more info.

Thanks,
Laxmikanta

Hi Laxmikanta,


I feel that I have shared the code snippet with you in my former post here for setting the font related properties of Pie chart labels. Please use the code snippet shared for setting the properties. Actually, SeriesEx.Labels.TextProperties returns TextFrameEx for labels. So you can use the normal text related properties to get things working. Please visit the following code snippet links for setting:


Many Thanks,

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


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

Hi,

Kindly share the code snippet for the SLIDESNET-33622(Showing/hiding the leader lines for Pie chart).

Thanks,
Laxmikanta