JQPlot 饼图抛出“无法获取属性‘0’的值:对象为空或未定义”错误
我正在使用基于 JQuery 的图表库 jqPlot(以及其中的饼图插件)来生成一个非常基本的饼图。它在 FF 等中工作正常,但(惊讶!)在 IE 中不行。在 IE 中,它实际上加载正常并且看起来不错,但是一旦我将鼠标滚动到图表上,它就会抛出以下错误:
无法获取属性“0”的值:对象为 null 或未定义
我设置所有内容的方式非常简单:
var optionsObj = {
seriesColors: ['#3399cc', '#cc6666', '#7ba550', '#ffcc66', '#d17314'],
grid: {
},
seriesDefaults: {
renderer: $.jqplot.PieRenderer,
rendererOptions: { lineLabels: true, lineLabelsLineColor: '#777'}
}
};
line1 = [['Coffee', 9],['Beer', 4],['TV', 6],['Lost umbrellas', 2],['Bicycle rides', 10]];
chart = $.jqplot('pieDiv', [line1], optionsObj);
我还应该提到我正在使用包含标签线的修改后的饼图插件,但我得到了这个即使使用常规饼图插件也会出现问题。可以在这里找到:http://blog。 statscollector.com/line-labels-for-the-pie-chart-in-jqplot/
有使用过这个库的人遇到过这样的事情吗? 任何帮助将不胜感激。 谢谢。
I'm using the JQuery based charting library jqPlot (and the pie chart plugin from it) to generate a very basic pie chart. It works fine in FF, etc. but (surprise!) not in IE. In IE it actually loads okay and looks fine, but once I roll my mouse over the chart it throws the following error:
Unable to get value of the property '0': object is null or undefined
The way I'm setting everything is very straightforward:
var optionsObj = {
seriesColors: ['#3399cc', '#cc6666', '#7ba550', '#ffcc66', '#d17314'],
grid: {
},
seriesDefaults: {
renderer: $.jqplot.PieRenderer,
rendererOptions: { lineLabels: true, lineLabelsLineColor: '#777'}
}
};
line1 = [['Coffee', 9],['Beer', 4],['TV', 6],['Lost umbrellas', 2],['Bicycle rides', 10]];
chart = $.jqplot('pieDiv', [line1], optionsObj);
I should also mention that I'm using the modified pie chart plugin that includes label lines, but I get this problem even when using the regular pie chart plugin. This can be found here: http://blog.statscollector.com/line-labels-for-the-pie-chart-in-jqplot/
Has anyone who has used this library before come across something like this?
Any help would be greatly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个
Try this
好像您缺少系列颜色。您有 3 个系列颜色,而第 1 行有 5 组。
Seems like you are missing series colors.Yo have 3 series colors while line 1 has 5 groups.