views:

155

answers:

1

I have Highcharts set up to display a graph with a bunch of xAxis categories. This is all working fine, but I would like to be able to skip some of the xAxis categories, so not everything one is shown. You can see an example of this working within Campaign Monitor's reporting section (screenshot: http://screencast.com/t/Y2FjNzQ4Y).

Any idea how I can achieve this same layout?

+2  A: 

Hi,

You can set the xAxis type as 'datetime' then set the pointInterval and PointStart in the plotoptions.

Code example:

var chart;
$(document).ready(function () {
    chart = new Highcharts.Chart({
        "xAxis": {
            "type": "datetime"

        "plotOptions": {
            "line": {
                "pointInterval": 86400000,
                "pointStart": 1282408923000
            }
        },
    });
});

The figures you see for pointInterval and Start are in millisecionds which you can generate using getTime() The interval in your case would be 86400000ms which is one day. The library displays appropriate intervals based on your data interval.

Gazler