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

How can I reset bargraph total width ? #509

Closed
Begoodi opened this issue Oct 26, 2015 · 1 comment
Closed

How can I reset bargraph total width ? #509

Begoodi opened this issue Oct 26, 2015 · 1 comment

Comments

@Begoodi
Copy link

Begoodi commented Oct 26, 2015

Here is my case

I have a bargraph with let's say 20 bars and only 10 visible with scroll option.
For any reason, I need to recalculate and redisplay it.
So I make barChartView.clear(), fetch new data, etc.

Now if the bargraph has only 5 values, the total width of the bargraph doesn't change and the bars are very thick (x4 in this case).
I would like the width of the bargraph to be not wider than the screen, as I have enough space to see it.

In other word, is there a method that would reset the graph better than with the clear() method ?

@Begoodi Begoodi changed the title How can I reset barograph total width ? How can I reset bargraph total width ? Oct 26, 2015
@liuxuan30
Copy link
Member

I remember the default solution will show all your data at once. It is simple math: less bars, more bar width;
The bar will never wider than the screen unless you zoomed in a lot; if this is the case, simply add maxScaleX would solve your problem? BTW, there is groupSpace and barSpace to control the width.

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

3 participants