Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
742 views
in Technique[技术] by (71.8m points)

android - MPAndroidChart - Legend labels are being cut off

I am using MPAndroidChart library. Anybody has this problem? When I put the labels in BOTTOM position, these are cut.

Thank you

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This seems to be a new feature since June (2015):

chart.getLegend().setWordWrapEnabled(true);

Javadoc:

/**
 * Should the legend word wrap? / this is currently supported only for:
 * BelowChartLeft, BelowChartRight, BelowChartCenter. / note that word
 * wrapping a legend takes a toll on performance. / you may want to set
 * maxSizePercent when word wrapping, to set the point where the text wraps.
 * / default: false
 * 
 * @param enabled
 */
public void setWordWrapEnabled(boolean enabled) {
    mWordWrapEnabled = enabled;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...