C#从图表中删除“鬼直线”

时间:2019-05-29 11:40:57

标签: c# charts

如何从左到右删除此直线?

为什么我看到此“ Ghost”行?我没有生成这行:S

Chart

还是我的密码被破解了?

            chart1.Series.Clear();

            chart1.ChartAreas["ChartArea1"].BackColor = Color.Black;
            chart1.ChartAreas["ChartArea1"].AxisX.MajorGrid.LineColor = Color.SlateGray;
            chart1.ChartAreas["ChartArea1"].AxisY.MajorGrid.LineColor = Color.SlateGray;
            chart1.Legends[0].BackColor = Color.Transparent;

            await Task.Delay(100);

            string seriesName1 = "Test";
            Series ser1 = chart1.Series.Add(seriesName1);
            ser1.ChartArea = chart1.ChartAreas[0].Name;
            ser1.Name = seriesName1;
            ser1.ChartType = SeriesChartType.Stock;
            ser1.BorderWidth = 2;
            ser1.Color = Color.Red;

            for (int ix = 0; ix < feechValues.Count(); ix++)
            {
                ser1.Points.AddXY(feechValues[ix].CreateTime, feechValues[ix].Test);
            }
            for (int ixx = 0; ixx < feechValues.Count(); ixx++)
            {
                ser1.ChartType = SeriesChartType.Line;
                ser1.Points[ixx].MarkerStyle = MarkerStyle.Diamond;
                ser1.Points[ixx].MarkerSize = 4;
                ser1.Points[ixx].MarkerColor = Color.Red;
            }

0 个答案:

没有答案