-
-
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
Charts 3.0 how set xAxis gridline between bars like before? #1766
Comments
|
It doesn't fix our problem, this property is made for centering labels between charts, but that's not my question.. The problem is about centering gridline between charts, do you see? |
I'm having the same issue in #1763 |
@liuxuan30 Do you see what I mean? |
@Asavarkhul I am taking multiple bar chart in ChartsDemo as example, and looks like answered your question. The grid line is centered between bars as well as the labels. That's why I say |
@liuxuan30 Hello, can you try with this example project https://github.com/Asavarkhul/ChartsSampleProject/tree/chartsIssue/1767-xAxis-gridline-between-bars You can see how we have implement your solution proposal and the wired behavior we get. Regards |
Theres some way to do the same gridline separator? Like this image (https://cloud.githubusercontent.com/assets/10169030/19922578/849602da-a0e3-11e6-9f41-4d3aa6c24517.png)? |
hmm, It seems like a bug.. @danielgindi do you know we support such grid lines for single bar? I can't remember.. But I had a feeling in Chart 2.0, we used to support this. I just changed @Asavarkhul Below is how I did it with ChartsDemo - multiple bar chart, you can have a try: Make sure your float groupSpace = 0.08f;
float barSpace = 0.02f;
float barWidth = 0.9f;
// (0.9 + 0.02) * 1 + 0.08 = 1.00 -> interval per "group"
[dataSets addObject:set1]; // only need one
// specify the width each bar should have
data.barWidth = barWidth;
[data groupBarsFromX: startYear groupSpace: groupSpace barSpace: barSpace];
_chartView.data = data; change: open func groupBars(fromX: Double, groupSpace: Double, barSpace: Double)
{
let setCount = _dataSets.count
if setCount <= 1
{
print("BarData needs to hold at least 2 BarDataSets to allow grouping.", terminator: "\n")
return
} to: open func groupBars(fromX: Double, groupSpace: Double, barSpace: Double)
{
let setCount = _dataSets.count
if setCount < 1 // here
{
print("BarData needs to hold at least 2 BarDataSets to allow grouping.", terminator: "\n")
return
} Now it looks like this (due to the x axis interval, it will show every two bars: |
Is this fixed. I am trying to draw something like https://cloud.githubusercontent.com/assets/10169030/19922578/849602da-a0e3-11e6-9f41-4d3aa6c24517.png The Axis labels are drawn at centers but the grid lines are not as per expectations. Here is the the code I am trying.
|
Before the update we had this :
The grids bars where between each bars, but after the update, we have this now :
Do you know what to change in order to have our last behavior?
Here it's our configuration :
Regards
The text was updated successfully, but these errors were encountered: