Reputation: 1943
In this example http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/xaxis/plotlines-label-align-right/
the label "Plot Line" is on the right side . My aim is to make it to the left and give some gap from the margin .
This is what I have tried .
yAxis: {
plotLines: [{
color: 'red',
width: 2,
value: 100,
label: {
text: 'Plot line',
align: 'left',
x: -10,
style: {
color: "green",
marginLeft: 4,
fontSize: "8px"
}
}
}]
}
Even though the label moves to left , the marginLeft or paddingLeft doesnt seem to work . How do I place the label 4px from left?
Upvotes: 0
Views: 308
Reputation: 4830
You can do that by setting x
to 4
yAxis: {
plotLines: [{
color: 'red',
width: 2,
value: 100,
label: {
text: 'Plot line',
align: 'left',
x: 4
}
}]
}
x
appears to be the horizontal offset from the starting position as defined by align
for the label
Upvotes: 2