Rajendra Sahu
Rajendra Sahu

Reputation: 33

How we can Add marker on each points in LineChart using charts swift

When I'm trying to show marker on each entry in LineChart using Charts framework.

let marker = BalloonMarker(color: .kPhysicsColor,
                           font: UIFont.medium(size: 11),
                           textColor: .white,
                           insets: UIEdgeInsets(top: 5, left: 5, bottom: 10, right: 3))
marker.chartView = chartView
marker.minimumSize = CGSize(width: 28, height: 20)
chartView.marker = marker

let lineChartData = LineChartData(dataSets: dataSets)
chartView.data = lineChartData

How we can show marker on each entry point in LineChart using charts.

Upvotes: 3

Views: 804

Answers (1)

ferus
ferus

Reputation: 376

While using Charts, you can use the highlightValues method on the chartView object to to set the values you want to be drawn without user interaction.

For this solution to work, remember to have drawMarkers set to true.

Upvotes: 2

Related Questions