Free Support Forum - aspose.com

Help to draw sactter with makers

i am trying to update the garph attached in the pptx file and using the code below but when i am playing the values in the series i am getting an error index out of off array


int catIndex = 1;
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
ChartSeriesEx series = chart.ChartData.Series[0];
for (int i = 0; i < 10; i++)
{
string insertedValueair = extractedData.Rows[i][valuesUsed[2]].ToString();
string insertedValue = extractedData.Rows[i][valuesUsed[5]].ToString();
string[] catName = extractedData.Rows[i][valuesUsed[0]].ToString().Split(’[’, ‘]’);
string cat = catName[1];
if (insertedValue.Equals("-") || insertedValue.Equals(""))
{
insertedValue = “0”;
}
if (insertedValueair.Equals("-") || insertedValueair.Equals(""))
{
insertedValueair = “0”;
}
fact.GetCell(0, catIndex, 0, cat);
catIndex++;

fact.GetCell(0, 0, 1, “AIR”);
series.Values[i].Value = Math.Round(Convert.ToDouble(insertedValueair), MidpointRounding.AwayFromZero);
fact.GetCell(0, 0, 2, “Index”);
series.Values[i].Value = Math.Round(Convert.ToDouble(insertedValue), MidpointRounding.AwayFromZero);
}
catIndex = 0;


this is the error message i am getting

"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"



the values below is what the chart should be updated by

|column 1
| AIR
| Index |<o:p></o:p>

| a | 1 | 900 |

| ab | 2 | 300 |

| a c | 3 | 300 |

| a v | 4 | 100 |

| aq | 5 | 300 |

| a d | 6.600 | 350 |

| a s | 7.00 | 800 |


this is in a data table

Hi Jimmy,


Thanks for your interest in Aspose.Slides.

I have observed the requirement shared by you for modifying scatter chart with markers. I have just shared the code snippet to another customer for fulfilling the same requirement. Please visit this thread link for your kind reference. Please share, if I may help you further in this regard.

Many Thanks,

the code that has been provided does work but it does not give the markers the names that i have set in the first column

Hi Jimmy,


I have tried to observe your requirements and have generated a sample presentation in PowerPoint on the basis of data shared by you. Can you please confirm that is this the same chart that you are trying to generate using Aspose.Slides. Please share your feedback and I will try to help you further on the basis of this.

Many Thanks,

all the data is being added on to the chart and the markers are the values that are on the y axis and not the title that i have given and when inspecting the code all the title are presnet

Hi Jimmy,


Thanks for your feedback. I have tried to understand the requirements for desired chart from you but I am not able to conclude the requirements shared by you. Can you please share the desired chart developed in PowerPoint using the following data shared by you.

|column 1 | AIR | Index |<o:p></o:p>

| a | 1 | 900 |<o:p></o:p>

| ab | 2 | 300 |<o:p></o:p>

| a c | 3 | 300 |<o:p></o:p>

| a v | 4 | 100 |<o:p></o:p>

| aq | 5 | 300 |<o:p></o:p>

| a d | 6.600 | 350 |<o:p></o:p>

| a s | 7.00 | 800 |


I have tried to generate the chart in PowerPoint on the basis of above mentioned data which I shared with you here. Is this the chart you want to develop. Otherwise please share the chart that you want to generate using Aspose.Slides with above data in PowerPoint and I will try to help you further. I will appreciate your cooperation in this regard.


Many Thanks,