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

guoyutaog picture guoyutaog  Â·  3Comments

JW00332 picture JW00332  Â·  4Comments

anhltse03448 picture anhltse03448  Â·  3Comments

kwstasna picture kwstasna  Â·  3Comments