Giter VIP home page Giter VIP logo

Comments (2)

razerdp avatar razerdp commented on July 4, 2024

I try to create a pie like yours.

However, It performance correctly.

Here is my demo gif.

My demo code base from MainActivity

        AnimatedPieViewConfig config = new AnimatedPieViewConfig();
        config.startAngle(0.9224089f)
                .addData(new SimplePieInfo(0.11943538617599236, getColor("FF446767")), true)
                .addData(new SimplePieInfo(0.41780274681129415, getColor("FFFFD28C")), true)
                .addData(new SimplePieInfo(0.722165651192247, getColor("FFbb76b4")), true)
                .addData(new SimplePieInfo(0.9184314356136125, getColor("FFFFD28C"), "长文字test"), false)
//                .addData(new SimplePieInfo(0.6028910840057398, getColor("ff2bbc80")), true)
//                .addData(new SimplePieInfo(0.6449620647212785, getColor("ff8be8ff")), true)
//                .addData(new SimplePieInfo(0.058853315195452116, getColor("fffa734d")), true)
//                .addData(new SimplePieInfo(0.6632297717331086, getColor("ff957de0")), true)
//                .addData(new SimplePieInfo(0.8226830459369171, getColor("FF446767")), true)
                .splitAngle(0.9649368f)
                .selectListener(new OnPieSelectListener() {
                    @Override
                    public void onSelectPie(@NonNull IPieInfo pieInfo, boolean isFloatUp) {
                        desc.setText(String.format(Locale.getDefault(),
                                "touch pie >>> {\n  value = %s;\n  color = %d;\n  desc = %s;\n  isFloatUp = %s;\n }",
                                pieInfo.getValue(), pieInfo.getColor(), pieInfo.getDesc(), isFloatUp));
                    }
                })
                .drawText(true)
                .duration(1200)
                .textSize(26)
                .focusAlphaType(AnimatedPieViewConfig.FOCUS_WITH_ALPHA)
                .textGravity(AnimatedPieViewConfig.ABOVE)
                .interpolator(new DecelerateInterpolator());
        mAnimatedPieView.applyConfig(config);

from animatedpieview.

prasad9323 avatar prasad9323 commented on July 4, 2024

from animatedpieview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.