Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bar going outside the graph when using label_count #10

Open
feedmac opened this issue Nov 29, 2011 · 2 comments
Open

bar going outside the graph when using label_count #10

feedmac opened this issue Nov 29, 2011 · 2 comments

Comments

@feedmac
Copy link

feedmac commented Nov 29, 2011

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

@alexyoung
Copy link
Owner

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

@feedmac
Copy link
Author

feedmac commented Dec 3, 2011

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants