我试图弄清楚如何绘制不连续(不连续)系列。这是该系列的代码:

        Chart.Series["Limit"].Points.AddXY(20000, 30);
        Chart.Series["Limit"].Points.AddXY(1000000, 30);
        //no plotting wanted here
        Chart.Series["Limit"].Points.AddXY(1500000, 40);
        Chart.Series["Limit"].Points.AddXY(2500000, 40);


如何阻止它绘制某些点,如下图所示的对角线?

最佳答案

您可以通过插入不可见的DataPoint直观地折断折线图:

    Chart.Series["Limit"].Points.AddXY(20000, 30);
    Chart.Series["Limit"].Points.AddXY(1000000, 30);
    //no plotting wanted (from previous point to this one) here
    int index = Chart.Series["Limit"].Points.AddXY(1500000, 40);
    Chart.Series["Limit"].Points[index].Color = Color.Transparent;
    Chart.Series["Limit"].Points.AddXY(2500000, 40);


这使通向DataPoint的行透明。

关于c# - 如何绘制不连续的序列,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43030711/

10-13 08:08