-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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 to achieve 0 spacing between bars? #365
Comments
Seems the space is there because some of your green/grey bars are missing, and ios-charts need to make a place holder for every bar, even it is not there. |
@liuxuan30 but there shouldn't be any bars missing missing, take a look at the code, I have a range |
Here's the thing: |
@liuxuan30 I'm sorry, but now I understand my mistake 😥 Apparently I did it the wrong way trying to cover with 2 datasets. But then what will be the correct approach to achieve it? Should I put them all in the same dataset & create an array of colors for each item & assign it to the dataset & then customize the legend to follow that convention? |
@kexoth it first depends on what you want your chart looks like. 1 dataSet means one bar, remember that first. Puting more than one y value inside one dataSet will gives you a stacked bar chart. Check them out the ChartsDemo. There are multiple bar charts and stacked bar charts. For those spacing issues, if ios-charts does not support it yet, then you may need to override the renderer to get what you want, but this will get complicated and requires you understand how the bars is positioned and rendered. |
I managed to achieve the mentioned with 1 dataSet, assigned it an array of colors for every entry & created a custom labels & colors for the legend. Thanks anyway, I'll close the thread ✌️ |
Can i now remove spacing between Y bars in BarChartView ? |
I want to make a bar chart with 0 space between the bars, but couldn't manage to do that so far.
This is my current code for that matter:
No matter how I arrange the bars, only if I have gray after green I get the desired effect.
The code is with Swift 2.0 & I'm using your swift-2.0 branch.
The text was updated successfully, but these errors were encountered: