MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Add custom background to labels

Open anmol-max opened this issue 5 years ago • 1 comments

Screenshot 2021-10-21 at 7 54 39 PM I want to add custom background to the labels.

anmol-max avatar Oct 25 '21 08:10 anmol-max

Label backgrounds are not a built in option, but in 4.0 XAxisRenderer.drawLabel is open again, so a subclass can draw a rounded rectangle behind each label before calling super.drawLabel, and you install it with chart.rendererXAxis = MyXAxisRenderer(chart.viewPortHandler, chart.xAxis, chart.getTransformer(YAxis.AxisDependency.LEFT)). The custom renderer guide walks through it: https://philjay.cc/mpandroidchart/docs/custom-renderers/ Closing this with the 4.0.0 release (https://github.com/PhilJay/MPAndroidChart/releases/tag/v4.0.0). Feel free to open a new issue if something is still missing.

PhilJay avatar Sep 26 '26 11:09 PhilJay