- edited description
Index of bar clicked in BarGraph is only 0 or -1
Issue #9
resolved
The problem is in the onTouchEvent method. You should use the same implementation you used in PieGraph, that one works great.
The main difference is that you check if index is greater than -1 in PieGraph...
if (r.contains((int)point.x,(int) point.y) && listener != null){
if (indexSelected > -1){
listener.onClick(indexSelected);
}
indexSelected = -1;
}
... but you do not in BarGraph:
if (r.contains((int)point.x,(int) point.y) && listener != null){
listener.onClick(indexSelected);
}
Comments (5)
-
reporter -
reporter - attached holographlibrary.patch
This is a simple patch for this issue.
-
repo owner Feel free to submit a pull request :)
-
reporter Done :)
-
repo owner - changed status to resolved
Thank you :)
- Log in to comment