Highcharts:如何删除工具提示容器的样式?
Higcharts: how to remove the styles of the tooltip container?
我有 following jsFiddle,我试图将值(悬停点)移动到图表左上角的静态位置。
这是我的设置,与工具提示相关:
tooltip: {
shared: true,
borderRadius: 10,
formatter: function () {
return this.points.reduce(function (s, point) {
let tooltipTxt = "";
tooltipTxt += point.x + "<br/>";
tooltipTxt += "Price: " + point.y + "<br/>";
return tooltipTxt;
}, this.x);
},
outside: true,
borderWidth: 0,
backgroundColor: 'transparent',
shadow: false,
style: {
color: '#000'
},
useHTML: true,
hideDelay: 3600000,
positioner: function (labelWidth, labelHeight, point) {
return {
x: 30,
y: 0
};
},
},
如何删除右上角框的样式并删除连接此框与当前鼠标位置的线条?
例如,我试图通过划掉要删除的线条来说明这一点(另外,工具提示框的回绕应该是透明的)
您使用的是样式模式,所以您需要通过CSS:
去除边框
.highcharts-tooltip-box {
stroke-width: 0;
}
现场演示: http://jsfiddle.net/BlackLabel/3L6t0d2e/
API参考:https://api.highcharts.com/highstock/chart.styledMode
文档: https://www.highcharts.com/docs/chart-design-and-style/style-by-css
我有 following jsFiddle,我试图将值(悬停点)移动到图表左上角的静态位置。
这是我的设置,与工具提示相关:
tooltip: {
shared: true,
borderRadius: 10,
formatter: function () {
return this.points.reduce(function (s, point) {
let tooltipTxt = "";
tooltipTxt += point.x + "<br/>";
tooltipTxt += "Price: " + point.y + "<br/>";
return tooltipTxt;
}, this.x);
},
outside: true,
borderWidth: 0,
backgroundColor: 'transparent',
shadow: false,
style: {
color: '#000'
},
useHTML: true,
hideDelay: 3600000,
positioner: function (labelWidth, labelHeight, point) {
return {
x: 30,
y: 0
};
},
},
如何删除右上角框的样式并删除连接此框与当前鼠标位置的线条? 例如,我试图通过划掉要删除的线条来说明这一点(另外,工具提示框的回绕应该是透明的)
您使用的是样式模式,所以您需要通过CSS:
去除边框.highcharts-tooltip-box {
stroke-width: 0;
}
现场演示: http://jsfiddle.net/BlackLabel/3L6t0d2e/
API参考:https://api.highcharts.com/highstock/chart.styledMode
文档: https://www.highcharts.com/docs/chart-design-and-style/style-by-css