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'm having an issue in finding the center position of the RadarChartView.
I understand that it is suppose to be with the attribute radarChartView.centerOffsets but when I try to draw a square in the center like that : let x = radarChartView.centerOffsets.x let y = radarChartView.centerOffsets.y
you can see that my square is off the center of the Chart, what's up with that ?
Can you give me an another way to reach the center of the Chart, please ?
Paul
The text was updated successfully, but these errors were encountered:
Yes, that is the correct way to fetch the center position - but it may change, after calculating legend size before rendering.
So you might want to call notifyDataSetChanged, or wait until after you set the data property (which calls notifyDataSetChanged, and recalculates legend).
Also note that XIB width/height of a view is not final. In viewDidLoad the size may not be the final size, as later it fetches the size of the screen and resizes the views according to constraints.
Hello everyone,
I'm having an issue in finding the center position of the RadarChartView.
I understand that it is suppose to be with the attribute radarChartView.centerOffsets but when I try to draw a square in the center like that :
let x = radarChartView.centerOffsets.x
let y = radarChartView.centerOffsets.y
let pixel = Draw(frame: CGRect(
origin: CGPoint(x: x, y: y),
size: CGSize(width: 4, height: 4)))
pixel.layer.borderWidth = CGFloat(4)
pixel.layer.borderColor = UIColor.cyan.cgColor
self.view.addSubview(pixel)
here's what I get as a result :
you can see that my square is off the center of the Chart, what's up with that ?
Can you give me an another way to reach the center of the Chart, please ?
Paul
The text was updated successfully, but these errors were encountered: