Charts: Programatically highlight a data point in line chart

Created on 12 Jan 2016  路  5Comments  路  Source: danielgindi/Charts

Hi,

I've been looking and haven't been able to find a way to programmatically select a data point in a linechart. Is there a method to do this? If there is how do i access it?

Most helpful comment

Nevermind I found it.

I used
[self.chartView highlightValueWithXIndex:3 dataSetIndex:1 callDelegate:self];
Thanks!

All 5 comments

Nevermind I found it.

I used
[self.chartView highlightValueWithXIndex:3 dataSetIndex:1 callDelegate:self];
Thanks!

@osolano thanks it's really helpful but can you please elaborate how I highlight two value at a time?

@SagarDabhi Did you ever work out how to highlight multiple values?

Calling highlightValue without passing y value didn't work for me. I had to pass y value as well using the call
chartView.highlightValue(x: x, y: y, dataSetIndex: 0, callDelegate: true)

@shashidhar34 You can put in Double.nan for the Y value and it'll work. I had the same issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coop44483 picture coop44483  路  3Comments

Aungbandlab picture Aungbandlab  路  4Comments

brytnvmg picture brytnvmg  路  4Comments

kirti0525 picture kirti0525  路  3Comments

Bharati555 picture Bharati555  路  4Comments