gh9
gh9

Reputation: 10693

highchart displaying only ever other point on a line

I have a series that contains information at 15 minute intervals. I want the series to only display a point at 30 minute intervals. I have combed through High charts api. But it doesn't seem to have a way only changing the series display without changing the x-axis. Does anyone know what option i need to include in the highchart decleration to achieve this.

Upvotes: 0

Views: 74

Answers (1)

Mark
Mark

Reputation: 108512

Why not just do it yourself?

    var someData = [[0,29.9], [1,71.5],[2, 106.4], [3,129.2], [4,144.0], [5,176.0], [6,135.6],[7, 148.5], [8,216.4], [9,194.1], [10,95.6], [11,54.4]];

    ....

    series: [{
        data: $.grep(someData, function(i,j){
            return j % 2 == 0;
        })
    }]

Fiddle here.

EDITS FOR COMMENTS

How about:

   series: [{
        data: $.map(someData, function(i,j){
            return {
                x: i[0],
                y: i[1],
                marker: {
                    enabled: j % 2 == 0
                }
            };
        })
    }]

Another fiddle here.

Upvotes: 1

Related Questions