Skip to content

Commit

Permalink
Merge pull request ChartsOrg#4366 from giantramen/master
Browse files Browse the repository at this point in the history
Fix AxisBase Formatter Getter (Fixes ChartsOrg#4365)
  • Loading branch information
liuxuan30 authored Jun 22, 2020
2 parents bf3080f + ff7a2fc commit 8c97cb1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Source/Charts/Components/AxisBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,17 @@ open class AxisBase: ComponentBase
{
get
{
if _axisValueFormatter == nil ||
(_axisValueFormatter is DefaultAxisValueFormatter &&
(_axisValueFormatter as! DefaultAxisValueFormatter).hasAutoDecimals &&
(_axisValueFormatter as! DefaultAxisValueFormatter).decimals != decimals)
if _axisValueFormatter == nil
{
_axisValueFormatter = DefaultAxisValueFormatter(decimals: decimals)
}

else if _axisValueFormatter is DefaultAxisValueFormatter &&
(_axisValueFormatter as! DefaultAxisValueFormatter).hasAutoDecimals &&
(_axisValueFormatter as! DefaultAxisValueFormatter).decimals != decimals
{
(self._axisValueFormatter as! DefaultAxisValueFormatter).decimals = self.decimals
}

return _axisValueFormatter
}
set
Expand Down

0 comments on commit 8c97cb1

Please sign in to comment.