【问题标题】:MSChart how to change spacing between dashes of a seriesMSChart如何更改一系列破折号之间的间距
【发布时间】:2014-08-11 07:24:50
【问题描述】:

我有一个带有虚线的系列:

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

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

【问题讨论】:

    标签: c# .net charts series


    【解决方案1】:

    这里有一个使用 alpha 部分的小解决方法:

        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;
                }         
            }     
        } 
    

    【讨论】:

      猜你喜欢
      • 2011-11-16
      • 2016-05-08
      • 2011-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多