How to add “%” to data in ios-chart

后端 未结 2 474
再見小時候
再見小時候 2021-02-02 03:19

chart, here is my code:

private func setChart(pieChartView: PieChartView, values: [Double]) {

    var dataEntries: [PieChartDataEntry] = []

    let dataPoints          


        
2条回答
  •  别那么骄傲
    2021-02-02 03:33

    Please refer below code, i have added %.

    import UIKit
    
    class ViewController: UIViewController {
    
    
            @IBOutlet weak var pieChartView: PieChartView!
            override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
    
            let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
            let unitsSold = [20.0, 4.0, 6.0, 3.0, 12.0, 16.0]
    
            setChart(months, values: unitsSold)
    
    
    
    
        }
    
    
        func setChart(dataPoints: [String], values: [Double]) {
    
            var dataEntries: [ChartDataEntry] = []
    
            for i in 0..

    Let me know if i could help you.

    Have a happy coding.

提交回复
热议问题