title: Add sparklines pie chart to Jquery DataTable from javascript
body: <p>I am trying to make <code>sparklines</code> pie-charts render in <code>JQuery Datatables</code> dynamically. I can add a <code>JQuery sparklines</code> piechart into <code>JQuery DataTable</code> like this:</p>
  <pre><code>                                                    &lt;table id=&quot;dt-basic-example&quot;
                                                         class=&quot;table table-bordered table-hover table-striped w-100&quot;&gt;
                                                      &lt;thead&gt;
                                                      &lt;tr&gt;
                                                          &lt;th&gt;pie_chart&lt;/th&gt;
                                                       
                                                      &lt;/tr&gt;
                                                      &lt;/thead&gt;
                                                      &lt;tbody&gt;
                                                          &lt;tr&gt;
                                                              &lt;td&gt;
                                                               &lt;span class=&quot;sparklines&quot; sparkType=&quot;pie&quot; sparkHeight=&quot;50&quot; sparkWidth=&quot;auto&quot; values=&quot;4,6,7,7,4&quot;&gt; &lt;/span&gt;
                                                              &lt;/td&gt; 
                                                          &lt;/tr&gt;
                                                      &lt;/tbody&gt;
                                                  &lt;/table&gt;
  </code></pre>
  <p>How can I add the same pie chart when <code>$(document).ready()</code> ?</p>
  <p>I tried this, but it did not work:</p>
  <pre><code>    var myData = [
      {
          pie_chart: '&lt;span class=&quot;sparklines&quot; sparkType=&quot;pie&quot; sparkHeight=&quot;50&quot; sparkWidth=&quot;auto&quot; values=&quot;4,6,7,7,4&quot;&gt; &lt;/span&gt;'
      }
  ];
  
  
  $(function () {
      $('#dt-basic-example').dataTable({
          data: myData,
          columns: [
              {data: 'pie_chart'}
          ]
      });
  </code></pre>