MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

About MarkerView

Open xf222zt opened this issue 12 years ago • 2 comments

Hi Phil I had overwirte the MarkerView to make it fit my app。But when the content in the view be little more,its posionton on chart will be moved some pixels from the exact place。 How can i deal with it?

xf222zt avatar Nov 28 '14 07:11 xf222zt

https://github.com/PhilJay/MPAndroidChart/issues/285#event-217315895

Bishalsingh avatar Jan 13 '15 17:01 Bishalsingh

As of the latest commit, any issues concerning the position of the MarkerView should be fixed.

The MarkerView now provides 2 abstract methods from which the desired offsets have to be returned: AbstractMarkerView class

The implementation looks like the following: Custom MarkerView implementation

By returning -(getWidth() / 2); from the getXOffset() method, the MarkerView will be centered horizontally.

By returning -getHeight() from the getYOffset() method, the MarkerView position will be above the selected value.

PhilJay avatar Jan 13 '15 18:01 PhilJay