Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highstock - irregular time interval

Highcharts has an example using irregular time intervals, I want to do the same on highstock howeverthere is no parameter for the xAxis-type.

JSFiddle code

My options are

$(function() {

$.getJSON('http://184.173.195.228/~ktwsn/temp2.php?action=get_sensor&sensor_serial%5B%5D=3B74F41400000069&sensor_serial%5B%5D=3BB2FA14000000E6&sensor_serial%5B%5D=3B91F11400000079&sensor_serial%5B%5D=3BC7F114000000E5&sensor_serial%5B%5D=3BC0F314000000E3&callback=?',
      {action: "get_sensor"},
          function(data) {
              var seriesOptions = [];
              $.each(data, function(key, val) {
                  seriesOptions.push({
                      name: val.name,
                      data: val.samples,
                      marker : {
                          enabled : true,
                          radius : 3
                      }
                  });
              });       
              // create the chart
              chart = new Highcharts.StockChart({
                  chart: {
                      renderTo: 'container',
                  },
                  xAxis: {
                      type: 'datetime'
                  },
                  rangeSelector: {
                      selected: 4
                  },    
                  series: seriesOptions
              });
          });   
});
like image 678
user1978109 Avatar asked Feb 26 '13 16:02

user1978109


1 Answers

Found it. The nomenclature between highcharts and highstock are different.

For Hightstock it's

xAxis: {       
    ordinal: false
}

The company really needs to combine highcharts and highstock. A single API documentation would be easier to follow.

like image 113
user1978109 Avatar answered Nov 06 '22 22:11

user1978109