Chart.js in tablepress table
-
Hi Tobias!
The following code creates a chart:
<script type=”text/javascript” src=”https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.6/Chart.bundle.min.js”></script><div style=”height:300px;width:300px;”><canvas id=”ROEChart” width=”100″ height=”100″></canvas><script>var ctx = document.getElementById(“ROEChart”);var myChart = new Chart(ctx, { type: ‘bar’,data: { labels:[“-5Y”, “-4Y”, “-3Y”, “-2Y”, “-1Y”, “Current”],datasets: [{ label: ‘5yr Return on Equity’, data: [38.95,32.38,26.56,26.94,27.56,46.38],backgroundColor: [‘rgba(58, 187, 196, 0.2)’,’rgba(58, 187, 196, 0.2)’,’rgba(58, 187, 196, 0.2)’,’rgba(58, 187, 196, 0.2)’,’rgba(58, 187, 196, 0.2)’,’rgba(58, 187, 196, 0.2)’],borderColor: [‘rgba(46, 153, 160, 1)’,’rgba(46, 153, 160, 1)’,’rgba(46, 153, 160, 1)’,’rgba(46, 153, 160, 1)’,’rgba(46, 153, 160, 1)’,’rgba(46, 153, 160, 1)’],borderWidth:1}]},options: { scales: { yAxes: [{ ticks:{ beginAtZero:true }}] } } });</script></div>
However, when I put it in a tablepress table nothing appears.
Any insight into this?
Thanks so much!
The topic ‘Chart.js in tablepress table’ is closed to new replies.