【发布时间】:2016-12-20 13:18:59
【问题描述】:
我正在尝试将两个 x 轴合并到一个轴上。
我有两个不同的系列,它们之间的区别在于时间(有时以秒为单位,有时以分钟为单位)
这是我的代码:
var chart = new Highcharts.Chart({
chart:{
renderTo:'chart',
zoomType: 'xy',
type:'line'
},
title: {
text: '',
x: -20
},
subtitle:{
text:'',
x: -20
},
xAxis:[{
id:0,
type:'categories',
categories:finalarray.time1
},
{
id:1,
type:'categories',
categories:finalarray.time2,
}],
yAxis:{
title:{
text:'',
align:'high'
},
labels:{
overflow:'justify'
}
},
tooltip:{
crosshairs: [{
width: 1,
color: 'red'
}, true],
valueSuffix: ''
},
plotOptions:{
series:{
cursor:'pointer'
},
line:{
dataLabels:{
enabled:true
}
}
},
credits:{
enabled:false
},
series:[
{
xAxis:0,
name: finalarray.description1 + " ( " + finalarray.unit1 + " ) ",
data: finalarray.value1
},
{
xAxis:1,
name: finalarray.description2 + " ( " + finalarray.unit2 + " ) ",
data: finalarray.value2
}
]
});
【问题讨论】:
-
这个问题没有正确提出。请参考:stackoverflow.com/help/how-to-ask。您甚至没有费心去完成 2 分钟的实地考察,这一事实看起来也很糟糕。
-
你想如何合并坐标轴?
标签: javascript highcharts