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

Half Pie Chart no full view #2408

Closed
hoanglt10 opened this issue May 3, 2017 · 1 comment
Closed

Half Pie Chart no full view #2408

hoanglt10 opened this issue May 3, 2017 · 1 comment

Comments

@hoanglt10
Copy link

hoanglt10 commented May 3, 2017

I'm using half pie chart with width = 1/2 screen size and height = 200, but my chart no full view. I fix my problem in Android by code below.

private void moveOffScreen(final RelativeLayout lnlWrapPieChart, final PieChart mPieChart) {
        ViewTreeObserver vto = lnlWrapPieChart.getViewTreeObserver();
        vto.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
            @Override
            public void onGlobalLayout() {
                if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
                    lnlWrapPieChart.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                } else {
                    lnlWrapPieChart.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                }
                int height = lnlWrapPieChart.getMeasuredHeight();
                int offset = (int)(height * 1); /* percent to move */

                RelativeLayout.LayoutParams rlParams =
                        (RelativeLayout.LayoutParams)mPieChart.getLayoutParams();

                rlParams.setMargins(0, 0, 0, -offset);
                mPieChart.setLayoutParams(rlParams);
            }
        });

    }

Please help for me this problem. I'm using swift 3. Thank you.

@liuxuan30
Copy link
Member

liuxuan30 commented May 5, 2017

Have no idea what are you asking using half pie chart with width = 1/2 screen size and height = 200, but my chart no full view.

Please refer ChartsDemo how to use it.

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

2 participants