开发者

HighCharts X-Axis Date Not Working (00:00)

I have a HighChart chart which contains a series which is made up of date/value pairs. Each date in the pairs is different. When there are data pairs which have dates which are not within the same week they dates are displayed as they should (mm/d开发者_JAVA技巧d/yyyy) but when the data set contains only a view pairs which are all within the same week or days right next to each other instead of displaying dates in the (mm/dd/yyyy) format the chart switches to what looks like a time display and shows 00:00, 08:00, 16:00 instead of the full dates.

I already scoured the HighCharts forum and cannot find nor get an answer to this strange behaviour. Maybe someone here can help.

You can see the chart at http://jsfiddle.net/schleichermann/DkgVr/


This is a foible of the auto-scaling algorithm.

Basically, it starts with the smallest unit and stops looking too soon in some cases (like yours)1.

If you know, in advance, the timescale of interest, you can tweak the xAxis settings to compensate.

In this case adding:

day: '%b %e',
hour: '%b %e',

May be adequate. See: jsfiddle.net/DkgVr/4/ .

Or setting tickInterval: 24 * 3600 * 1000 (one day) might be good enough.
See: jsfiddle.net/DkgVr/5/ .



1 It should probably work largest to smallest. Consider making a feature-request or bug report.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜