我正在使用 requirej 加载所有 Rickshaw js 文件,这样:
define([ "rickshaw","rickshaw/Rickshaw.Class","rickshaw/Rickshaw.Compact.ClassList","rickshaw/Rickshaw.Graph","rickshaw/Rickshaw.Graph.Renderer",
"rickshaw/Rickshaw.Graph.Renderer.Area","rickshaw/Rickshaw.Graph.Renderer.Line","rickshaw/Rickshaw.Graph.Renderer.Bar","rickshaw/Rickshaw.Graph.Renderer.ScatterPlot",
"rickshaw/Rickshaw.Graph.RangeSlider","rickshaw/Rickshaw.Graph.HoverDetail","rickshaw/Rickshaw.Graph.Annotate","rickshaw/Rickshaw.Graph.Legend",
"rickshaw/Rickshaw.Graph.Axis.Time","rickshaw/Rickshaw.Graph.Behavior.Series.Toggle","rickshaw/Rickshaw.Graph.Behavior.Series.Order",
"rickshaw/Rickshaw.Graph.Behavior.Series.Highlight","rickshaw/Rickshaw.Graph.Smoother","rickshaw/Rickshaw.Graph.Unstacker","rickshaw/Rickshaw.Fixtures.Time",
"rickshaw/Rickshaw.Fixtures.Number","rickshaw/Rickshaw.Fixtures.RandomData","rickshaw/Rickshaw.Fixtures.Color","rickshaw/Rickshaw.Color.Palette",
"rickshaw/Rickshaw.Graph.Axis.Y","rickshaw/Rickshaw.Series","rickshaw/extensions"], function() {
function draw(dObj, containerId, sliderId, timelineId, legendId) {
var graph = new Rickshaw.Graph({
element: document.getElementById(containerId),
renderer: 'area',
height: 400,
stroke: true,
series: dObj
});
graph.render();
var slider = new Rickshaw.Graph.RangeSlider({
graph: graph,
element: $(sliderId)
});
.......
}
当我加载页面时,我收到此错误:
类型错误:$super 不是函数