Javascript 更改HighChart中绘制线标签的样式
在这个例子中 标签“打印线”位于右侧。我的目标是使它向左,并给一些差距,从边缘 这就是我尝试过的Javascript 更改HighChart中绘制线标签的样式,javascript,highcharts,Javascript,Highcharts,在这个例子中 标签“打印线”位于右侧。我的目标是使它向左,并给一些差距,从边缘 这就是我尝试过的 yAxis: { plotLines: [{ color: 'red', width: 2, value: 100, label: { text: 'Plot line', align: 'left',
yAxis: {
plotLines: [{
color: 'red',
width: 2,
value: 100,
label: {
text: 'Plot line',
align: 'left',
x: -10,
style: {
color: "green",
marginLeft: 4,
fontSize: "8px"
}
}
}]
}
即使标签向左移动,边缘左侧或填充左侧似乎也不起作用。如何从左侧放置标签4px?您可以通过将
x
设置为4
yAxis: {
plotLines: [{
color: 'red',
width: 2,
value: 100,
label: {
text: 'Plot line',
align: 'left',
x: 4
}
}]
}
x
似乎是从标签的align
定义的起始位置的水平偏移量您可以通过将x
设置为4
yAxis: {
plotLines: [{
color: 'red',
width: 2,
value: 100,
label: {
text: 'Plot line',
align: 'left',
x: 4
}
}]
}
x
似乎是从标签的align
定义的起始位置的水平偏移