Matt H
Matt H

Reputation: 1129

How To Show All Data Labels For Datetime Axis In Highcharts

I'm using a Datetime axis in Highcharts to show a series of columns, and I'd like the date of the data point to appear directly beneath the column rather than a generic time marker as seen in this fiddle: http://jsfiddle.net/4s7t6jg6/2/

$(function () {
$('#container').highcharts(

    {"chart":{"type":"column"},"xAxis":{
        "dateTimeLabelFormats":{"month":"%m/%e"},
        "type":"datetime"
    },      

     "series":[{"data":[{"x":1406332800000.0,"y":358.0},

{"x":1408838400000.0,"y":417.0},{"x":1411344000000.0,"y":358.0},{"x":1416355200000.0,"y":323.0},{"x":1418860800000.0,"y":408.0},{"x":1421366400000.0,"y":280.0},{"x":1423872000000.0,"y":305.0},{"x":1426377600000.0,"y":314.0},{"x":1428883200000.0,"y":331.0},{"x":1431388800000.0,"y":412.0},{"x":1433894400000.0,"y":279.0}]}]}

    );
});

To be more specific in case I'm not describing it well, instead of the xAxis reading "09/1, 11/1, 01/1, etc" as it does currently, I would prefer it read "07/26, 08/24, 09/22, etc".

Upvotes: 2

Views: 1612

Answers (1)

jlbriggs
jlbriggs

Reputation: 17791

You can use the tickPostions property for this.

Provide your timestamps as an array of values to the property, and it will draw a tick at each stamp.

Example:

Reference:

Upvotes: 3

Related Questions