Problem with ErrorBar

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
martin
Newbie
Newbie
Posts: 3
Joined: Thu Aug 18, 2011 12:00 am

Problem with ErrorBar

Post by martin » Mon Apr 16, 2012 1:55 pm

Hi,
I'm using TeeChart 4.1.2011.7281 for .Net 2.0 with Visual Studio 2010.

In my ErrorBar.ErrorValues i have negative and positive values. The positive values are displayed right as I supposed (the "T" is on top of the bar).
I assumed that negative values would be displayed as a downwards drawn "T".
--> Unfortunately they are also drawn on top of the ErrorBar.

does the ErrorBar not provide this functionality or is it a bug?

best regards,
Christopher

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Problem with ErrorBar

Post by Sandra » Mon Apr 16, 2012 3:47 pm

Hello Christoper,

I suggest you change ErrorStyle property to TopBottom as do in next line of code:

Code: Select all

 errorBarSeries1.ErrorStyle = ErrorStyles.TopBottom;
Can you tell us if previous line of code works as you expect?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

martin
Newbie
Newbie
Posts: 3
Joined: Thu Aug 18, 2011 12:00 am

Re: Problem with ErrorBar

Post by martin » Tue Apr 17, 2012 6:59 am

Hi, if I set:

Code: Select all

 errorBarSeries1.ErrorStyle = ErrorStyles.TopBottom;
The "T" is always drawn upwards and downwards, no matter if the given value is positive or negative.

I would like to draw the "T" downwards if the given value is negative and upwards if not!

regards,
Christopher

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Problem with ErrorBar

Post by Sandra » Wed Apr 18, 2012 3:21 pm

Hello Christoper,

I suggest you do something as next code:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();
        }

        private void InitializeChart()
        {
            tChart1.Aspect.View3D = false;
            Random rnd = new Random();
            Steema.TeeChart.Styles.ErrorBar errorBar = new Steema.TeeChart.Styles.ErrorBar(tChart1.Chart);
            Steema.TeeChart.Styles.ErrorBar errorBar1 = new Steema.TeeChart.Styles.ErrorBar(tChart1.Chart);
           
            errorBar.ErrorStyle = ErrorStyles.Top;
            errorBar.HorizAxis = HorizontalAxis.Bottom;
            errorBar1.ErrorStyle = ErrorStyles.Bottom;
            errorBar1.HorizAxis = HorizontalAxis.Bottom;
            //
            errorBar1.Pen.Color = errorBar.Pen.Color;
            errorBar1.Color = errorBar.Color;
            errorBar.ErrorPen.Color = errorBar.ErrorPen.Color;

            for (int i = 0; i <= 10; i++)
            {
                //Error Bar Series

                if (i < 5)
                {
                    errorBar.Add(i, rnd.Next(100), 10);
                }
                else
                {
                    errorBar1.Add(i, rnd.Next(100),-10);
                    
                }
            }

        }
Can you tell us if previous code works as you expect?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply