private void RefreshGraph() { if (TEST_DATA == null) { chLastAction.Enabled = false; } else { switch (TEST_DATA.GetChartType()) { case TestDataChartType.Pie: chLastAction.Series[0].ChartType = SeriesChartType.Pie; break; case TestDataChartType.Column: chLastAction.Series[0].ChartType = SeriesChartType.Column; break; case TestDataChartType.Doughnut: chLastAction.Series[0].ChartType = SeriesChartType.Doughnut; break; } chLastAction.Series[0].Points.Clear(); foreach (var record in TEST_DATA.GetChartData()) { if (record.Value == 0) { continue; } DataPoint point = new DataPoint(0, record.Value); point.LegendText = record.Key; point.Label = record.Value.ToString(); chLastAction.Series[0].Points.Add(point); } chLastAction.Enabled = true; } }