Updating Chart Once data has been binded

  • Thread starter Thread starter labjac
  • Start date Start date
L

labjac

Guest
Hallo

We created the Series with the data from a List<objects> and binded is to the chart. all working but now we update the data in the object and need to chart to update without creating new series in the chart. (I've tried Updated, DataBind etc...) but cannot find a way to update the chart data without recreating the series.


public frmMainView()
{
InitializeComponent();
timer1.Start();
timer2.Start();
timer2.Interval = 2000;
UpdateUserScanRatesHourlyDaily();
CreateCharts();
UpdateCharts();
}

private void timer1_Tick(object sender, EventArgs e)
{
DateTime dateTime = DateTime.Now;
this.labDateTime.Text = dateTime.ToString();
}

private void timer2_Tick(object sender, EventArgs e)
{
UpdateUserScanRatesHourlyDaily();
UpdateCharts();
}



private void CreateCharts()
{
charHourlyPacks.DataSource = _scannerPerformanceModel;
Series S1 = new Series();
S1.XValueMember = "UserName";
S1.YValueMembers = "HuPackedDay";
charHourlyPacks.Series.Add(S1);
}
private void UpdateCharts()
{
charHourlyPacks.Series.ResumeUpdates();
//charHourlyPacks.Update();
}




1620637.jpg


labjac

Continue reading...
 
Back
Top