Page 1 of 1
ErrorBar not plotted correctly
Posted: Fri Oct 02, 2015 10:29 am
by 16576425
Hi
It seems that ErrorBars are not plotted correctly when the Bar has a value below Zero. Only one side of the ErrorBar appear in the plot. This error has been in all previous versions. Last year I found a few posts in the forum claiming that it is corrected, but does not seems so. The following plot is from Tee Chart v2105.14.150.120:
- ErrorBar.jpg (36.62 KiB) Viewed 10786 times
I also saved the plot in "tee" format so one can load it in a chart and recreate the error. Please download it by the following link:
http://www.multid.se/Amin/ErrorBar.tee
Please advise.
BR
emwamin
Re: ErrorBar not plotted correctly
Posted: Mon Oct 05, 2015 11:12 am
by yeray
Hello,
I get an error when trying to load this tee file, but I've made a simple example project trying to reproduce several situations:
emwamin wrote:It seems that ErrorBars are not plotted correctly when the Bar has a value below Zero. Only one side of the ErrorBar appear in the plot.
I could reproduce the problem with the application above:
- NegativeErrors_TopBottom.png (17.31 KiB) Viewed 10744 times
I'm studying if a small change in the sources is appropriate. This is how it looks with it:
- NegativeErrors_TopBottom_new.png (17.69 KiB) Viewed 10728 times
Also note this modification also changes the result of the "Top" ErrorStyle, from this:
- NegativeErrors_Top.png (16.92 KiB) Viewed 10737 times
To this:
- NegativeErrors_Top_new.png (17.29 KiB) Viewed 10732 times
Your feedback will be appreciated.
emwamin wrote:This error has been in all previous versions. Last year I found a few posts in the forum claiming that it is corrected, but does not seems so. The following plot is from Tee Chart v2105.14.150.120:
I find
this discussion, is this what you are referring?
Re: ErrorBar not plotted correctly
Posted: Tue Oct 06, 2015 4:05 pm
by 16576425
Hi
This solution works for me since I always use both Top and Down error bar. How can I get this correction?
BR
emwamin
Re: ErrorBar not plotted correctly
Posted: Wed Oct 07, 2015 8:20 am
by yeray
Hi,
emwamin wrote:How can I get this correction?
Since it is a small change and you own the sources, you can apply it and recompile.
At the end of the TCustomErrorSeries.DrawBar in ErrorBar.pas you have this:
Code: Select all
Procedure TCustomErrorSeries.DrawBar(BarIndex,StartPos,EndPos:Integer);
//...
if IDrawBar and (YValues.Value[BarIndex]<YOrigin) then
begin
tmpHeight:=-tmpHeight;
DoDrawError;
inherited;
end
else
begin
if IDrawBar then
inherited;
DoDrawError;
end;
end
else
if IDrawBar then
inherited;
end;
Change it for this:
Code: Select all
Procedure TCustomErrorSeries.DrawBar(BarIndex,StartPos,EndPos:Integer);
//...
if IDrawBar then
inherited;
DoDrawError;
end
else
if IDrawBar then
inherited;
end;
Re: ErrorBar not plotted correctly
Posted: Wed Oct 07, 2015 8:43 am
by 16576425
Hi
Worked like a charm. Thanks.
BR
emwamin
Re: ErrorBar not plotted correctly
Posted: Wed Jan 27, 2016 2:41 pm
by 16576425
Hi
After making that change I am facing a new problem. In toolbox I get the option for styling the ErrorBar but the controls are disabled. If you switch to another serie and switch back the styling controls are disappeared.
I am using Delphi 7 and TeeChart version 2015.16.150901.
BR
emwamin
- Errorbar-Style-Error.jpg (60.01 KiB) Viewed 10611 times
Re: ErrorBar not plotted correctly
Posted: Thu Jan 28, 2016 10:32 am
by yeray
Hello,
emwamin wrote:In toolbox I get the option for styling the ErrorBar but the controls are disabled. If you switch to another serie and switch back the styling controls are disappeared.
I could reproduce that so I've added it tot he public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1419
Note I've also fixed it for the next maintenance release.