Free Support Forum -

Chart Data not connected to cells


Is the possible to make the line chart not connected to it data source cells i.e. if we were to change the values in the cells the chart would not change.

Thank you,

Aarti Malik

Hi Aarti,

You can try this:

int chartIndex = excel.Worksheets[0].Charts.Add(ChartType.Line, 5, 5, 15, 10);
Chart chart = excel.Worksheets[0].Charts[chartIndex];
chart.NSeries.Add("{1,2,3}", false);
chart.NSeries.Add("{4,5,6}", false);

Hi Laurence,

How would I handle null data in the series.

chart.NSeries.Add("{,1, ,2,3}", false); gives me an Invalid Chart Data Exception


Also is there a way to assign dates to category data in the same way - I tried

chart.NSeries.CategoryData = "{2005/08/01,2005/08/02,2005/08/03,2005/08/04,2005/08/05,2005/08/08,2005/08/09,2005/08/10}" but got invalid category data. I am trying to create charts in Excel without the data.

"{,1, ,2,3}" and "{2005/08/01,2005/08/02,2005/08/03,2005/08/04,2005/08/05,2005/08/08,2005/08/09,2005/08/10}" are not valid chart series data. I tested them in MS Excel and also find errors.

What about {1,2,#N/A, 4, 5,#N/A}. This seems to work in MS Excel but not in Aspose

Yes. It's not supported in Aspose.Excel.

You can use the following workaround:

Put those value in Cell A1 to A6, then hide column A.

Then use the following sample code:

chart.NSeries.Add("A1:A6", false);

Thanks Laurence .

Are you looking at adding this into Aspose.Excel?

Yes. I will check this feature and add it in the future release.

Thanks so much Laurence!

Can you please let me know when we can expect the next release? Thanks, Aarti

This feature will be added within this month.