[英]Can the crosshair in a Highcharts chart set and be moved programmatically?
[英]How can I display crosshair labels on top of the chart with Highcharts
如何将十字准线标签呈现在HighStock图表的顶部?
现在,十字准线标签将呈现在xAxis上,该xAxis应该位于图表底部。
有没有办法在不更改xAxis位置的情况下将标签的位置更改为图表的顶部? 最后,十字线和标签应该看起来像一个标志,而不是一个反转的标志。
const chart = Highcharts.StockChart({
chart: {
renderTo: "chart",
},
credits: { enabled: false },
navigator: { enabled: false },
scrollbar: { enabled: false },
tooltip: { enabled: false },
rangeSelector: { inputEnabled: false },
series: [{
type: "area",
data: dataSet
}
],
xAxis: {
gridLineWidth: 1,
crosshair: {
color: lineColor,
label: { enabled: true, align: "right" }
}
}
});
十字准线标签与特定轴耦合。 但是,您可以创建两个链接的x轴。 顶轴应不可见,但应与十字线和标签耦合。
xAxis: [{
opposite: true,
crosshair: {
label: {
enabled: true,
align: "right"
}
},
visible: false
}, {
linkedTo: 0,
gridLineWidth: 1
}],
示例: http : //jsfiddle.net/p8fqq35v/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.