标注在不同的屏幕中移动

时间:2017-01-10 21:30:30

标签: highcharts

我试图为我们的图表实现标注,但注意到标注点会针对不同的屏幕尺寸进行调整。

这是正确的: -

enter image description here

错误的一个(屏幕尺寸更大)

enter image description here

这是我计算x_axis和y_axis的方法。有时这些点位于其他点上,所以我添加了一些值(x_axis_point& y_axis_point)来移动位置。

x_axis = (point.plotX + chart.plotLeft ) + parseInt(x_axis_position)
y_axis = (point.plotY + chart.plotTop ) - parseInt(y_axis_position)

工作小提琴。无论屏幕尺寸不同,标注框都应显示在同一位置。

https://jsfiddle.net/cucjw7xc/5/

新小提琴:行位移

https://jsfiddle.net/cucjw7xc/11/

0 个答案:

没有答案