jqplot指向IE9 +中的位置 [英] jqplot pointlabels off position in IE9+

查看:117
本文介绍了jqplot指向IE9 +中的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IE9 +中,当使用jqplotToImageStr时,点标签似乎只占据图表的第四象限(就好像整个图表缩小了一样)。图表正常显示(在我认为标签使用div时页面内)

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)

推荐答案

通过添加css修复它规则:

Fixed it by adding the css rule:

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

这是因为toimage函数有一个中心对齐文本的处理程序(这是(默认),这导致事情定位不正确。

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.

罪魁祸首:

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

在chrome中,textAlign属性实际上是-webkit-center,并且因此被忽略了。

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

这篇关于jqplot指向IE9 +中的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆