我们正在使用 Dojox 做一个项目,并且一直在努力加载脚本。我们尝试使用 Google cdn 链接:.
我们还尝试将工具包导入到我们的项目中。但是,失败了。给出“未捕获的引用错误”。任何帮助表示赞赏。下面是我的代码:
<!doctype html>
<html>
<head>
<script src="dojo-release-1.9.1/dojox/charting"></script>
<script type="text/javascript">
require(['dojox/charting/Chart2D','dojox/charting/axis2d/Default','dojox/charting/plot2d/De fault','dojox/charting/plot2d/Spider','dojox/charting/axis2d/Base'],function(Chart, Default, Default, Spider, Base){
var chart = new dojox.charting.Chart("test");
chart.addPlot("default", {
type: "Spider",
labelOffset: -10,
seriesFillAlpha: 0.2,
markerSize: 3,
precision: 0,
spiderType: "polygon"
});
var data= [ {"CPU Utilization":1,"NetworkIn":444,"DiskReadBytes":1.00002,"NetworkOut":360.00001,"DiskWriteBytes":1.00002},
{"CPU Utilization":1.0001,"NetworkIn":444,"DiskReadBytes":1.0002,"NetworkOut":360.00001,"DiskWriteBytes":1},
{"CPU Utilization":1,"NetworkIn":486.00002,"DiskReadBytes":1.00001,"NetworkOut":360.00001,"DiskWriteBytes":1} ];
chart.addSeries("min", {data: data[0] }, { fill: "blue" });
chart.addSeries("max", {data: data[1] }, { fill: "blue" });
chart.addSeries("USA", {data: data[2] }, { fill: "blue" });
chart.render();
chart.removeSeries("min");
chart.removeSeries("max");
});
</script>
</head>
<body><div id="test" style="width: 400px; height: 240px; margin: 30px auto 0px auto;"> </div></body>
</html>