ChartsOrg / ChartsOrg/Charts

DefaultValueFormatter is not working on v4.0.1

Open
#4,690 4 comments 9 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

## What did you do?

I want to use the below code to show the `%` value in a pie chart

```
let pFormatter = NumberFormatter()
pFormatter.numberStyle = .percent
pFormatter.maximumFractionDigits = 1
pFormatter.multiplier = 1
pFormatter.percentSymbol = " %"
data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter))
```

## What did you expect to happen?

The pie chart can show the value with the `%` sign.

## What happened instead?

On v4.0.1, the value formatted is never working.

on v3.6.0, everything works as expected.

## Charts Environment

**Charts version/Branch/Commit Number:** v4.0.1 and v3.6.0
**Xcode version:** 12.3
**Swift version:** 5
**Platform(s) running Charts:** ios
**macOS version running Xcode:** 10.15.7

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.