使用 dojo 工具包渲染一个简单的折线图时,我快疯了。一切都很好,只是鼠标悬停时工具提示不显示。ChartData 是具有以下结构的对象列表:
[{'x':x1, 'y':y1, 'tooltip':"some text"}, {...}, ...]
放大动画适用于 Chrome 和 Firefox。我尝试按照此处的建议更改主题,但仍然没有结果。我做错了什么?
require([
"dojox/charting/Chart",
"dojox/charting/axis2d/Default",
"dojox/charting/plot2d/Lines",
"dojox/charting/themes/MiamiNice",
"dojox/charting/action2d/Tooltip",
"dojox/charting/action2d/Magnify"],
function(Chart, Tooltip, Magnify, themes, Lines, Default) {
var chartData = data["res"];
var chart = new Chart("graph", {title: data["title"],
titleFontColor: "#79B30B"});
chart.addAxis("y", {vertical: true, min: 0, max:110});
chart.addAxis("x");
chart.addPlot("default", { type: "Lines", markers: true,
tension:3,
shadows: {dx: 2, dy: 2, dw: 2} } );
chart.setTheme(dojox.charting.themes.MiamiNice);
chart.addSeries("Connectivity[%]", chartData);
var tooltip = new dojox.charting.action2d.Tooltip(chart, "default");
var magnify = new dojox.charting.action2d.Magnify(chart, "default");
chart.render();
});