title: Chartist dynamic input
body: <p>I'm making a website where users can upload data that will be displayed as a graph </p>
  
  <p>HTML:<code>&lt;div id="data"&gt;&lt;/div&gt;</code></p>
  
  <p>test1.php outputs:<code>,-0.05,-0.07,-0.07,-0.07,0.14,0.14,0.09,0.07,0.07,0.07,0.07,0.65,0.63,0.63,0.63,0.63,0.63,0.58,0.56,0.56,0.56,0.56,0.84,0.79,0.77,0.77</code></p>
  
  <p>js/jquery: </p>
  
  <pre><code>$(document).ready(function(){
  
      $("#data").load("test1.php");
      var data = $("#data").text().split(",").slice(1);
  
      new Chartist.Line(".ct-chart", {
  
          labels: [data],
          series:[ data ]
          }, {
          fullWidth: true,
          height: 650,
          chartPadding: {
          right: 0
       }
  
     }); 
  
  });
  </code></pre>
  
  <p>The graph does not show up and I get the error</p>
  
  <blockquote>
    <p>Uncaught Error: Exceeded maximum number of iterations while optimizing
    scale step</p>
  </blockquote>
  
  <p>But if I type <code>$("#data").text().split(",").slice(1)</code> into the console and paste the output into labels and series it works fine it also works if you make data a normal array and don't get the data from the page </p>