MPAndroidChart - Legend labels are being cut off

后端 未结 9 1354
自闭症患者
自闭症患者 2020-12-15 17:18

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

Thank you

9条回答
  •  伪装坚强ぢ
    2020-12-15 17:49

    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;
    }
    

提交回复
热议问题