ChartsOrg / ChartsOrg/Charts

Percentage Data Problem

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

Description

![Simulator Screen Shot - iPhone 12 Pro - 2021-03-10 at 18 44 28](https://user-images.githubusercontent.com/5398928/110673120-af59a300-81d0-11eb-9bbb-0ea3af2f612e.png)
> ℹ Please fill out this template when filing an issue.
> All lines beginning with an ℹ symbol instruct you with what info we expect. You can delete those lines once you've filled in the info.
>
> Per our [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md), we use GitHub for
> bugs and feature requests, not general support. Other issues should be opened on Stack Overflow with the tag [`ios-charts`.](https://stackoverflow.com/questions/tagged/ios-charts)
>
> Please remove this line and everything above it before submitting.

* [x] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).

## What did you do?

ℹ I want to show the percentage Label on my PieChart.
This is my code
let formatter = NumberFormatter()
formatter.numberStyle = .percent
formatter.maximumFractionDigits = 1
formatter.multiplier = 1
formatter.percentSymbol = " %"
let bvform = DefaultValueFormatter(formatter: formatter)
dataset.setValueFormatter(bvform)
in the version 3.6.0 worked in right way.

## What did you expect to happen?

ℹ with this array in input [1505, 208] I would show 87,8% and 12,2%

## What happened instead?

ℹ I show this value in the piechart = 87.85755983654407 and 12.142440163455925

## Charts Environment

**Charts version/Branch/Commit Number:** 4.0.1
**Xcode version:** 12.4
**Swift version:** 5.3
**Platform(s) running Charts:** iOS
**macOS version running Xcode:** 11.2.1

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.