We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Chart : Scatter => Always line between point?

Hello, i would like to creat a chart type : SCATTER WITHOUT LINE based on a template SMARTMARKER.

On my Template file i have add a chart in the sheet. ( type : scatter ).
Each time i save the template and each time i check on the chart type : “click right modify the type”, i see it is a wrong type selected : SCATTER WITH LINE.

And when i generate the chart on the code with adding : chart.type = chart.Type = ChartType.Scatter; i have lines …

Let 's see my code :

private void CloudChart(string ChartName, string CharTitle, DataTable data, int DataSheetIndex, int ChartSheetIndex, string CellProductName, string CellProductX, string CellProductY)
Worksheet dataSheet = Book.Worksheets[DataSheetIndex];
Worksheet chartSheet = Book.Worksheets[ChartSheetIndex];
Designer.Workbook = Book;

Chart chart = chartSheet.Charts[ChartName];

chart.Title.Text = CharTitle;
chart.CategoryAxis.Title.Text = “X-Axis”;
chart.ValueAxis.Title.Text = “Y-Axis”;
chart.NSeries.CategoryData = “A3:A18”;

char[] FirstCellLetter = CellProductX.ToCharArray();
int countLine = data.Rows.Count;
String StringRangeX = String.Format("{0}:{1}{2}", CellProductX, FirstCellLetter[0], countLine + Int32.Parse(FirstCellLetter[1].ToString()) - 1);
Range RangeProductX = dataSheet.Cells.CreateRange(StringRangeX);
RangeProductX.Name = “RANGEPRODUCTX”;
var r2 = Book.Worksheets.GetRangeByName(“RANGEPRODUCTX”);
chart.NSeries.Add(“A3:A18”, false);
chart.NSeries[0].XValues = r2.RefersTo;

FirstCellLetter = CellProductY.ToCharArray();
String StringRangeY = String.Format("{0}:{1}{2}", CellProductY, FirstCellLetter[0], countLine + Int32.Parse(FirstCellLetter[1].ToString()) - 1);
Range RangeProductY = dataSheet.Cells.CreateRange(StringRangeY);
RangeProductY.Name = “RANGEPRODUCTY”;
var r3 = Book.Worksheets.GetRangeByName(“RANGEPRODUCTY”);
chart.NSeries[0].Values = r3.RefersTo;
chart.Type = ChartType.Scatter;

Thank you for help


Thanks for sample code segment and screenshots.

We need your output Excel file (containing the chart) via Aspose.Cells APIs and a sample Excel file (containing your desired chart which you may create/save it in MS Excel manually). We also appreciate if you could provide a sample console application (runnable), you may zip it prior attaching it here with all the resource files. Since you are using Smart Markers, so kindly use dynamic DataTable(s)/ DataSet in the code to remove any inter dependencies for external data source and we could execute your sample properly, we will check it and may help you to create your desired chart accordingly.

Thank you.