Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Naratsuna opened this issue Jun 23, 2020 · 0 comments

Comments

@Naratsuna
Copy link

Naratsuna commented Jun 23, 2020

把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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant