1
我写了下面的代码:Highcharts addPoint:无法获得属性 'addPoint' 的值:对象为空或未定义
$(function instituciju_sprendimu_priemimo_palyginimas() {
var chart;
$(document).ready(function() {
// Build the chart
chart = new Highcharts.Chart({
chart: {
renderTo: 'container6',
plotBackgroundColor: null,
plotBorderWidth: null,
plotShadow: false
},
title: {
text: 'Institucijų sprendimų priemimo statistika'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage}%</b>',
percentageDecimals: 1
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
dataLabels: {
enabled: false
},
showInLegend: true
}
},
series: [{
type: 'pie',
name: ' ',
data: []
}]
});
chart.series[0].addPoint(['test1',100]);
chart.series[0].addPoint(['test2',200]);
});
});
我得到了以下错误:
addPoint: Unable to get value of the property 'addPoint': object is null or undefined.
我知道,我的问题可能很愚蠢,但我只是一个新手。
重新创建你在[jsfiddle.net(http://jsfiddle.net/)图,并添加链接你的问题,那么你会得到答案更快。 – 2013-02-28 10:00:33