OXChart icon indicating copy to clipboard operation
OXChart copied to clipboard

使用BarVerticalChart设置chart.setShowLable(false)时崩溃的解决办法

Open Naratsuna opened this issue 4 years ago • 0 comments

把BarVerticalChart类复制到项目中,并将xml中的引用改为这个,并修改下面的部分

    //下方lable范围计算
    int lableH = 0;
    if (showLable) {
        lableH = (heightLable > rectH ? heightLable : rectH) + lableTopSpace;
        lableRect = new RectF(rectChart.left, getMeasuredHeight() - getPaddingBottom() - lableH,
                rectChart.right, rectChart.bottom);
    }
    //改为下面,因为初始化并不需要判断是否显示标签
    //下方lable范围计算
    int lableH = (heightLable > rectH ? heightLable : rectH) + lableTopSpace;
    lableRect = new RectF(rectChart.left, getMeasuredHeight() - getPaddingBottom() - lableH,
                rectChart.right, rectChart.bottom);

Naratsuna avatar Jun 23 '20 09:06 Naratsuna