Error bars : ErrorYPlus/ErrorYMinus reversed?

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
cwodarczyk82
Posts: 43
Joined: Mon Oct 19, 2015 2:50 am

Error bars : ErrorYPlus/ErrorYMinus reversed?

Post by cwodarczyk82 » Fri Feb 12, 2016 6:00 pm

To whom it may concern:

I was wondering if ErrorYPlus and ErrorYMinus were somehow reversed? It seems to go in the opposite intuitive direction of ErrorXPlus and ErrorXMinus.. I wrote a small program to demonstrate it...

Code: Select all

//Initializechart
            lightningChartUltimate1.BeginUpdate();
            //GetXYview
            ViewXY chartView = lightningChartUltimate1.ViewXY;
            //Getdefaultx-axisandsettherangeandValueType
            AxisX axisX = chartView.XAxes[0];

            axisX.SetRange(0, 2);
            axisX.ValueType = AxisValueType.Number;
            //Getdefaulty-axisandsettherange.
            AxisY axisY = chartView.YAxes[0];
            axisY.SetRange(0, 3.5);
            //Addpointlineseries
            PointLineSeries pls = new PointLineSeries(chartView, axisX, axisY);
            pls.PointsVisible = true;
            pls.LineVisible = false;
            pls.ErrorBars.ShowYError = true;
            pls.ErrorBars.ShowXError = true;
            pls.ErrorBars.EndLength = 20;
            pls.ErrorBars.YColor = Colors.WhiteSmoke;
            pls.ErrorBars.XColor = Colors.WhiteSmoke;

            SeriesErrorPoint[] aPoints = new[]
            {
                new SeriesErrorPoint() {ErrorYMinus = 0.68999, ErrorYPlus = 0.87368, X = 1, Y = 2.20498, ErrorXMinus = 0.6547, ErrorXPlus = 0.345}
            };
            
            pls.PointsType = PointsType.ErrorPoints;
            //Assignthedataforthepointlineseries
            pls.PointsWithErrors = aPoints;
            //AddseriestothePointLineSeriescontainerintheview
            chartView.PointLineSeries.Add(pls);
            //Applychartpropertychanges,whichcausescharttobepainted
            lightningChartUltimate1.EndUpdate();

Unless, am I supposed to be thinking of ErrorYPlus and ErrorYMinus in screen coordinates instead of regular y coordinates (which has them reversed...) I am ok with using it this way, but wanted to make sure I wasn't confused as to how this worked!

Also, hopefully this post will help if anyone else got confused by this....

[img]
ErrorBars.PNG
ErrorBars.PNG (115.99 KiB) Viewed 6098 times
[/img]


As you can see, the error bars on the x Axis go from about .35 to 1.35, but the y axis seems to go the other direction...


Thanks
Chris

User avatar
ArctionPasi
Posts: 1367
Joined: Tue Mar 26, 2013 10:57 pm
Location: Finland
Contact:

Re: Error bars : ErrorYPlus/ErrorYMinus reversed?

Post by ArctionPasi » Mon Feb 15, 2016 1:05 pm

You are right, it's against common sense, and against the logic that X dimension represents. We will change in next assembly pack and clearly notify of such change.

Thanks :D
LightningChart Support Team, PT

cwodarczyk82
Posts: 43
Joined: Mon Oct 19, 2015 2:50 am

Re: Error bars : ErrorYPlus/ErrorYMinus reversed?

Post by cwodarczyk82 » Mon Feb 15, 2016 5:13 pm

Hi, Pasi

Thanks for the reply... would that be a good idea though based on how many users might be writing their code based on how it actually works? If you were to modify its usage, that might break a lot of existing applications...?

Thanks again for being so responsive!
--Chris

Post Reply