I was trying to draw a cubic line graph such as this:

using the MPAndroid chart library.
I am able to draw the line but not the fill between the X Axis and the line as shown in the picture.
Have gone through library and many SO questions.
I think you need this:
LineDataSet dataset = new LineDataSet(vals, null);
dataset.setDrawFilled(true); 
setDrawFilled(boolean filled)Set to true if the
DataSetshould be drawn filled (surface), and not just as a line, disabling this will give great performance boost! default:false
You can also control the transparency:
setFillAlpha(int alpha)sets the alpha value (transparency) that is used for filling the line surface (0-255), default: 85
And color:
setFillColor(int color)sets the color that is used for filling the line surface
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With