系列标记在线上禁用并在图表中启用图例 [英] Series markers disable on lines and enable on legend in Highchart
本文介绍了系列标记在线上禁用并在图表中启用图例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢,
Rocky。
解决方案您有两种选择:
- 启用整个系列的标记,但禁用每个点
- 使用两个系列,一个用于数据,一个用于图例,并通过ID将它们连接在一起。
示例:
var chart = new Highcharts.Chart({
图表:{
renderTo:'container'
} ,
plotOptions:{
series:{
marker:{
enabled:false
}
}
},
series :[{
data:[],
name:'test',
id:'id-1',
color:'red',
marker: {
enabled:true
}
},{
linkedTo:'id-1',
color:'red',
data:[29.9 ,71.5,106.4,129.2,144.0,176.0] b $ b}]
});
I have a line chart in Highchart with more than 10 series. When the chart is plotted for more that 2 months data with series marker enabled, the chart looks congested and makes no sense so I disabled series markers. When series marker is disabled, the markers in the legends also disappeared. What I want is to disable the markers only in the series and enable markers in legends. How can I achieve this? Can anybody please help me this?
Thanks, Rocky.
解决方案
You have two options:
- enable marker for whole series, but disable for each point
- use two series, one for data, one for legend and link them together by ID
Example:
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
plotOptions: {
series: {
marker: {
enabled: false
}
}
},
series: [{
data: [],
name: 'test',
id: 'id-1',
color: 'red',
marker: {
enabled: true
}
}, {
linkedTo: 'id-1',
color: 'red',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0]
}]
});
这篇关于系列标记在线上禁用并在图表中启用图例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文