Welcome Guest Search | Active Topics |

DateTime Axis Interval behavior seems buggy
dan
#1 Posted : Monday, October 22, 2012 10:10:56 AM(UTC)
Rank: Member

Groups: Registered
Joined: 10/22/2012(UTC)
Posts: 12

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
I had a datetime x axis defined like this.

axes: [{type: 'dateTime', location: 'bottom', labels:{strokeStyle: '#AAAAAA', fillStyle : '#AAAAAA', angle: 30, stringFormat: 'd mmmm, yyyy', lineWidth: 1}}],

The interval displays correctly in most cases, but when the number of days the dataset spans less 2 days or less the automatic interval calculation results in 24 identical DD Month YYYY interval labels . I realize this is because I have excluded the hours from the labels. Since I don't care about the hour intervals, I have now set intervalType to 'days' as follows:

axes: [{type: 'dateTime', intervalType: 'days', location: 'bottom', labels:{strokeStyle: '#AAAAAA', fillStyle : '#AAAAAA', angle: 30, stringFormat: 'd mmmm, yyyy', lineWidth: 1}}],

Two problems arise when 'days' is set:

Bug 1: When the intervalType is set to 'days', the x-axis disappears whenever the dataset spans between 3 and 8 days or so. IE., The x-axis is displayed when the dataset spans 2 days, but not 3 days - 8 days.

Bug 2: When the dataset spans more than 2.5 months, there is a lot of overlapping x-axis labels. It looks like some of the interval labels are automatically removed in an attempt to prevent overlap, but the calculations are incorrect for my legend font settings.
Dragan
#2 Posted : Monday, October 22, 2012 12:12:08 PM(UTC)
Rank: Advanced Member

Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered
Joined: 1/3/2011(UTC)
Posts: 483

Thanks: 0 times
Was thanked: 87 time(s) in 87 post(s)
Hi,

In your case I think it is best to keep the jqChart automatic calculation of the intervalType and just changing the string format.

There are 2 ways you can do this:
- With using “stringFormat” option, which you already observed.
- With using “hoursIntervalStringFormat”. In this case you can set custom formatting, which is used only when the intervalType becomes ‘hours’. I think you set it to something like

Code:
hoursIntervalStringFormat : "HH:MM d mmmm"



Best Regards,
Dragan Matek
jqChart Inc.
1 user thanked Dragan for this useful post.
dan on 10/25/2012(UTC)
dan
#3 Posted : Thursday, October 25, 2012 12:30:27 PM(UTC)
Rank: Member

Groups: Registered
Joined: 10/22/2012(UTC)
Posts: 12

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
Thanks. I have found that hoursIntervalStringFormat works as long as stringFormat is absent.

Because the default m/d/YYYY format is now displayed whenever the interval is not hours, and stringFormat cannot be used to change this, it is necessary to also specify daysIntervalStringFormat, weeksIntervalStringFormat, monthsIntervalStringFormat, and yearsIntervalStringFormat to ensure the default format is never shown.
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

FlatEarth Theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.096 seconds.