MSChart如何改变一系列破折号之间的间距

时间:2014-06-20 13:52:47

标签: c# .net charts series

我有一个用虚线制作的系列:

tmpChart.Series["function"].BorderDashStyle = ChartDashStyle.Dash;

但是如何更改破折号之间的间距?

1 个答案:

答案 0 :(得分:0)

这是一个使用alpha-sections做的小解决方法:

    private void SetChartTransparency(Chart chart, string Seriesname)
    {
        bool setTransparent = true;
        int numberOfPoints = 3;          
        chart.ApplyPaletteColors();
        foreach (DataPoint point in chart.Series[Seriesname].Points)
        {
            if (setTransparent)
                point.Color = Color.FromArgb(0, point.Color);
            else
                point.Color = Color.FromArgb(255, point.Color);
            numberOfPoints = numberOfPoints - 1;
            if (numberOfPoints == 0)
            {
                numberOfPoints = 3;
                setTransparent = !setTransparent;
            }         
        }     
    }