Reputation: 329
(This question was for MPAndroidChart-1.7.4)
I love using the mpandroidchart
library to create graphic plotting for my android app, but I am experiencing some difficulties with the LimitLine
object right now. I am trying to set the line to be transparent
and the label to be white with bigger font. Is it possible? I know there is no existing methods can do that right now, but just wondering if there is any way I can customize it myself? Any help would be great! Thanks.
Note: This is my first post so I can not attach an image here. I hope my question is clear to those who has experience with mpandroidchart
.
LimitLine ll1 = new LimitLine((float) (values[1]*maxFactor));
ll1.setLineWidth(1.5f);
ll1.setDrawValue(true);
ll1.setLineColor(res.getColor(R.color.new_orange));
ll1.setLabelPosition(LimitLabelPosition.RIGHT);
Upvotes: 0
Views: 1974
Reputation: 2555
You can do this with:
ll1.setLineColor(getResources().getColor(R.color.transparent));
Please define first the transparent color:
<color name="transparent">#00000000</color>
The color of the label is the same of the line. So, you can't change for white, and the line for transparent in the same time.
For change the font, you can do this for all chart.
Typeface tf = Typeface.createFromAsset(getAssets(), "OpenSans-Regular.ttf");
chart.setValueTypeface(tf);
chart.setCenterTextTypeface(Typeface.createFromAsset(getAssets(), "OpenSans-Light.ttf"));
Upvotes: 2