[Lazarus] Using a DateTimeIntervalChartSource in TAChart

werner.pamler at freenet.de werner.pamler at freenet.de
Tue Sep 23 10:10:10 CEST 2014


>> I am trying to create a line graph where the X axis is a zoomable TDateTime>> value and I believe that I need to use a DateTimeIntervalChartSource>> However, I cannot seem to work out how to add values to it.

You don't have to. The DateTimeIntervalChartSource gets the values from the 
axis it is assigned to. Here's what you have to do:

* Set up your chart as usual
* Add a TDateTimeIntervalChartSource. If you want to have the date/times along 
  the x axis select Chart.BottomAxis.Marks.Source to point to it. Also, set 
  Chart.BottomAxis.Marks.Style to smsLabel. In general, use the axis at which 
  you want to have the date/times.
* You may want to play with its properties a bit to optimize its output. For 
  example increase Intervals.MinLength and/or MaxLength to avoid overlapping 
  of labels.
* To be honest I don't fully understand the effect of the Steps property. I have the
  feeling that you have to turn off those options which you don't want to have 
  in the labels.


---
Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! Rundum glücklich mit freenetMail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140923/791cf4fb/attachment-0003.html>


More information about the Lazarus mailing list