title: dynamically update the data to Bar chart in DOJO.
body: <p>I am basically from 'c language' background, and having no sound idea about scripting. </p>
  
  <p>what i wanted to achieve is this:</p>
  
  <p>There is a bar graph which is presented in the SwapView. Now each time when the user visits this SwapView, i would like to reload the Bargrap with new set of datas. Assume that i have a data globally ie: window.myvalues. Which event i need to capture, and how to do that?</p>
  
  <p>Kindly advice.  Here is the sample which i have used from dojo site. </p>
  
  <pre><code> &lt;div id="barview" data-dojo-type="dojox.mobile.SwapView"&gt;
  
  
  
          &lt;script&gt;
              function mybarchartNode(){
  
  
                  require([
                           // Require the basic chart class
                           "dojox/charting/Chart",
  
                           // Require the theme of our choosing
                           "dojox/charting/themes/MiamiNice",
  
                           //  We want to plot Columns
                           "dojox/charting/plot2d/Columns",
  
                           // Require the highlighter
                           "dojox/charting/action2d/Highlight",
  
                           //  We want to use Markers
                           "dojox/charting/plot2d/Markers",
  
                           //  We'll use default x/y axes
                           "dojox/charting/axis2d/Default",
  
                           // Wait until the DOM is ready
                           "dojo/domReady!"
                           ], function(Chart, theme, ColumnsPlot, Highlight) {
  
  
                          console.log ("Data set in the bar graph ");
                          console.log (window.myDatas);
                          // Define the data
                          var chartData = [10000,9200,11811,12000,7662,13887,14200,12222,12000,10009,11288,12099];
  
                          // Create the chart within it's "holding" node
                          var chart = new Chart("barchartNode");
  
                          // Set the theme
                          chart.setTheme(theme);
  
                          // Add the only/default plot
                          chart.addPlot("default", {
                                        type: ColumnsPlot,
                                        markers: true,
                                        gap: 5
                                        });
  
                          // Add axes
                          chart.addAxis("x");
                          chart.addAxis("y", { vertical: true, fixLower: "major", fixUpper: "major" });
  
                          // Add the series of data
                          chart.addSeries("Monthly Sales",chartData);
  
                          // Highlight!
                          new Highlight(chart,"default");
  
                          // Render the chart!
                          chart.render();
                          });
  
  
  
  
              }  /* Function End */
  
              &lt;/script&gt;
  
  
  
  
  
          &lt;div id="barchartNode" style="width: 250px; height: 150px;"&gt;&lt;/div&gt;
  
          &lt;/div&gt; &lt;!- swap space end --&gt;
  
  
  
  
  &lt;!-- configure and load dojo --&gt;
      &lt;script src="dojo/dojo.js" data-dojo-config="isDebug:1, async:1"&gt;&lt;/script&gt;
      &lt;script&gt;
  
          require(["dojox/mobile/parser", "dijit/registry", "dojox/mobile",  "dojox/mobile/SwapView", "dojox/mobile/TabBar", "dojox/mobile/TreeView", "dijit/tree/TreeStoreModel","dojox/mobile/Button", "dojox/mobile/deviceTheme", "dojox/mobile/compat", "dojo/domReady!"],
                  function(parser) {
                  parser.parse();
                  });
  
          mybarchartNode();
          &lt;/script&gt;     
  </code></pre>