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