Crash in TBarSeries.Extent lazarus / 55-TAChart ---------------------------------------------------------------------- piola · 2019-11-03 05:51 I stumbled upon a bug in TBarSeries. Steps to reproduce: 1. Create a new TBarSeries bs1 (at runtime) 2. Add some x/y data to it 3. Calling bs1.MinXValue (and similar) as long as the series is not assigned to a chart causes a segfault. Suggestion: In "TBarSeries.Extent: TDoubleRect", change the second line (should be line 1519) to if IsEmpty or not Assigned(FChart) then exit; This way, the x-range does not take into account that the first and last bar should be fully visible, but it just returns the data's x-min and x-max without causing a crash. ---------------------------------------------------------------------- wp · 2019-11-03 10:27 I think this is an error condition, and an exception is ok to tell the programmer that he did something wrong. Showing only part of the first and last bars is certainly an error, too, which will be reported by somebody else who does not know about the background. In the new revision r62162, an EChartError exception is raised with a better error message. If you really need the extent of the data shown in the BarSeries *BEFORE* the series is added to the chart you should call BarSeries.Source.Extent. ---------------------------------------------------------------------- piola · 2019-11-03 11:17 Quote from: wp on November 03, 2019, 11:27:12 amIf you really need the extent of the data shown in the BarSeries *BEFORE* the series is added to the chart you should call BarSeries.Source.Extent. Ok, I understand. Thank you very much.