custom axisValueFormatter is always getting unset
- Dominant language
- Swift
- Stars
- 28k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
I made a custom formatter that inherits from DefaultAxisValueFormatter so that I can print out custom labels, and I'm setting my xAxis.valueFormatter to this custom formatter. However, the get code is always re-setting it to the DefaultAxisValueFormatter because these conditions are always being met:
~~~~
get
{
if _axisValueFormatter == nil ||
(_axisValueFormatter is DefaultAxisValueFormatter &&
(_axisValueFormatter as! DefaultAxisValueFormatter).hasAutoDecimals &&
(_axisValueFormatter as! DefaultAxisValueFormatter).decimals != decimals)
{
_axisValueFormatter = DefaultAxisValueFormatter(decimals: decimals)
}
return _axisValueFormatter
}
~~~~
I got around it by not inheriting, but it seems like an issue others might run into too.
Contributor guide
Assessment
This issue has not been assessed yet.