score:0

I think your problem is the automatic adjustment of the datetime labels. Highcharts will take the date of a point and set the axis label according to its own logic.

For example if your axis spans several years it may display Aug 2012 or even just the year. So what you see as assigning the date 01.Aug 2012 to the axis in reality Highcharts is displaying a date representation that it finds suitable for the axis scale.

You can control this behavior by setting the DateTimeLabelFormat for your xAxis:

dateTimeLabelFormats : Object For a datetime axis, the scale will automatically adjust to the appropriate unit. This member gives the default string representations used for each unit. For an overview of the replacement codes, see dateFormat. Defaults to:

see HighCharts Reference

So all you have to do is change this:

{
    second: '%H:%M:%S',
    minute: '%H:%M',
    hour: '%H:%M',
    day: '%e. %b',
    week: '%e. %b',
    month: '%b \'%y',
    year: '%Y'
}

to something like

{
    second: '%H:%M:%S',
    minute: '%H:%M',
    hour: '%H:%M',
    day: '%e. %b',
    week: '%e. %b',
    month: '%e. %b',
    year: '%e. %b %Y'
}

to get it to display:

%e: Day of the month, 1 through 31. and %b: Short month, like 'Jan'.

So for example it will display 23. Jan for your point for an axis scale of day or above and 23. Jan 2012 for a scale over a year.

Another Method would be to force the chart to display your values. I don't think that is advisable in a datetime line chart but here is an example: JSFiddle

And here the StackOverflow question with a bit more detail

score:1

It's hard to tell if this is the exact issue that you're having without seeing the screenshots, but if your problem is what I think it is, here is the solution:

Try setting minPadding and maxPadding to 0 for the relevant axis along with startOnTick: true and endOnTick: true. Supposedly the behavior of startOnTick and endOnTick gets overridden if you don't also set the padding.


Related Query

More Query from same tag