Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-01

Unexpected TAChart's axis scaling

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Valdas Jankūnas

Hello,

in Test Project I have a Chart with several LineSeries and one AreaSeries. AutoScaleAxisTransform in each Axis is used. I noticed some unexplainable behavior:
- in fig_A you can see Chart in "all is OK" state,

  - if I do Chart1LineSeries1.Active:=FALSE (this series is tied to Axis #0) then all Axes suddenly expands (see attached fig_B),
  - if I do Chart.Axis#0.Range.UseMin/Max:=FALSE then all Axes scales to expected range (see attached fig_C).

Attached Test Project.

Is this a Bug?

Valdas Jankūnas -------------- next part -------------- A non-text attachment was scrubbed... Name: fig_A.png Type: image/png Size: 19558 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190106/3b7dbe94/attachment-0003.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: fig_B.png Type: image/png Size: 16517 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190106/3b7dbe94/attachment-0004.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: fig_C.png Type: image/png Size: 20691 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190106/3b7dbe94/attachment-0005.png> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_project.zip Type: application/zip Size: 4551 bytes Desc: not available URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190106/3b7dbe94/attachment-0001.zip>

Reply by email

Werner Pamler
to Valdas Jankūnas
Valdas Jankūnas wrote 13 lines
Hello, in Test Project I have a Chart with several LineSeries and one AreaSeries. AutoScaleAxisTransform in each Axis is used. I noticed some unexplainable behavior:  - in fig_A you can see Chart in "all is OK" state,  - if I do Chart1LineSeries1.Active:=FALSE (this series is tied to Axis #0) then all Axes suddenly expands (see attached fig_B),  - if I do Chart.Axis#0.Range.UseMin/Max:=FALSE then all Axes scales to expected range (see attached fig_C). Attached Test Project. Is this a Bug?

This is hard to tell from the description alone, there are so many possibilities... You should create a litte project which shows the issue and attach it (please include only source files, .pas, .lfm, .lpi, .lpi, no .exe, .ppu).

Reply by email

Valdas Jankūnas
to Werner Pamler

2019-01-06 19:56, Werner Pamler via lazarus rašė:

Am 06.01.2019 um 18:00 schrieb Valdas Jankūnas via lazarus: This is hard to tell from the description alone, there are so many possibilities... You should create a litte project which shows the issue and attach it (please include only source files, .pas, .lfm, .lpi, .lpi, no .exe, .ppu).

I attached in my first mail.

Valdas Jankūnas

Reply by email

Werner Pamler
to Valdas Jankūnas
Valdas Jankūnas wrote
I attached in my first mail.

Sorry. When I scrolled down I only saw the screenshots.

Yes, this looks strange, and it could be a bug - I'll have to investigate. In the meantime you can work around by releasing the Range lock of the axis of the series that you want to deactivate:

procedure TForm1.CheckBox1Change(Sender: TObject);
begin
    Chart1LineSeries1.Active := Checkbox1.Checked;
    Chart1.AxisList[Chart1LineSeries1.AxisIndexY].Range.UseMin :=
Checkbox1.Checked;
    Chart1.AxisList[Chart1LineSeries1.AxisIndexY].Range.UseMax :=
Checkbox1.Checked;
end;

Reply by email