add a padding on the xAxis, only on the values not on the Graph
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to find a solution to add a padding on the xAxis.
I DO NOT WANT TO CHANGE ANYTHING OF THE GRAPH ITSELF
My view looks like this :

As you can see the dates values are out of the graph. I would like to do recenter the the values on this axis.
When I call `chartView.xAxis.avoidFirstLastClippingEnabled = true` it does the work on one sidesuch as follow:

However it's not effective on the other side, plus the values do not have the right spacing anymore.
What could some my problem is to have an equivalent of this, only effective for those dates :
`chartView.setExtraOffsets(left: 36, top: 0, right: 36, bottom: 40)
`
I would be happy hear any kind of solution I am getting desperate on this.
Thanks for helping
Contributor guide
Research direction
Start by tracing the xAxis.avoidFirstLastClippingEnabled behavior and chartView.setExtraOffsets usage in the chart configuration. Reproduce the reported date-label clipping on an iPhone-sized chart, then determine whether axis-only padding can preserve the graph bounds and label spacing. Done means the x-axis values are centered and spaced correctly without changing the plotted graph.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- data-visualization, mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100