同步图控制图表类型hiloopenclose

时间:2012-07-17 12:39:20

标签: winforms charts syncfusion

我正在使用Visual Studio 2010以及Syncfusion Essential Studio 10.2.0.56。

我希望在基本的同步图表中将开放式关闭符号的形状从水平线更改为高开低关闭图表类型。

有人可以帮我实现这个吗? 我想最终得到这种类型的图表

enter image description here 感谢

1 个答案:

答案 0 :(得分:0)

您可以通过组合Hilo和Scatter类型图表来实现此要求。请在Hilo中设置所需的符号,并根据您的要求散布图表类型。请参考以下代码段来实现此目的,

    [C#]
    // chart series for Hilo.            
        ChartSeries series1 = new ChartSeries("Series 1", ChartSeriesType.HiLo);
         series1.Points.Add(1, new double[] { 8, 3 });
        series1.Points.Add(2, new double[] { 10, 2 });
        series1.Points.Add(3, new double[] { 16, 2 });
        series1.Points.Add(4, new double[] { 7, 3 });
        series1.Points.Add(5, new double[] { 12, 3 });
        this.chartControl1.Series.Add(series1);
        // symbol for Hilo chart type
        series1.Style.Symbol.Shape = ChartSymbolShape.HorizLine;
        series1.Style.Symbol.Color = Color.CadetBlue;
        series1.Style.Interior = new BrushInfo(Color.Black);


          // chart series for scatter.            
        ChartSeries series2 = new ChartSeries("Series 2", ChartSeriesType.Scatter);
        for (int i = 0; i < 5; i++)
            series2.Points.Add(i+1, (series1.Points[i].YValues[0] + series1.Points[i].YValues[1]) / 2);
        this.chartControl1.Series.Add(series2);
          // symbol for scatter chart type
        series2.Style.Interior = new BrushInfo(Color.LightGreen);
        series2.ZOrder = 0;

          // chart series for scatter.            
        ChartSeries series3 = new ChartSeries("Series 3", ChartSeriesType.Scatter);
         for (int i = 0; i < 5; i++)
            series3.Points.Add(i + 1, (series1.Points[i].YValues[1]));
        this.chartControl1.Series.Add(series3);
       // symbol for scatter chart type
        series3.Style.Symbol.Shape = ChartSymbolShape.HorizLine;
        series3.Style.Symbol.Color = Color.Red;

此致

微米。巴拉吉