title: Dojo Chart selective labels for x-axis & grid
body: <p>I need to create a dojo chart </p>
  
  <p><a href="http://codebins.com/bin/4ldqp8z/1" rel="nofollow">http://codebins.com/bin/4ldqp8z/1</a></p>
  
  <p>In the above link my chart has x-axis labels like</p>
  
  <p>Current x-axis: <strong>11:am, 12:40pm, 2:20pm &amp; 4pm</strong></p>
  
  <p>for the same labels i have grid lines.</p>
  
  <p>Now the requirement is i just need 3 labels</p>
  
  <p>Required x-axis: <strong>10am, 1pm &amp; 4pm</strong></p>
  
  <p>chart shows data between 9:30 pm to 4 pm with 10 minutes interval.</p>
  
  <p>here is working sample :- <a href="http://codebins.com/bin/4ldqp8z/1" rel="nofollow">http://codebins.com/bin/4ldqp8z/1</a></p>
  
  <p>here is code :- you need to run it on http </p>
  
  <pre><code>&lt;html&gt;
  
      &lt;head&gt;
          &lt;meta content="text/html; charset=UTF-8" http-equiv="content-type"&gt;
          &lt;title&gt;Code Bins&lt;/title&gt;
                              &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js" &gt;&lt;/script&gt;
  
  
      &lt;/head&gt;
  
      &lt;body Body Params&gt;
          &lt;div id="chart1" style="width:300px;height:200px"&gt;
  &lt;/div&gt;    &lt;/body&gt;
                          &lt;script type="text/javascript"&gt;
                      require(["dojo/_base/declare", "dojo/dom-style", "dojo/ready", "dojox/charting/Chart",  "dojox/charting/action2d/PlotAction", "dojox/charting/axis2d/Default", "dojox/charting/plot2d/Columns", "dojox/charting/plot2d/Lines", "dojox/charting/plot2d/Grid"], function(declare, domStyle, ready, Chart, PlotAction, Default, Columns, Lines, Grid) {
  
      ready(function() {
          var chart = new Chart("chart1")
              .addAxis("y", { vertical: true, 
                  fixLower: "major", 
                  fixUpper: "major", 
                  leftBottom: false,
                  majorTicks:false,
                  minorTicks:false,
                  stroke: {color:"#FFF",width:0},
                  majorTick:{length:0}})
              .addAxis("x", {
                  labels: labels, /* Lables are coming from here*/
                  majorTicks:false,
                  majorTick:{length:4,color:"#FFFFFF"},
                  majorLabels:true,
                  majorTickStep:10,
                  minorTicks:false,
                  max:40,
                  stroke: {color:"#CFCFCF",width:"1"}})
              .addSeries("y", close, {  fill: "#EBEBEB"})
              .addPlot("Grid", {
                      type: "Grid",
                      markers: true
                  });
  
          chart.render();
      });
  });
  
  var close = [];
  for (var i = 0; i &lt; 40; i++) { close.push(parseInt((Math.random() * 100) + 1200)); }
  var labels = [{value: 1,text: "9:30am"},
  {value: 2,text: "9:40am"},{value: 3,text: "9:50am"},{value: 4,text: "10am"},{value: 5,text: "10:10am"},{value: 6,text: "10:20am"},{value: 7,text: "10:30am"},{value: 8,text: "10:40am"},{value: 9,text: "10:50am"},{value: 10,text: "11am"},{value: 11,text: "11:10am"},{value: 12,text: "11:20am"},{value: 13,text: "11:30am"},{value: 14,text: "11:40am"},{value: 15,text: "11:50am"},{value: 16,text: "12pm"},{value: 17,text: "12:10pm"},{value: 18,text: "12:20pm"},{value: 19,text: "12:30pm"},{value: 20,text: "12:40pm"},{value: 21,text: "12:50pm"},{value: 22,text: "1pm"},{value: 23,text: "1:10pm"},{value: 24,text: "1:20pm"},{value: 25,text: "1:30pm"},{value: 26,text: "1:40pm"},{value: 27,text: "1:50pm"},{value: 28,text: "2pm"},{value: 29,text: "2:10pm"},{value: 30,text: "2:20pm"},{value: 31,text: "2:30pm"},{value: 32,text: "2:40pm"},{value: 33,text: "2:50pm"},{value: 34,text: "3pm"},{value: 35,text: "3:10pm"},{value: 36,text: "3:20pm"},{value: 37,text: "3:30pm"},{value: 38,text: "3:40pm"},{value: 39,text: "3:50pm"},{value: 40,text: "4pm"}];
  // BOTTOM OF PAGE
                  &lt;/script&gt;
  
  
  
  &lt;/html&gt;
  </code></pre>