// Update a chart private void updateRefreshChart(System.Windows.Forms.DataVisualization.Charting.Chart chart) { if (!chart.IsDisposed) { if (chart.InvokeRequired) { RefreshChartCallback update = new RefreshChartCallback(_updateRefreshChart); chart.Invoke(update, new object[] { chart }); } else { _updateRefreshChart(chart); } } }
//Refresh the chart private void RefreshChart() { if (chart.InvokeRequired) { RefreshChartCallback d = new RefreshChartCallback(RefreshChart); this.Invoke(d, null); } else { chart.Refresh(); } }