title: CanvasJS Line Chart with Date Selector & Range Selector Using Api
body: <p>So, i have a similar code as here: <a href="https://jsfiddle.net/canvasjs/zxrkh502/" rel="nofollow noreferrer">https://jsfiddle.net/canvasjs/zxrkh502/</a>
  But i need put data from <strong>ajax/json</strong>  instead of <em>randomData</em> function. How can i do it?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var dps = [];
  
  var chart = new CanvasJS.Chart("chartContainer",
   {
    title: {
     text: "Chart with Date Selector"
    },
    data: [
    {
       type: "line",
       dataPoints: randomData(new Date(2017, 0, 1), 400)
      }
    ]
  });
  chart.render();
  
     etc...</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank You!</p>