iOS-Charts How to put UIImage beside a point

≡放荡痞女 提交于 2019-12-04 19:15:39

You can modify private func drawCircles(context context: CGContext) inside LineChartRenderer.swift to do the following: inside the loop where the circles are drawing use pt var which is calculated there and add something like this:

let image = UIImage(named: numbers[i])
image?.drawInRect(CGRect(x: pt.x, y: pt.y, width: 16, height: 16))

Obviously, you need to play with CGRect to place images the way you need. This method will be called every time device orientation will be changing etc.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!