Graphs not graphing

per documentation I’m trying to allocate gathered hard values to the graph.

Create and Manage Chart|Documentation

“When adding source data to chart, the data source can be a range of
cells (such as “A1:C3”), or a sequence of non-contiguous cells (such as
“A1, A3, A5”), or a sequence of values (such as “1,2,3”).

I can get a graph to populate when I use a range from the previous sheet. But i need to get specific cell values.

using VB.NET
I do thus

charts.NSeries.CategoryData = “Sheet1!S10”
charts.NSeries.SecondCatergoryData = “Sheet1!T10”
charts.Title.Text = “A title”

        <span style="color:blue;">Dim</span> sDataRange <span style="color:blue;">As</span> <span style="color:blue;">String</span> = <span style="color:#a31515;">"Sheet1!S10:T974"</span>

        charts.NSeries.Add(<span style="color:#a31515;">"1,2,3,4,5"</span>, <span style="color:blue;">True</span>)

and get a blank graph. well not blank but data less. It has a legend/XY axis

any thoughts on how to hardcode graph valuse? thanks.


Thanks for your posting and using Aspose.Cells.

You need to add curly brackets around the sequence of values. Please see the following runnable sample code and its output Excel for your reference.


Workbook wb = new Workbook(FileFormatType.Xlsx);

Worksheet ws = wb.Worksheets[0];

int chartIndex = ws.Charts.Add(ChartType.Column, 2, 2, 17, 14);

Chart chart = ws.Charts[chartIndex];

int seriesIndex = chart.NSeries.Add("{1,2,3,4,5}", false);