The kind of graphics that you have posted in your picture are certainly possible, although not easy, with MPAndroidChart.
You will have to write your own subclass of XAxisRenderer
:
ViewPortHandler vph = mChart.getViewPortHandler();
XAxisRenderer xAxisRenderer = new CustomXAxisRenderer(vph, mChart.getXAxis(), vph.getTransformer(AxisDependency.LEFT), image);
mChart.setXAxisRenderer(new CustomXAxisRenderer());
A very simple proof-of-concept would look something like this:
public class CustomXAxisRenderer extends XAxisRenderer {
Bitmap image;
public CustomXAxisRenderer(ViewPortHandler viewPortHandler, XAxis xAxis, Transformer transformer, Bitmap image) {
super(viewPortHandler, xAxis, transformer);
this.image = image;
}
@Override
protected void drawLabels(Canvas c, float pos, MPPointF anchor) {
//same code as super class
//then, code to draw the bitmap image on the canvas
//and, code to draw the extra text
}
}
Please see the following answers for how to scale bitmap images and draw them on the canvas:
How to make a custom image inside bars in MPAndroidChart
How to make a custom highlight drawable in MPAndroidChart
When you have a complete solution you are welcome to post it here as an answer. Good luck!
Note for proof of concept: overriding drawLabels
is a little crude. A better solution would extract a separate method from drawLabels
and make sure it is called in the draw(Canvas c)
of the superclass. See this answer if you want to do that.