$(document).ready(function () {
var options = {
chart: {renderTo: 'container', type: 'line',}, rangeSelector: {enabled: true}, series: [{}]
};
$.getJSON('chart.php', function (data) {
options.series[0].data = data
var chart = new Highcharts.chart(options);
});
});
范围选择器和导航器是Highstock功能。要使用它们,请使用Highstock源代码和stockChart
构造函数类型。
$(document).ready(function() {
var options = {
chart: {
renderTo: 'container',
type: 'line',
},
rangeSelector: {
enabled: true
},
series: [{}]
};
$.getJSON('chart.php', function(data) {
options.series[0].data = data
var chart = new Highcharts.stockChart(options);
});
});
实时演示: http://jsfiddle.net/BlackLabel/n49t268u/
文档: https://www.highcharts.com/docs/stock/understanding-highstock