I want to customize the bar marker in Android MpChart library. Here is what I expected but do no know? How to show marker on the tip of the bar? I tried setting the background as image view with arrow marker at bottom but it will move if I switch between bars.
Asked
Active
Viewed 882 times
0
-
1Please, look at this - it may be helpful: https://stackoverflow.com/questions/41458190/customize-the-marker-mpandroidchart – Lilya Jul 21 '20 at 13:18
1 Answers
0
barChart.setMarker(new MarkerView(getActivity(),R.layout.tooltip){ // tooltip is layout you want to set as markerview, for background use a drawble
@Override
public void refreshContent(Entry e, Highlight highlight) {
// set the total , prome etc here
super.refreshContent(e, highlight);
}
@Override
public MPPointF getOffset() {
return new MPPointF(-(getWidth() / 2), -getHeight()); // place the midpoint of marker over the bar
}
});
see for more information

Abhinav Chauhan
- 1,304
- 1
- 7
- 24