xaxis unreadable when too many items
Hello,
on Line Chart i want to show history (month to month) from past 10 years. however their is too much label to write them all on the xaxis :( how to hide some label to show only few label who can be draw on the xaxis without overflowding their neighbor label ?
screenshoot: https://docs.google.com/file/d/0BwX45JL_Li5FWHRjRnVmblFkX00/edit?usp=drivesdk
and the scale numbers are cut off on the left side. I've also noticed that on a few charts.
@HaraldWalker You can see how I resolved this problem at #715
One possible solution is to print blank spaces for some of the labels. For instance, let's say you want to only have 10 X labels:
//assuming labelData is your current array of labels var labels = []; var labelsToShow = Math.floor(labelData .length / 10); for (var f = 0; f < chartData.length; f++) { if (f % labelsToShow == 0) { labels .push(f); } else { labels .push(""); } }
This is a use case for the chart type I'm proposing in https://github.com/nnnick/Chart.js/issues/1059. Maybe you are interested in helping developing this?
Huzzah! The first alpha of Chart.js 2.0 has landed and should fix this issue. Check out the release and try it out! We've got a lot of momentum right now, so please help us test so we can launch 2.0 Gold by the end of the month. https://github.com/nnnick/Chart.js/releases/tag/v2.0-alpha
I'm closing this issue for now, but if you have implementation questions or find bugs, please create a jsfiddle and post the link here and we'll reopen this issue and get it fixed.