DOJO 工具提示给出“未捕获的类型错误:对象不是函数”
DOJO Tooltip gives "Uncaught TypeError: object is not a function "
我有以下代码尝试使用dojox/charting/action2d/Tooltip
:
require([
"dojox/charting/Chart",
"dojox/charting/themes/Claro",
"dojox/charting/plot2d/MarkersOnly",
"dojox/charting/plot2d/Columns",
"dojox/fx/easing",
"dojox/charting/action2d/Tooltip",
"dojox/charting/axis2d/Default",
"dojo/ready"
], function(Chart, Theme, MarkersOnly, easing, Tooltip, Columns, Default, ready) {
ready(function(){
var chart1 = new Chart("chartArea");
chart1.setTheme(Theme);
chart1.addPlot("budget", {type: "MarkersOnly"});
chart1.addPlot("actual", {type: "Columns", gap: 3, animate: { duration: 300, easing: dojox.fx.easing.linear}});
//add the axis (both x and y) below
chart1.addAxis("x",{labels: [
{value:1, text: "01 - AXA"},{value:2, text: "02 - MR"},{value:3, text: "03 - CT"},{value:4, text: "04 - XP WH"},
{value:5, text: "06 - XP RF"},{value:6, text: "07 - XPC"},{value:7, text: "09 - ECS"},{value:8, text: "10 - XPU"}],
rotation:-90,
font: "normal normal bold 12pt Arial"
});//end adding axis to the chart
chart1.addAxis("y", {vertical: true, font: "normal normal bold 12pt Arial"});
chart1.addSeries("Series 2", [80,80,80,80,80,80,80,80,80,80,80,80,80], {plot:"budget"});
//chart1.addSeries("Series 1", [73,71,78,93,70,,,83,100,,,], {plot:"actual"});
chart1.addSeries("Series 1", [{y:75, tooltip:"custom"},{y:71},{y:78},{y:93},{y:70},{y:83},{y:100}], {plot:"actual"});
var tip = new Tooltip(chart1, "default");
chart1.render();
});//end of DOJO ready
});//end function chart stuff
DOJO给了我以下错误:
Uncaught TypeError: object is not a function
我可以弄清楚为什么会出现这个问题,特别是因为我发现多个示例以这种方式处理它。 有人知道吗?
依赖项列表和回调参数列表不匹配。
require([
"dojox/charting/Chart",
"dojox/charting/themes/Claro",
"dojox/charting/plot2d/MarkersOnly",
"dojox/charting/plot2d/Columns",
"dojox/fx/easing",
"dojox/charting/action2d/Tooltip",
"dojox/charting/axis2d/Default",
"dojo/ready"
], function(Chart, Theme, MarkersOnly, Columns, easing, Tooltip, Default, ready) { /* ... */ });
请注意参数的不同顺序:Columns
在MarkersOnly
之后。
按照你参数的顺序,Tooltip
指向dojo/fx/easing
模块并给你描述的错误。
相关文章:
- object响应时出现对象错误javascript
- Google嵌入API cb=gap对象错误
- JavaScript JSON对象对象错误
- JSON字符串到JavaScript对象错误
- Symfony2 JSON 对象 - 错误未捕获类型错误:无法使用“in”运算符搜索“636”
- 使用 Javascript 读取 JSON 对象(错误)
- 新的 $.fn.MyObject() 在 IE8 中触发“预期对象”错误
- 如何删除未定义的对象错误并根据位置重定向用户
- “'$' 为空或不是对象 ” 错误在 ajax 响应中
- 如何使用 AJAX 发布多个 JQuery 值并避免对象错误
- 我在IE移动版中使用计时器时收到[对象错误]
- IE8 中出现“需要对象”错误
- 存储为空或不是 dojo 中的对象错误
- IE 中需要 JavaScript 对象错误
- GSON 不是对象错误
- 如何使用TinyMCE和Internet Explorer 8解决“需要对象”错误消息
- 工作灯适配器 它不是一个函数,它是“对象”.错误
- IE8 - “为空或不是对象”错误
- 将小时数添加到 JavaScript 日期对象错误
- AJAX 请求导致“未定义不是对象”错误