Connor Neville
Connor Neville

Reputation: 7361

Swift ios-charts Set Bar Color on Highlight

Within the ios-charts delegate method:

@objc func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight) { }

I would like to change the color of the bar that was selected. Is this possible?

Upvotes: 2

Views: 5706

Answers (2)

You can change highlightColor and highlightAlpha on the chart data set.

Upvotes: 1

Sulthan
Sulthan

Reputation: 130102

You can change the color for highlights using:

highlightColor

on the chart data set.

The problem with ios-charts is that they don't have a good documentation and they link only to the Android documentation and some of the variables/methods are not very programmer friendly because they were translated from the Android version and don't really follow Swift naming conventions.

If you are looking for something, just open the source code for the given chart or its renderer.

Upvotes: 7

Related Questions