ErrorBar not plotted correctly

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
emwamin
Newbie
Newbie
Posts: 10
Joined: Tue Sep 22, 2015 12:00 am

ErrorBar not plotted correctly

Post by emwamin » Fri Oct 02, 2015 10:29 am

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
ErrorBar.jpg (36.62 KiB) Viewed 10781 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

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ErrorBar not plotted correctly

Post by Yeray » Mon Oct 05, 2015 11:12 am

Hello,
emwamin wrote: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
I get an error when trying to load this tee file, but I've made a simple example project trying to reproduce several situations:
testErrorBars.zip
(2.23 KiB) Downloaded 749 times
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
NegativeErrors_TopBottom.png (17.31 KiB) Viewed 10739 times
I'm studying if a small change in the sources is appropriate. This is how it looks with it:
NegativeErrors_TopBottom_new.png
NegativeErrors_TopBottom_new.png (17.69 KiB) Viewed 10723 times
Also note this modification also changes the result of the "Top" ErrorStyle, from this:
NegativeErrors_Top.png
NegativeErrors_Top.png (16.92 KiB) Viewed 10732 times
To this:
NegativeErrors_Top_new.png
NegativeErrors_Top_new.png (17.29 KiB) Viewed 10727 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?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

emwamin
Newbie
Newbie
Posts: 10
Joined: Tue Sep 22, 2015 12:00 am

Re: ErrorBar not plotted correctly

Post by emwamin » Tue Oct 06, 2015 4:05 pm

Hi

This solution works for me since I always use both Top and Down error bar. How can I get this correction?

BR
emwamin

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ErrorBar not plotted correctly

Post by Yeray » Wed Oct 07, 2015 8:20 am

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;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

emwamin
Newbie
Newbie
Posts: 10
Joined: Tue Sep 22, 2015 12:00 am

Re: ErrorBar not plotted correctly

Post by emwamin » Wed Oct 07, 2015 8:43 am

Hi

Worked like a charm. Thanks.

BR
emwamin

emwamin
Newbie
Newbie
Posts: 10
Joined: Tue Sep 22, 2015 12:00 am

Re: ErrorBar not plotted correctly

Post by emwamin » Wed Jan 27, 2016 2:41 pm

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
Errorbar-Style-Error.jpg (60.01 KiB) Viewed 10606 times

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: ErrorBar not plotted correctly

Post by Yeray » Thu Jan 28, 2016 10:32 am

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.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply