Spire.Presentation is a professional PowerPoint® compatible library that enables developers to create, read, write, modify, convert and Print PowerPoint documents. Get free and professional technical support for Spire.Presentation for .NET, Java, Android, C++, Python.

Wed Nov 16, 2016 3:03 pm

Hello

I'm creating a pie chart. If I put data only on first row I have some default data for next 4 rows. Something like this
1st Qtr 8.2
2nd Qtr 3.2
3rd Qtr 1.4
4th Qtr 1.2

Is this normal?

Thank you

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

Thu Nov 17, 2016 2:46 am

Hi,

Thanks for inquiry.
Please try to set the bool init as false when adding the chart, the result will not have that default value.
Here is sample code for your reference.
Code: Select all
ppt.Slides[0].Shapes.AppendChart(ChartType.Pie, rect1, false);


Sincerely,
Betsy
E-iceblue support team
User avatar

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

Thu Nov 17, 2016 11:47 am

If I use false for init I'm receiving error when trying to set chart data.

I set data this way
chart.ChartData[0, 10].Value = 78.89;

and at this line

chart.Series[0].Values = chart.ChartData["K1", "K1"]; I receive this error:

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

Additional information: Index was out of range. Must be non-negative and less than the size of the collection.

If I don't use the init parameter I don't have that error.

Thank you

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

Thu Nov 17, 2016 12:11 pm

I think I was getting that error because I was not setting the SeriesLabel property

Thank you

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

Fri Nov 18, 2016 2:19 am

Hi,

Thanks for your feedback.
Please feel free to contact us if there is any question.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.Presentation