Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents from any .NET(C#, VB.NET, ASP.NET, .NET Core) application and Java (J2SE and J2EE) application.

Thu Nov 10, 2016 1:27 pm

Hello

I've created a slide which contains a pie chart. I've set the property LabelValueVisible from DataLabels to true ( I want to have the label on the chart). Now I want to set the color of the text. How can I do this?

Thank you

CARDSABIN@YAHOO.COM
 
Posts: 27
Joined: Fri Nov 20, 2015 11:24 am

Fri Nov 11, 2016 8:09 am

Hi,

Thanks for your inquiry. You can use the following code to set the color of the text.
Code: Select all
 chart.Series[0].DataLabels.TextProperties.Paragraphs[0].DefaultCharacterProperties.Fill.SolidColor.Color= Color.Blue;

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1009
Joined: Tue Sep 27, 2016 1:06 am

Wed Nov 16, 2016 10:29 am

Hello

I've tried the code above that I can't set the color. For example if I set orange in the pptx I've get black.
Thank you

CARDSABIN@YAHOO.COM
 
Posts: 27
Joined: Fri Nov 20, 2015 11:24 am

Wed Nov 16, 2016 11:31 am

I forget to specify the fill type for the paragraph, and this why the color was not set.

Thank you

CARDSABIN@YAHOO.COM
 
Posts: 27
Joined: Fri Nov 20, 2015 11:24 am

Thu Nov 17, 2016 3:18 am

Hello,

Thanks for your feedback. Please feel free to contact us for futher question.

Sincerely,
Nina
E-iceblue support
User avatar

Nina.Tang
 
Posts: 1009
Joined: Tue Sep 27, 2016 1:06 am

Wed Nov 23, 2016 9:34 am

Now I want to set the font of the text. How can I do this?

g00273637
 
Posts: 2
Joined: Thu Oct 20, 2016 10:12 am

Thu Nov 24, 2016 3:06 am

Hi g00273637,

Thanks for your inquiry.
Please try to use following code to change the datalabel's font.
Code: Select all
            foreach (ChartSeriesDataFormat cs in chart.Series)
            {
                TextFont font = new TextFont("宋体");
                cs.DataLabels.TextProperties.Paragraphs[0].DefaultCharacterProperties.LatinFont = font;               
            }

If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Wed Nov 30, 2016 7:49 am

Hi g00273637,

Did you test the code I provided ? Did it help you ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Wed Dec 07, 2016 2:19 am

谢谢,您给的饼状图例series的字体已经修改过来。
但是,我们更改的图例的category的字体,不知道有没有什么方法。


Thank you, you give the pie legend series of fonts have changed.
However, we want to know how to change the category of the font

g00273637
 
Posts: 2
Joined: Thu Oct 20, 2016 10:12 am

Wed Dec 07, 2016 4:00 am

Hi g00273637,

感谢反馈。
请尝试下面的代码修改category的字体。
Code: Select all
chart.PrimaryCategoryAxis.TextProperties.Paragraphs[0].DefaultCharacterProperties.LatinFont = font;

我们支持中文技术支持,如果还有任何问题,欢迎随时与我们联系。

Thanks for your feedback.
Please try to use the above code to change the font of categories.
If there is any question, welcome to get it back to us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Fri Dec 09, 2016 7:14 am

Hi g00273637,

请问您测试了提供的代码吗?您的问题解决了吗 ?

Did you test the code I provided ? Has your issue been resolved ?

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3067
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Presentation