Lazarus

Programming => Graphics and Multimedia => TAChart => Topic started by: arneolav on February 20, 2022, 01:42:53 pm

Title: TAChart and Hourly observations.
Post by: arneolav on February 20, 2022, 01:42:53 pm
I had problems with the date labels in the x-axis on a small number of observations and a chart width of 800 and less:

I have, in theory, x-axis  (BottomAxis) ranges from 0 to an indefinite number of days/hours.
In praxis one day 0 to 24, two days  0-48  so on.
Depending on the time of observation on a day:
At time 00:00, no observation, 01:00 one observation, so on.
The width of the Chart is default 800 but sizeable.

This setting seems to work well on smaller or wider forms:

-BottomAxis, Marks.Style = smsLabel.
-TDateTimeChartSource add to the Chart, BottomAxis.

In the TDateTimeChartSource:
DateTimeIntervalChartSource1.Params.MaxLength := 60; (may be up to 70 but less than 80 )     
DateTimeIntervalChartSource1.Params.MinLength  := 10; (seems to be best)
DateTimeIntervalChartSource1.Params.Tolerance   := 5;    (or less)
DateTimeIntervalChartSource1.Params.NiceSteps   := '1|2|4|6|12';   
The NiceSteps did the trick on small numbers.

This may be set in FormCreate or Object inspector.

Hope this help others
TinyPortal © 2005-2018