Sign in Join

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

Mailing lists / lazarus / 2014-09

Using a DateTimeIntervalChartSource in TAChart

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Richard Mace

Hi All,
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. Could somebody give me any pointers please?

Thanks

PS I've have looked at the "axis" demo under the TAChart components, which does display a DateTime on the bottom axis, however, it didn't seem clear to me on how that graph actually got it's data.

Thanks, as always, in advance.

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140923/8e176524/attachment.html>

Reply by email

Unknown author
> 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.freepascal.org/pipermail/lazarus/attachments/20140923/791cf4fb/attachment.html>

Reply by email

Richard Mace
to Unknown author
Show quoted text 13 lines
* 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.

?Thanks very much Werner, that was a great help.
Where can I find the Intervals.Min and MaxLength properties?

Richard?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140923/f09eccdf/attachment.html>

Reply by email

Werner Pamler
> Where can I find the Intervals.Min and MaxLength properties?

MinLength and MaxLength are sub-properties of the "Params" of the DateTimeIntervalChartSource. Sorry, I confused it with the property "Intervals" of the Axis...

Reply by email

Richard Mace
to Werner Pamler
Werner Pamler wrote 7 lines
Where can I find the Intervals.Min and MaxLength properties? >> > MinLength and MaxLength are sub-properties of the "Params" of the DateTimeIntervalChartSource. Sorry, I confused it with the property "Intervals" of the Axis...

?Perfect, thanks Werner, that's made a massive difference.

Richard?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140924/9034085f/attachment.html>

Reply by email