Posted 27 April 2023, 5:06 pm EST
Hi Amit,
Of course, you can add/remove a point for a particular Series. In order to achieve this requirement you need to specify a particular DataSource for each Series and can perform actions for particular Series by modifying the respective DataSources.
Set specific DataSource for Series
//Series 1
var series1 = new Series();
series1.Binding = "Y";
series1.DataSource = DataPoints1;
flexChart1.Series.Add(series1);
//Series 2
var series2 = new Series();
series2.Binding = "Y";
series2.DataSource = DataPoints2;
flexChart1.Series.Add(series2);
Modify DataSources:
private void Add_Point_Series1(object sender, EventArgs e)
{
var random = new Random();
DataPoints1.Add(new DataPoint() { X = (DataPoints1.Count == 0) ? 0 : (DataPoints1.Last().X + 10), Y = random.NextDouble() });
}
private void Delete_Point_Series1(object sender, EventArgs e)
{
if (DataPoints1.Count > 0)
DataPoints1.Remove(DataPoints1.Last());
}
private void Add_Point_Series2(object sender, EventArgs e)
{
var random = new Random();
DataPoints2.Add(new DataPoint() { X = (DataPoints2.Count == 0) ? 0 : (DataPoints2.Last().X + 10), Y = random.NextDouble() });
}
private void Delete_Point_Series2(object sender, EventArgs e)
{
if (DataPoints2.Count > 0)
DataPoints2.Remove(DataPoints2.Last());
}
Please refer the attached modified sample: FlexChartAddRemovePoint_Mod.zip
Best Regards,
Nitin