How to create a chart by using getNSeries.add(object) method
I am using something like below
for (int i=0 ; i < arraylist.size() ; i++)
{
chart.getNSeries().add(arraylist.get(i).get(0));
chart.getNSeries().setCategoryData(arraylistget(i).get(1));
}
where get(i) is row number
and get(0) and get(1) is column number and get(0) is of numeric type and get(1) is of String type.
when i am trying this i am getting the following exception
java.lang.ClassCastException: java.lang.String cannot be cast to com.aspose.cells.Series
Hi,
AbhiWipro:
for (int i=0 ; i < arraylist.size() ; i++)
{
chart.getNSeries().add(arraylist.get(i).get(0));
chart.getNSeries().setCategoryData(arraylistget(i).get(1));
}
where get(i) is row number
and get(0) and get(1) is column number and get(0) is of numeric type and get(1) is of String type.
when i am trying this i am getting the following exception
java.lang.ClassCastException: java.lang.String cannot be cast to com.aspose.cells.Series
How could you do this in MS Excel, if MS Excel allows this, Aspose.Cells will allow this as we follow MS Excel standards. If you could do this in MS Excel, please create a sample chart in MS Excel with your desired input range, save the file and attach it here, we will check it soon.
Normally, in MS Excel, and even in Aspose.Cells, we use range of cells in the format of string, e.g
int index = chart.getNSeries().add("=Data!B2:B10", true);
chart.getNSeries().setCategoryData("=Data!A2:A10");
Please follow this format.
Thank you.