首页 > 解决方案 > 如何在c#中删除系列折线图

问题描述

我做一个图表线收集点。当我绘制 2 个点 (20,20) 和 (40,40) 时,它可以工作,但是当我将图形中间的点 (30,0) 绘制成三角形时。我需要什么来修复它?提前非常感谢。

我想要的折线图: 在此处输入图像描述 我遇到的当前错误: 在此处输入图像描述

我是代码:

<i>
private void btnConfirm_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ChartControl point = new ChartControl();
            float s_question_true = 0;
            int percent;
            int dexibel = 0;
            float trunggian;
            CheckEdit[] _checkBoxes;
            _checkBoxes = new CheckEdit[] { checkEdit1, checkEdit2, checkEdit3, checkEdit4, checkEdit5, checkEdit6, checkEdit7, checkEdit8, checkEdit9, checkEdit10 };
            for (int i = 0; i < _checkBoxes.Length; i++)
            {
                if (_checkBoxes[i].CheckState == CheckState.Checked)
                {
                    s_question_true++;
                    Console.WriteLine("gia tri cua s_question_true = {0}", s_question_true);
                }
            }
            trunggian = (float)(s_question_true / 10);
            percent = Convert.ToInt32(trunggian * 100);
            dexibel = Convert.ToInt32(lbDecibel.Text);
            //DialogResult result = MessageBox.Show("Bạn có muốn kết thúc bài Test không?", "Confirmation", MessageBoxButtons.YesNoCancel);
                if (check_play == true)
                {
                    if (btnOption.Caption == "Kiểm tra")
                    {
                        series1.Points.Add(new SeriesPoint(dexibel, percent));
                        series1.View.Color = System.Drawing.Color.Red;
                        this.chartControl1.Series.Add(series1);
                        ((LineSeriesView)series1.View).MarkerVisibility = DevExpress.Utils.DefaultBoolean.True;
                        ((LineSeriesView)series1.View).LineMarkerOptions.Kind = MarkerKind.Circle;
                    }

}

}

标签: c#charts

解决方案


推荐阅读