ico
ico copied to clipboard
bar going outside the graph when using label_count
Not sure if this is a bug or feature request, but if you use label_count some of the data (bars) will go outside the actual graph. Would be nice if all data (bars) would show inside the graph.
new Ico.BarGraph($('bargraph'), { data: [150, 100, 50, 25]}, { bar_labels: true, label_count: 10});
One way you can force this to behave is to pass label_step:
new Ico.BarGraph($('bargraph'),
{ data: [150, 100, 50, 25] },
{ bar_labels: true, label_count: 10, label_step: 15 });
Thanks for the reply! I've done exactly this, and written a function that calculates the best "label_step" value based on max and min values of the dataset. I guess this is what I feel would be a nice feature for the "label_count" parameter - if it would automatically decide on the best "label_step" value.