Any one found solution for custom marker Image using charts library. i want to add custom marker like in the bellow picture , anyone can help me. Thanks
Asked
Active
Viewed 1,307 times
1 Answers
0
I have used custom image in one of my graph
Please check below code to add marker with custom image in it.
let marker = BalloonMarker(color: .clear,
font: UIFont.systemFont(ofSize: 10.0, weight: UIFont.Weight.bold),
textColor: .black,
insets: UIEdgeInsetsMake(2, 2, 2, 2))
marker.chartView = self
marker.image = UIImage.init(named: "dialog_popup")
marker.minimumSize = CGSize(width:42,height:42)
self.marker = marker
self.drawMarkers = true
By adding this code marker is enabled in your chart.
Now do one more change in BalloonMarker
class:
add below line in draw()
method of above class:
image!.draw(in: rect)
Hope this will helps!

CodeChanger
- 7,953
- 5
- 49
- 80
-
Hi, have you do that highliteghted line height up to data point.if you did that can you help me. – Malleswari Nov 03 '17 at 05:56
-
And BalloonMarker is a subclass of what? – Jared_M Mar 30 '20 at 08:26