TChart 2010 VCL - Bug in TColorLineTool

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
ScottSlater
Newbie
Newbie
Posts: 11
Joined: Wed May 12, 2010 12:00 am

TChart 2010 VCL - Bug in TColorLineTool

Post by ScottSlater » Wed May 19, 2010 2:17 am

I think I have run into a bug with the TColorLineTool when zooming and unzooming a chart. Here is some sample code that you can use to repro the bug. This was done using the new TChart 2010 VCL with Delphi 2007. Machine is running Windows Vista Ultimate, 32-bit, 4GB ram.

Code: Select all

procedure TForm6.FormCreate(Sender: TObject);
var i,j: Integer;
    tmpColorLine: TColorLineTool;
begin
  Chart1.AddSeries(TBarSeries.Create(Self));

  for i:=0 to 50 do
    Chart1[0].Add(10*i);

  tmpColorLine:=TColorLineTool.Create(Self);
  tmpColorLine.Axis:=Chart1.Axes.Left;
  tmpColorLine.Value:=100;
  tmpColorLine.Pen.Color:=clRed;
  tmpColorLine.Pen.Width:=2;
  Chart1.Tools.Add(tmpColorLine);

  tmpColorLine:=TColorLineTool.Create(Self);
  tmpColorLine.Axis:=Chart1.Axes.Left;
  tmpColorLine.Value:=200;
  tmpColorLine.Pen.Color:=clGreen;
  tmpColorLine.Pen.Width:=2;
  Chart1.Tools.Add(tmpColorLine);

  tmpColorLine:=TColorLineTool.Create(Self);
  tmpColorLine.Axis:=Chart1.Axes.Left;
  tmpColorLine.Value:=300;
  tmpColorLine.Pen.Color:=clBlue;
  tmpColorLine.Pen.Width:=2;
  Chart1.Tools.Add(tmpColorLine);

  tmpColorLine:=TColorLineTool.Create(Self);
  tmpColorLine.Axis:=Chart1.Axes.Left;
  tmpColorLine.Value:=400;
  tmpColorLine.Pen.Color:=clBlack;
  tmpColorLine.Pen.Width:=2;
  Chart1.Tools.Add(tmpColorLine);
end;
The sample will create a simple bar chart with 4 TColorLines with different colors. Zoom in and out several times and you will notice that some of the lines will start to disappear after zooming out even though they should be visible. If you look closer you will see that what is actually happening is the line's value is being changed and in fact the line is visible. It's just merged with another line because it's value is now the same as the other line. If you zoom in and out enough, eventually you will end up with a single line (actually all 4 lines having the same value).

Unless I'm mistaken, I don't think this should be happening. Please advise.

Thanks
Scott

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

Re: TChart 2010 VCL - Bug in TColorLineTool

Post by Yeray » Wed May 19, 2010 11:46 am

Hi Scott,

You could try with:

Code: Select all

tmpColorLine.NoLimitDrag:=true;
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

ScottSlater
Newbie
Newbie
Posts: 11
Joined: Wed May 12, 2010 12:00 am

Re: TChart 2010 VCL - Bug in TColorLineTool

Post by ScottSlater » Wed May 19, 2010 5:02 pm

Initial testing seems to show that adding "NoLimitDrag := True" prevents the problem from happening.

However, I still think that the line values should not be changing just because the chart was zoomed regardless of the NoLimitDrag setting. Can you confirm this is an issue?

Scott

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

Re: TChart 2010 VCL - Bug in TColorLineTool

Post by Yeray » Thu May 20, 2010 1:59 pm

Hi Scott,

Well, it is a known issue recently discussed in the NET forums as you'll see here.
I've added to the ticket number [TF02014836] that VCL behaves in the same way so the enhancement would be implemented in both versions.
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

ScottSlater
Newbie
Newbie
Posts: 11
Joined: Wed May 12, 2010 12:00 am

Re: TChart 2010 VCL - Bug in TColorLineTool

Post by ScottSlater » Thu May 20, 2010 7:09 pm

Cool. Thanks!

Scott

Post Reply