在我的反应本机应用程序中,我有一个highcharts图表显示一些条形图信息。
我想显示传奇,所以人们知道图表显示的内容,但是我想禁用触摸传奇时隐藏栏的功能。
另外,当您按下它们时,酒吧本身会逐渐淡出...我已经禁用了"工具提示",但是褪色仍然发生,我该如何停止?
如果我可以渲染到理想的静态图像!
仅用于信息,代码为
let Highcharts = "Highcharts";
const conf = {
chart: {
type: "column",
animation: false,
marginRight: 10,
dateFormat: "dd/mm/YYYY"
},
title: {
text: "Spread Events"
},
xAxis: {
type: "datetime",
tickPixelInterval: 50
},
yAxis: {
title: {
text: "Spread"
},
plotLines: [
{
value: 0,
width: 1,
color: "#808080"
}
]
},
tooltip: { enabled: false },
legend: {
enabled: true
},
exporting: {
enabled: false
},
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: FieldStore.graphData.slice()
};
在传说上禁用隐藏系列,请单击legendItemClick
事件函数返回false
。
禁用工具提示和对串联悬停的褪色效果将enableMouseTracking
设置为false。如果您还要关闭对传说悬停的褪色效果,请在不活动状态下更改opacity
:
plotOptions: {
series: {
enableMouseTracking: false,
states: {
inactive: {
opacity: 1
}
},
events: {
legendItemClick: function() {
return false;
}
}
}
}
实时演示: http://jsfiddle.net/blacklabel/gjkkprbto/
API参考:
https://api.highcharts.com/highcharts/series.bar.enablemousetracking
https://api.highcharts.com/highcharts/series.bar.events.legenditemclick
https://api.highcharts.com/highcharts/series.bar.states.inactive.opacity