How To Get Label For Corresponding Swipe In Barchart Of Mpandroidchart?
How to get label for corresponding bar when I swipe the barchart? I have another textview outside of barchart. When I swipe mpandroidchart graph, I need to get x axis label of corr
Solution 1:
In case of OnChartValueSelectedListener
, you can do
barChart.setOnChartValueSelectedListener(newOnChartValueSelectedListener() {
@OverridepublicvoidonValueSelected(Entry e, int dataSetIndex, Highlight h) {
String value = barChart.getBarData().getXVals().get(e.getXIndex());
}
@OverridepublicvoidonNothingSelected() {
}
});
In the similar way you can achieve this for other listeners too.
Post a Comment for "How To Get Label For Corresponding Swipe In Barchart Of Mpandroidchart?"