but I can't see correct data in my chart...
Code: Select all
private void btnChart_Click(object sender, System.EventArgs e)
{
chartUtil.ChartClear(tChart1);
Line lineSeries = chartUtil.AddLineSeries(tChart1, "TEST", VerticalAxis.Left, Color.Blue, false, true);
lineSeries.Add(lineSeries.Count, 0, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 1, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 2, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 3, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 4, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 4, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 3, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 2, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 1, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 0, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 1, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 2, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 3, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 4, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 5, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 4, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 3, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 2, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 1, "", lineSeries.Color);
lineSeries.Add(lineSeries.Count, 0, "", lineSeries.Color);
HighLow highLowSeries = chartUtil.AddHighLowSeries(tChart1, "SPEC", VerticalAxis.Left, Color.Green, false, false);
for (int index1 = 0; index1 < lineSeries.Count; index1++)
{
highLowSeries.Add(lineSeries.XValues[index1], lineSeries.YValues[index1] - 0.5, lineSeries.YValues[index1] + 0.5, "", highLowSeries.Color);
}
highLowSeries.Pen.Visible = true;
highLowSeries.HighBrush.Visible = true;
highLowSeries.LowBrush.Visible = true;
highLowSeries.HighPen.Color = Color.Green;
highLowSeries.LowPen.Color = Color.Blue;
highLowSeries.ShowInLegend = false;
chartUtil.LegendInitialize(tChart1, LegendStyles.Series, LegendTextStyles.Plain, true);
chartUtil.SetAxisMinMax(tChart1.Axes.Left, 30, 30);
chartUtil.SetAxisLabel(tChart1.Axes.Left, AxisLabelStyle.Value);
chartUtil.SetAxisLabel(tChart1.Axes.Bottom, AxisLabelStyle.Value);
}
private void btnDelete_Click(object sender, System.EventArgs e)
{
for (int index1 = 0; index1 < tChart1.Series.Count; index1++)
{
if (tChart1.Series.Count > 0)
{
tChart1.Series[index1].Delete(0);
tChart1.Series[index1].RefreshSeries();
tChart1.Series[index1].Repaint();
}
}
tChart1.Refresh();
tChart1.Update();
}