2015-02-10 64 views
0

我剛剛創建了一個簡單的Chart2d,關於這個圖表(數據系列顯示正常,主題是好的等),一切都ok了,所以我剛剛移動並試圖將Tooltip和Legend功能添加到此圖表。於是我想出了下面的代碼:現在道場表 - 圖例和工具提示顯示沒有風格/主題

require([ 
"dojox/charting/Chart", 
"dojox/charting/action2d/Tooltip", 
"dojox/charting/themes/Tom", 
"dojox/charting/widget/SelectableLegend", 
"dojox/charting/plot2d/Lines", 
"dojox/charting/plot2d/Markers", 
"dojox/charting/axis2d/Default", 
"dojo/store/JsonRest", 
"dojo/store/Memory", 
"dojo/store/Cache", 
"dojox/charting/StoreSeries", 
"dojo/domReady!" 
], function(Chart, Tooltip, Tom, SelectableLegend, LinesPlot, JsonRest, StoreSeries){ 

// ... the data store is initialed here .. 

chart.setTheme(Tom); 

chart.addPlot("default", { 
type: LinesPlot, 
markers: true 
}); 

. 
. 
. 

chart.render(); 
var tip = new Tooltip(chart, "default"); 
var leg = new dojox.charting.widget.SelectableLegend({ chart: chart, horizontal: true }, "legend1"); 
}); 

,問題是,我可以看到這兩個傳奇/工具提示此圖表,但似乎圖表主題並不適用於他們。

enter image description here

回答

0

我的壞..我只是忘了主道場樣式表(+可選的主題)添加到我的html文件:

<style type="text/css"> 
@import "./res/dojo__1_10_4/dojo/resources/dojo.css"; 
@import "./res/dojo__1_10_4/dijit/themes/tundra/tundra.css"; 
</style> 
<style>