I would like to use Chart.js library for drawing charts on my website, but I intend to feed the chart large amounts of data (>1000). However, when I feed the data to chart.js line chart, the chart is not made scrollable, but the values are pushed together rendering the chart unreadable. Is there a way to make the chart.js line chart scrollable on the x-axis?
I was experiencing this problem and worked around it by using jquery to edit the css of the parent div for my chartjs canvas. This isn't a very robust solution, but is does make the data readable/scrollable.
<div id="parentDiv"><canvas id="myChart" width="15000" height="400"></canvas></div>
<script>
$("#parentDiv").css("width", "1000px");
$("#parentDiv").css("overflow", "auto");
</script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With