jqplot pointlabels off position in IE9+

帅比萌擦擦* 提交于 2019-12-13 02:54:19

问题


In IE9+, the point labels seem to only occupy the 4th quadrant of the chart (as if the entire chart was scaled down) when using jqplotToImageStr. The chart displays normally otherwise (within the page when divs are used for the labels I believe)


回答1:


Fixed it by adding the css rule:

.jqplot-point-label {
    text-align: left;
}

this is because the toimage function has a handler for center aligned text (which is the default), which is causing things to be positioned incorrectly.

The culprit:

if ($(el).css('textAlign') === 'center') {
    templeft = left + (canvasWidth - context.measureText(w).width)/2  - transx;
}

In chrome the textAlign property actually comes up as -webkit-center, and is thus ignored.



来源:https://stackoverflow.com/questions/23635564/jqplot-pointlabels-off-position-in-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!