ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.51k stars 5.99k forks source link

Percentage symbol #5073

Closed NVAT closed 1 year ago

NVAT commented 1 year ago

Hi, thank you for the great lib, but this part did not work, I can't show the percentage symbol. Thank you.

  I have used UIKIt
      let pFormatter = NumberFormatter()
               pFormatter.numberStyle = .percent
               pFormatter.maximumFractionDigits = 1
               pFormatter.multiplier = 1
               pFormatter.percentSymbol = " %"
        pieChartData.setValueFormatter(DefaultValueFormatter(formatter: pFormatter))

        pieChartData.setValueFont(.systemFont(ofSize: 11, weight: .light))
        pieChartData.setValueTextColor(.black)
Screenshot 2023-06-14 at 13 11 17
xingren66 commented 1 year ago

Hi, were you able to solve this issue? I had the same problem

NVAT commented 1 year ago

Hi, were you able to solve this issue? I had the same problem

Not, this problem still actual

xingren66 commented 1 year ago

Hi, were you able to solve this issue? I had the same problem

Not, this problem still actual

I found the answer elsewhere.

barChartView.data = data
data.setValueFormatter(valueFormatter)

https://github.com/danielgindi/Charts/issues/4690#issuecomment-897744617

NVAT commented 1 year ago

Hi, were you able to solve this issue? I had the same problem

Not, this problem still actual

I found the answer elsewhere.

barChartView.data = data
data.setValueFormatter(valueFormatter)

#4690 (comment)

Thank you its work