wuxudong / react-native-charts-wrapper

a react native charts wrapper (support android & iOS)
2.43k stars 657 forks source link

Percentage not show in iOS with Xcode14 #898

Closed Girum closed 1 year ago

Girum commented 1 year ago

Hi! I using the PieChart in my app, and using the value formatter, I can show correctly. But after the update to fix the lib in XCode14, the valueFormatter does not work anymore. Did you know how to workaround this (I cant concat with data value, because the values is only float/number).

Image (iOS and Android): Screen Shot 2022-09-27 at 09 15 02

eden-lecomte commented 1 year ago

I'm also having this issue, the custom valueFormatter string is no longer working since updating the library to work in XCode 14.

Previously the below valueFormatter string worked.

valueFormatter: "$#,###;-$#,###",
Screen Shot 2022-10-05 at 9 28 14 AM
wuxudong commented 1 year ago

It is related to https://github.com/danielgindi/Charts/issues/4690 , still waiting for merging of the fix PR.

ismilesky commented 1 year ago

How to solve this problem

wuxudong commented 1 year ago

@ismilesky No workaround right now.

wuxudong commented 1 year ago

Check v0.5.11

mMarcos208 commented 1 year ago

BarChart has error yeat.

Josee20 commented 1 year ago

pieChart has error yet.

Does Anybody knows how to solve this problem?

wuxudong commented 1 year ago

@Josee20 Which version are you using?

Josee20 commented 1 year ago

@wuxudong My XcoderVersion is 14.0.1 and Charts version is 4.1.0 my code is like this

// 3. Set ChartData

        let pieChartData = PieChartData(dataSet: pieChartDataSet)
        let format = NumberFormatter()
        format.numberStyle = .percent
        format.maximumFractionDigits = 1
        format.multiplier = 1
        format.percentSymbol = "%"

        let formatter = DefaultValueFormatter(formatter: format)
        pieChartData.setValueFormatter(formatter)

        mainView.currentMonthSchedulePercentageChart.data = pieChartData