使用高图,有没有办法根据特定的x / y轴值添加标签?
使用highchart's labels,我能够以像素为单位在给定位置写入文本,但我需要从轴给出一个值作为位置 .
例如,在this jsFiddle中,我想在'june'上设置标签位置,就像绘图线一样 .
我怎样才能做到这一点?
labels: {
items : [{
html : 'Summer starts here !' ,
style : {
left: '10px',
//I need to set the left position as an xValue : the timestamp for the summer start.
top: '100px'
}
}]
}
2 回答
您应该为tickmarkPlacement参数设置“on”值
http://api.highcharts.com/highcharts#xAxis.tickmarkPlacement
你的plotLine可以有一个标签,看看:http://api.highcharts.com/highcharts#xAxis.plotLines.label