У меня есть этот сюжет, который я получаю в форме данных таблицы MSSQL в формате JSON, но метки меток даты и времени показывают только одну точку. Формат даты и времени в JSON - это формат epoc [1325397600000,1325484000000,1325570400000,1325656800000,1325743200000,1325829600000].Ярлык оси Datetime в highcharts
В чем проблема?
Вот код, я использую:
$(document).ready(function() {
var options = {
chart: {
renderTo: 'container',
type: 'line',
marginRight: 130,
marginBottom: 60
},
title: {
text: 'Pressure and Temperature',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: []
type: 'datetime',
},
yAxis: {
title: {
text: 'Temperature '
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function() {
return '<b>'+ this.series.name +'</b><br/>'+
this.x +': '+ this.y;
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: []
}
$.getJSON("data3.php", function(json) {
options.xAxis.categories = json[0]['data'];
options.series[0] = json[1];
options.series[1] = json[2];
chart = new Highcharts.Chart(options);
});
});
вы можете поделиться Js скрипку с данными выборки, которая будет воспроизводить один и тот же вопрос вы получили – Strikers