Lazarus

Programming => Graphics and Multimedia => TAChart => Topic started by: wp on November 25, 2012, 12:11:56 am

Title: DatetimeIntervalChartSource showing labels at the beginning of a month
Post by: wp on November 25, 2012, 12:11:56 am
Is there a way to force the DateTimeIntervalChartSource such that it always creates axis labels at the first of each month? This means, in particular, that the distance between labels would vary according to the days per month.

Is this possible with the DateTimeIntervalChartSource, or do I have to use a ListSource (which would not be so fine for zooming)?

Two more questions:
Title: Re: DatetimeIntervalChartSource showing labels at the beginning of a month
Post by: Ask on November 25, 2012, 01:59:25 am
Quote
the distance between labels would vary according to the days per month.
Sure, it should work like this by default.
Title: Re: DatetimeIntervalChartSource showing labels at the beginning of a month
Post by: wp on November 25, 2012, 11:52:35 am
But how do I get it to set marks at the beginning of each month? See attached project - I must be missing something...
Title: Re: DatetimeIntervalChartSource showing labels at the beginning of a month
Post by: Ask on November 26, 2012, 07:36:30 am
Quote
What is the meaning of the Steps options?
They represent basic steps to consider for the axis.
Algorithm goes roughly like this:
1) Consider a set of possible step values
{ v: v = s * n * 10^p, s in Steps, n in NiceSteps, n >= 1.0, p >= 0 }
2) From that set, select values which are allowed by limits in Params property
3) Is there are several of thouse, take the one which gives interval count closest to the Params.Count
4) Is there are several of (maximum two) values, take largest one.

Quote
When I change the DateTimeFormat the axis is not updated immediately at design time
Fixed in r39377

Quote
how do I get it to set marks at the beginning of each month?
According to the algorithm above,
TAChart determined that 10 days step is preferable to month.  You can: set RandomChartSource1.XMax = 40460, increase DateTimeIntervalChartSource1.Params.MinLength and/or MaxLength, exclude dtsDay from Steps, or perform another similar change to see month-sized intervals.

Additionally, TAChart have selected end-of-month instead of start-of month date, which is fixed in r39376.
Title: Re: DatetimeIntervalChartSource showing labels at the beginning of a month
Post by: wp on November 26, 2012, 06:00:48 pm
Thanks. Like with the logarithmic axis it's still hard to find settings that work for "all" chart sizes and zoom levels.
TinyPortal © 2005-2018