我需要使用prototype.js 进行Web 服务调用,然后使用highchart.js 绘制图表。我按照建议使用了prototype-adapter.js,但如果我尝试同时使用两者(highchart 和原型),我仍然会出错。我创建了一个 jsFiddle
$(function () {
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
marginRight: 130,
marginBottom: 25
},
title: {
text: 'Monthly Average Temperature',
x: -20 //center
},
subtitle: {
text: 'Source: WorldClimate.com',
x: -20
},
xAxis: {
categories: ['09/10', '09/11', '09/12', '09/13', '09/14']
},
yAxis: {
title: {
text: 'Temperature (°C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' + this.x + ': ' + this.y + '°C';
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -10,
y: 100,
borderWidth: 0
},
series: [{
name: 'ABCD',
data: [648.47, 636.43, 643.97, 640.92]
}, {
name: 'ABCD1',
data: [899.46, 882.80, 893.29, 889.07]
}, {
name: 'ABCD2',
data: [1359.06, 1328.04, 1349.74, 1342.52]
}]
});
});
});
如果我删除了prototype.js 和prototype-adapter.js,那么图表绘制得很好,但如果我包含它们,图表就不起作用。我需要prototype.js 来进行Web 服务调用。
请帮忙。
谢谢