ChartsOrg / ChartsOrg/Charts

Charts 3.0 how set xAxis gridline between bars like before?

Open
#1,766 10 comments 6 reactions 0 assignees View on GitHub
bug
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Before the update we had this :

capture d ecran 2016-11-02 a 10 01 59

The grids bars where between each bars, but after the update, we have this now :

capture d ecran 2016-11-02 a 09 59 55

Do you know what to change in order to have our last behavior?

Here it's our configuration :

```
//Chart configuration
self.chartView.drawBarShadowEnabled = false
self.chartView.drawGridBackgroundEnabled = false
self.chartView.setScaleEnabled(false)
self.chartView.highlightPerTapEnabled = false
self.chartView.highlightPerDragEnabled = false
self.chartView.drawValueAboveBarEnabled = false
self.chartView.noDataText = "list_issues_no_issue".localizedString()
self.chartView.chartDescription?.font = textFont
self.chartView.chartDescription?.textColor = UIColor.fBlueColor()

self.chartView.leftAxis.enabled = false

let rightAxis = self.chartView.rightAxis
rightAxis.drawGridLinesEnabled = false
rightAxis.labelFont = UIFont.preferredFont(forTextStyle: UIFontTextStyle.caption1)
rightAxis.labelTextColor = UIColor.fBlueColor()
rightAxis.valueFormatter = DefaultAxisValueFormatter(decimals: 1)

self.chartView.chartDescription?.text = ""
self.chartView.legend.enabled = false

let xAxis = self.chartView.xAxis
xAxis.drawGridLinesEnabled = true
xAxis.axisLineColor = UIColor.fBlueColor()
xAxis.labelPosition = .bottomInside
xAxis.labelFont = UIFont.preferredFont(forTextStyle: UIFontTextStyle.caption1)
```

Regards

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the supplied Swift chart configuration, especially the xAxis settings, and compare its gridline behavior with Charts 3.0. Reproduce the before-and-after layouts and trace how x-axis gridlines are positioned relative to bars. Done means restoring gridlines between bars without changing the intended labels or other axis settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.