Can I create a multi series scatter chart using spire?
Here is my chart
Here is my pptx
Thanks!
Presentation pres = new Presentation();
RectangleF rect1 = new RectangleF(10, 10, 600, 500);
Spire.Presentation.Charts.IChart chart = pres.Slides[0].Shapes.AppendChart(ChartType.ScatterSmoothLines, rect1, false);
//Set chart data
Double[] XV = new Double[] { 0, 2, 4, 6, 8, 10 };
Double[] X1 = new Double[] { 0, 1.6, 3.6, 4.3, 5, 9 };
Double[] X2 = new Double[] { 0, 2.3, 3.5, 6, 9, 10 };
Double[] X3 = new Double[] { 10, 8, 5.5, 4, 3, 0 };
chart.ChartData[0, 0].Text = "X-Values";
chart.ChartData[0, 1].Text = "X1";
chart.ChartData[0, 2].Text = "X2";
chart.ChartData[0, 3].Text = "X3";
for (Int32 i = 0; i < XV.Length; ++i)
{
chart.ChartData[i + 1, 0].Value = XV[i];
chart.ChartData[i + 1, 1].Value = X1[i];
chart.ChartData[i + 1, 2].Value = X2[i];
chart.ChartData[i + 1, 3].Value = X3[i];
}
chart.Series.SeriesLabel = chart.ChartData["B1", "D1"];
chart.Categories.CategoryLabels = chart.ChartData["A2", "A7"];
chart.Series[0].XValues = chart.ChartData["A2", "A7"];
chart.Series[0].YValues = chart.ChartData["B2", "B7"];
chart.Series[1].XValues = chart.ChartData["A2", "A7"];
chart.Series[1].YValues = chart.ChartData["C2", "C7"];
chart.Series[2].XValues = chart.ChartData["A2", "A7"];
chart.Series[2].YValues = chart.ChartData["D2", "D7"];
pres.SaveToFile(@"result.pptx", Spire.Presentation.FileFormat.Pptx2013);