我正在关注此示例Create bar chart
,但出现错误Uncaught ReferenceError: Class is not defined
。
我已经包含了prototype.js的库
<script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
这是代码,
HTML :
<div id="d3area" angulard3-ear-chart datajson="'sample.json'" xaxis-name = "" xaxis-pos= "" yaxis-name="'Price/($)'" yaxis-pos="12" d3-format="'%d-%b%y'"
指令,
App.Js :
var BarGraph = Class.create({
initialize: function(datajson,xaxisName,xaxisPos,yaxisName,yaxisPos,d3Format) {
this.datajson = datajson;
this.xaxisName = xaxisName;
this.xaxisPos = xaxisPos;
this.yaxisName = yaxisName;
this.yaxisPos = yaxisPos;
this.d3Format = d3Format;
},
workOnElement: function(element) {
},