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
The pieChart is added as a subview in the viewController and it take a touch Gesture of whole the viewController that is mean if there a button below chart i cannot press that button , So how to change the size of the view that contain the pieChart ?
The second issue is i want to delete the values inside the circle [0,100] i want blank circle how can i do that ?
i'm working in swift 3
This is my code :
func updateChartData(Points: String) {
let chart = PieChartView(frame: self.view.frame)
// 2. generate chart data entries
self.pieChartView.legend.enabled = false
self.pieChartView.circleBox.size
var entries = [PieChartDataEntry]()
for (index, value) in Totals.enumerated() {
let entry = PieChartDataEntry()
entry.y = value
entry.label = ""//Transactions[index]
entries.append(entry)
}
// 3. chart setup
let set = PieChartDataSet( values: entries, label: "")
// this is custom extension method. Download the code for more details.
var colors: [UIColor] = []
for i in 0..<entries.count {
// let red = Double(arc4random_uniform(256))
// let green = Double(arc4random_uniform(256))
// let blue = Double(arc4random_uniform(256))
// let color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
var color = UIColor.white
if(i == 0)
{
let red = Double(5)
let green = Double(113)
let blue = Double(176)
color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
}
else if(i == 1)
{
let red = Double(244)
let green = Double(165)
let blue = Double(130)
color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
}
else if(i == 2)
{
let red = Double(202)
let green = Double(0)
let blue = Double(32)
color = UIColor(red: CGFloat(red/255), green: CGFloat(green/255), blue: CGFloat(blue/255), alpha: 1)
}
colors.append(color)
}
// pieChartView.getLegend().setEnabled(false);
pieChartView.animate(xAxisDuration: 2.0, yAxisDuration: 2.0)
set.colors = colors
let data = PieChartData(dataSet: set)
chart.data = data
chart.noDataText = NSLocalizedString("No data available", comment: "No Data")
// user interaction
chart.isUserInteractionEnabled = true
let d = Description()
d.text = ""
chart.chartDescription = d
chart.legend.enabled = false
chart.centerText = Points + NSLocalizedString(" \n POINTS", comment: "Points")
chart.holeRadiusPercent = 0.5
chart.transparentCircleColor = UIColor.clear
chart.entryLabelColor = UIColor.white
self.view.addSubview(chart)
}
The text was updated successfully, but these errors were encountered:
i have two issues the first one is :
The pieChart is added as a subview in the viewController and it take a touch Gesture of whole the viewController that is mean if there a button below chart i cannot press that button , So how to change the size of the view that contain the pieChart ?
The second issue is i want to delete the values inside the circle [0,100] i want blank circle how can i do that ?
This is my code :
func updateChartData(Points: String) {
The text was updated successfully, but these errors were encountered: