Recent

Author Topic: Changing chart extent on logarithmic axis crashes IDE  (Read 4480 times)

wp

  • Hero Member
  • *****
  • Posts: 11915
Changing chart extent on logarithmic axis crashes IDE
« on: August 21, 2011, 11:36:57 am »
When playing around with the new Intervals property of TChartAxis I observed reproducible crashes of the Lazarus IDE (r31986, fpc 2.4.4) using the following procedure:

- new project
- add a TChart to the form, Align = alClient
- add logarithmic AxisTransformation to the form, Base = 10
- change Chart.Extent: YMin = 0.001, YMax = 1000, UseYMin = true, UseYMax = true
- set LeftAxis.Transformations to the logarithmic AxisTransformation
--> Lazarus crashes

BTW: What is TChartAxis.Range? Is this the same as the corresponding TChart.Extent? Nothing happens, when I edit the Range parameter.

Ask

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 687
Re: Changing chart extent on logarithmic axis crashes IDE
« Reply #1 on: August 21, 2011, 12:45:18 pm »
Quote
I observed reproducible crashes

This is because Chart.Extent is measured in graph coordinates.
When you turn the logarithm transformation on,
it uses reverse transformation to convert graph coordinates to axis coordinates,
and tries to calculate 10^1000. You can see this more clearly by setting YMax to lesser value, e.g. 100.

The design-time crash is unfortunate, but hard to avoid.
I have added a safeguard in r32027, which hides offending axis
and lets you change the properties without restarting Lazarus.

Quote
What is TChartAxis.Range? Is this the same as the corresponding TChart.Extent? Nothing happens, when I edit the Range parameter.

Not quite. Axis.Range is measured in axis units.
However, it was only used if some series was assigned to the axis.
Fixed that in r32028.

Also, Chart .Extent has higher priority -- it is designed to enforce extent regardless
of any other considerations. In contrast, if you have, e.g. several
vertical axes, Axis.Range values are combined for them.
In turn, Axis.Range overrides the extent of any series assigned to this axis.


 

TinyPortal © 2005-2018