ico icon indicating copy to clipboard operation
ico copied to clipboard

bar going outside the graph when using label_count

Open feedmac opened this issue 13 years ago • 2 comments
trafficstars

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});

feedmac avatar Nov 29 '11 11:11 feedmac

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 });

alexyoung avatar Dec 03 '11 09:12 alexyoung

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.

feedmac avatar Dec 03 '11 14:12 feedmac