razerdp/AnimatedPieView

How to set color in piechart. ???

Closed this issue · 2 comments

该问题是怎么引起的?

How to set color in PieChart. I don't know what I am doing wrong.
Following is my code.

AnimatedPieView mAnimatedPieView = (AnimatedPieView) findViewById(R.id.chart);
AnimatedPieViewConfig mConfig = mAnimatedPieView.getConfig();
IPieInfo iPieInfo= new IPieInfo() {
@OverRide
public float getValue() {
return 50;
}

        @Override
        public int getColor() {
            return R.color.green;
        }

        @Override
        public String getDesc() {
            return "Bitcoin";
        }
    };
    mConfig.addData(new SimplePieInfo(iPieInfo.getValue(), iPieInfo.getColor(),iPieInfo.getDesc()))
            .setDuration(2000)
            .setConfig(mConfig);
    mAnimatedPieView.start();

重现步骤

报错信息

you should return the @colorInt not @colorRes.

I'm sorry for the method's name,and I'm refactoring AnimatedPieView,the new version will come soon(maybe in March),I promise.

please update to 1.2.0