Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touching Points #21

Closed
srombs opened this issue Dec 2, 2014 · 2 comments
Closed

Touching Points #21

srombs opened this issue Dec 2, 2014 · 2 comments

Comments

@srombs
Copy link

srombs commented Dec 2, 2014

Hello, I was wondering if there was a way to programmatically "touch" points, so the point would show up as if one touched it. I would like to use a seek bar with the graph. I was trying a motion event to trigger the touch. Would that be the way to go?

Cheers.

@lecho
Copy link
Owner

lecho commented Dec 2, 2014

Hi, I've just pushed fix for this, now you should be able to select value(point) from code using method:

SelectedValue sv = new new SelectedValue(lineIndex, pointIndex, SelectedValueType.NONE);
chart.selectValue(sv);

//deselect value by setting empty selected value, for example inside handler.postDelay() method
sv.clear();
chart.selectValue(sv)

Just be careful creating SelectedValue objects, first and second index have to point to value that exists in you dataset, otherwise ArrayIndexOutOfBounds will be thrown. So if you want to select the second point on the first line you should use:

new SelectedValue(0, 1, SelectedValueType.NONE);

Because lines and values are indexed starting from 0.

For other chart types it looks similar, for ColumnChart first index selects column, second index selects sub-column. For PieChart first index selects ArcValue, second index should have the same value as first index.

SelectValueType.NONE can be used for all chart type beside ComboLineColumnChart, for combo chart use SelectValueType.LINE if you want to select point, or use SelectValueType.COLUMN if you want to select sub-column value.

@srombs
Copy link
Author

srombs commented Dec 2, 2014

Awesome sir. Thank you very much. This was more than I was expecting. It works wonderfully.

@lecho lecho closed this as completed Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants