title: How to add "%" to data in ios-chart
body: <p>chart, here is my code:</p>
  
  <pre><code>private func setChart(pieChartView: PieChartView, values: [Double]) {
  
      var dataEntries: [PieChartDataEntry] = []
  
      let dataPoints = ["Mar","Apr","May"]
  
      for i in 0..&lt;dataPoints.count {
          let dataEntry = PieChartDataEntry(value: values[i], label: dataPoints[i])
          dataEntries.append(dataEntry)
      }
  
      let pieChartDataSet = PieChartDataSet(values: dataEntries, label: "")
      pieChartDataSet.colors = [UIColor(red: 47/255, green: 164/255, blue: 59/255, alpha: 1.0),UIColor(red: 17/255, green: 128/255, blue: 127/255, alpha: 1.0),UIColor.orange]
      let pieChartData = PieChartData(dataSet: pieChartDataSet)
      pieChartView.data = pieChartData
      pieChartView.centerText = "Amount Spent"
      pieChartView.chartDescription?.text = ""
      pieChartView.usePercentValuesEnabled = true
      pieChartView.legend.horizontalAlignment = .center
  
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QTqCV.png" rel="noreferrer"><img src="https://i.stack.imgur.com/QTqCV.png" alt="enter image description here"></a></p>
  
  <p>How to add "%" in PieChart data ? 
  NSNumberFormatter() is no longer available</p>
  
  <p><strong>---------------SOLUTION---------------</strong></p>
  
  <p>I post this solution for everyone who have same problem.
  I got it from chart-ios githup :</p>
  
  <pre><code>private func setChart(pieChartView: PieChartView, values: [Double]) {
  
      var dataEntries = [ChartDataEntry]()
  
      let dataPoints = ["Mar","Apr","May"]
  
      for i in 0..&lt;dataPoints.count {
          let dataEntry = PieChartDataEntry(value: values[i], label: dataPoints[i])
          dataEntries.append(dataEntry)
      }
  
      let pieChartDataSet = PieChartDataSet(values: dataEntries, label: "")
      let green = UIColor(red: 47/255, green: 164/255, blue: 59/255, alpha: 1.0)
      let blue = UIColor(red: 17/255, green: 128/255, blue: 127/255, alpha: 1.0)
      pieChartDataSet.colors = [green, blue, .orange]
      let pieChartData = PieChartData(dataSet: pieChartDataSet)
      let formatter = NumberFormatter()
      formatter.numberStyle = .percent
      formatter.maximumFractionDigits = 2
      formatter.multiplier = 1.0
      formatter.percentSymbol = "%"
      pieChartData.setValueFormatter(DefaultValueFormatter(formatter: formatter))
      pieChartView.data = pieChartData
      pieChartView.centerText = "Amount Spent"
      pieChartView.chartDescription?.text = ""
      pieChartView.usePercentValuesEnabled = true
      pieChartView.legend.horizontalAlignment = .center
      pieChartView.drawEntryLabelsEnabled = false
      pieChartView.holeRadiusPercent = 0.55
      pieChartView.highlightPerTapEnabled = false
      pieChartView.animate(yAxisDuration: 2.0, easingOption: .easeInBack)
  }
  </code></pre>