@toureelhadj,
Regarding WORDSNET-21732, please use the following code to get the same view of the series as in the original document:
Document document = new Document("C:\\Temp\\ScatterSample\\Sample.docx");
var now = DateTime.Now;
var xValues = new DateTime[]
{
now,
now.AddDays(1),
now.AddDays(2),
now.AddDays(3),
now.AddDays(4)
};
var yValues = new List<double[]>
{
new double[] { 1, 4, 2, 7, 5 },
new double[] { 2, 7, 6, 3, 10 }
};
var colors = new List<Color>
{
Color.FromArgb(255, 91, 155, 213),
Color.FromArgb(255, 237, 125, 49)
};
UpdateChart(document, 0, xValues, yValues, colors);
document.Save("C:\\Temp\\ScatterSample\\21.6.docx");
private static void UpdateChart(Document document, int chartIndex, DateTime[] xValues, List<double[]> yValues, List<Color> colors)
{
var shape = (Shape)document.GetChild(NodeType.Shape, chartIndex, true);
if (shape.HasChart)
{
Chart chart = shape.Chart;
chart.Series.Clear();
for (var i = 0; i < yValues.Count; i++)
{
ChartSeries series = chart.Series.Add($"Series {i + 1}", xValues, yValues[i]);
series.Format.Stroke.Color = colors[i];
series.Smooth = true;
series.Marker.Symbol = MarkerSymbol.None;
}
}
}