【发布时间】:2018-05-09 02:20:51
【问题描述】:
我有一个 Highstock 图表,其中包含几个系列和几个月内每个系列的几个数据点。我希望能够调整导航器窗口中的选择,但我不能。
var seriesOptions = [
{
name: 'Apples',
data: [
{x: 1525737600000, y: Math.floor(Math.random() * 30)},
{x: 1535737600000, y: Math.floor(Math.random() * 30)},
{x: 1545737600000, y: Math.floor(Math.random() * 30)}
]
},
{
name: 'Oranges',
data: [
{x: 1525737600000, y: Math.floor(Math.random() * 30)},
{x: 1535737600000, y: Math.floor(Math.random() * 30)},
{x: 1545737600000, y: Math.floor(Math.random() * 30)}
]
},
{
name: 'Grapes',
data: [
{x: 1525737600000, y: Math.floor(Math.random() * 30)},
{x: 1535737600000, y: Math.floor(Math.random() * 30)},
{x: 1545737600000, y: Math.floor(Math.random() * 30)}
]
}
];
function createChart() {
Highcharts.stockChart('container', {
plotOptions: {
series: {
showInNavigator: true
}
},
tooltip: {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b><br/>',
valueDecimals: 0
},
series: seriesOptions
});
}
createChart();
这是fiddle。
【问题讨论】:
-
您也可以使用
xAxis.min属性更改初始默认范围:jsfiddle.net/BlackLabel/s5q1gg24
标签: highcharts highstock