2012-03-16 17 views
0

図を作成するためにStoreSeriesをDojoで使用しようとしています。私はで配列を作成しようとすると、しかし:新しいjavascriptオブジェクトを作成できません

new StoreSeries(store, { query: { site: 1 } }, "value"); 

その後のjavascriptは実行を停止し、グラフを描画し続けることができません。

これは関連性があると思われるすべてのスクリプトです。これ以上表示する必要があるかどうか尋ねます。

"dojo/store/Observable", 
"dojo/store/Memory", 
"dojox/charting/StoreSeries", 
さらに

アップを移動することによって、固定

function setupWeekElectricBar(Chart, theme, ClusteredColumns, Columns, Tooltip, Highlight, Observable, Memory, StoreSeries) 
    { 
    var data = [ 
     { id: 1, value: 5, site: 1 }, 
     { id: 2, value: 2, site: 1 }, 
     { id: 3, value: 3, site: 1 }, 
     { id: 4, value: 1, site: 1 }, 
     { id: 5, value: 3, site: 1 }, 
     { id: 6, value: 1, site: 1 } 
    ]; 

    // Create the data store 
    // Store information in a data store on the client side 
    var store = Observable(new Memory({ 
     data: { 
      identifier: "id", 
      label: "Users Online", 
      items: data 
     } 
    })); 

    var result = new StoreSeries(store, { query: { site: 1 } }, "value"); 

    //function does not get past here (checked using alert()) 

    } 


require([  
     // Require the basic chart class 
     "dojox/charting/Chart", 

     // Require the theme of our choosing 
     "dojox/charting/themes/Tufte", 

     // Charting plugins: 

     // We want to plot Pie and ClusteredColumns charts 
     "dojox/charting/plot2d/Pie", 
     "dojox/charting/plot2d/ClusteredColumns", 
     "dojox/charting/plot2d/Columns", 
     "dojox/charting/plot2d/Grid", 


     // Retrieve the Legend, Tooltip, and MoveSlice classes 
     "dojox/charting/action2d/Tooltip", 
     "dojox/charting/action2d/MoveSlice", 
     "dojox/charting/action2d/Highlight", 

     // We want to use Markers 
     "dojox/charting/plot2d/Markers", 

     // We'll use default x/y axes 
     "dojox/charting/axis2d/Default", 

     "dojo/parser", 

     "dojo/store/Observable", 
     "dojo/store/Memory", 
     "dojox/charting/StoreSeries", 

     "dijit/dijit", // loads the optimized dijit layer 
     "dijit/Calendar", 


     // Wait until the DOM is ready 
     "dojo/domReady!" 
    ], function(Chart, theme, Pie, ClusteredColumns, Columns, Grid, Tooltip, MoveSlice, Highlight, Observable, Memory, StoreSeries) { 
     setupWeekElectricBar(Chart, theme, ClusteredColumns, Columns,Tooltip, Highlight, Observable, Memory, StoreSeries); 
     } 
}); 
+0

あなたのJavascriptコンソールは何を言っていますか?見つけられない場合は、 'try/catch'ブロックで' var result = new StoreSeries(store、{query:{site:1}}、 "value"); 'をラップし、エラーを' alert' 。 –

答えて

0

関連する問題