这是错误系列的Teechart中的错误吗?

时间:2012-06-12 09:02:21

标签: c# .net teechart

如果错误序列的情况下std错误为负,那么如何获得错误序列的上限和下限。在其他情况下,y + std错误和y-std错误给出了正确的答案enter image description here

1 个答案:

答案 0 :(得分:1)

如果你想计算Error系列的Upper或Lower,我建议你使用两个Series One BarError系列和其他Error Series,所以Error和ErrorBar Series只有ErrorValue,用于下一个代码示例:

    private void InitializeChart()
    {

       tChart1.Aspect.View3D = false;
        double[] GraphData_Mean = new double[3];
        GraphData_Mean[0] = 3;
        GraphData_Mean[1] = 11;
        GraphData_Mean[2] = 34;

        double[] GraphData_Max = new double[3];
        GraphData_Max[0] = 5;
        GraphData_Max[1] = 15;
        GraphData_Max[2] = 23;

        double[] GraphData_Min= new double[3];
        GraphData_Min[0] = 1;
        GraphData_Min[1] = 8;
        GraphData_Min[2] = 17;

        tChart1.Series.Clear();
        for (int i = 0; i < 3; i++)
        {
            Steema.TeeChart.Styles.ErrorBar errorBar = new Steema.TeeChart.Styles.ErrorBar(tChart1.Chart);
            Steema.TeeChart.Styles.Error error1 = new Steema.TeeChart.Styles.Error(tChart1.Chart);
            // Error Bar Series
            errorBar.Pen.Color = Color.Black;
            errorBar.ErrorPen.Width = 2;
            errorBar.Brush.Solid = true;
            errorBar.Brush.Color = Color.White;
            errorBar.Marks.Visible = false;
            errorBar.ErrorStyle = ErrorStyles.Top;
            errorBar.HorizAxis = HorizontalAxis.Bottom;
            errorBar.MultiBar = MultiBars.None;
            errorBar.Add(i, GraphData_Mean[i], (GraphData_Max[i] - GraphData_Mean[i]));
            errorBar.BarWidthPercent = 40;
            //  Error Series 
            error1.ErrorPen.Width = 2;
            error1.Brush.Solid = true;
            error1.Color = Color.Black;
            error1.Marks.Visible = false;
            error1.ErrorStyle = ErrorStyles.Bottom;
            error1.HorizAxis = HorizontalAxis.Top;
            error1.MultiBar = MultiBars.None;
            error1.ShowInLegend = false;
            error1.Add(i, GraphData_Mean[i], (GraphData_Mean[i] - GraphData_Min[i]));
            error1.BarWidthPercent = 40;
           }
}

当您实现它时,您只需要为每个系列获取ErrorValue。如果您有兴趣获得系列的Y值,您只需获得每个系列的YValues列表的值。您能否告诉我们以前的代码是否可以帮助您实现?如果它没有帮助,请告诉我并按照您的预期一步一步解释。

谢谢,

最诚挚的问候, 桑德拉