You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cloned your demo of Swift ios and checking PieChart it is working fine as expected but it is not showing % symbol in your github demo, can you please look into this?
I am attaching the video for same.
charts.library.demo.video.mov
code
func setDataCount(_ count: Int, range: UInt32) {
let entries = (0..<count).map { (i) -> PieChartDataEntry in
// IMPORTANT: In a PieChart, no values (Entry) should have the same xIndex (even if from different DataSets), since no values can be drawn above each other.
return PieChartDataEntry(value: Double(arc4random_uniform(range) + range / 5),
label: parties[i % parties.count],
icon: #imageLiteral(resourceName: "icon"))
}
let set = PieChartDataSet(entries: entries, label: "Election Results")
set.drawIconsEnabled = false
set.sliceSpace = 2
set.colors = ChartColorTemplates.vordiplom()
+ ChartColorTemplates.joyful()
+ ChartColorTemplates.colorful()
+ ChartColorTemplates.liberty()
+ ChartColorTemplates.pastel()
+ [UIColor(red: 51/255, green: 181/255, blue: 229/255, alpha: 1)]
let data = PieChartData(dataSet: set)
let pFormatter = NumberFormatter()
pFormatter.numberStyle = .percent
pFormatter.maximumFractionDigits = 1
pFormatter.multiplier = 1
pFormatter.percentSymbol = " %"
data.setValueFormatter(DefaultValueFormatter(formatter: pFormatter))
data.setValueFont(.systemFont(ofSize: 11, weight: .light))
data.setValueTextColor(.black)
chartView.usePercentValuesEnabled = true
chartView.data = data
chartView.highlightValues(nil)
}
Thanks and regards
Deepak kumar
The text was updated successfully, but these errors were encountered:
Hello dear,
I cloned your demo of Swift ios and checking PieChart it is working fine as expected but it is not showing % symbol in your github demo, can you please look into this?
I am attaching the video for same.
charts.library.demo.video.mov
code
Thanks and regards
Deepak kumar
The text was updated successfully, but these errors were encountered: