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

Time:04-06

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.

CodePudding user response:

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.

  • Related