I get a Pie Chart instead of a Donut Chart

Issue #55 new
Shashanka created an issue

I have followed the steps exactly as shown. But I get a pie chart instead of a donut chart. How is it that in your guide, the output is a donut chart and mine is a complete pie chart. . could you please explain . . ??

Comments (1)

  1. Lawrence Bang

    If you set a padding and innerCircleRatio, you will get a donut like the example.

            PieGraph pg = (PieGraph)findViewById(R.id.graph);
            PieSlice slice = new PieSlice();
            slice.setColor(Color.parseColor("#99CC00"));
            slice.setValue(2);
            pg.addSlice(slice);
            slice = new PieSlice();
            slice.setColor(Color.parseColor("#FFBB33"));
            slice.setValue(3);
            pg.addSlice(slice);
            slice = new PieSlice();
            slice.setColor(Color.parseColor("#AA66CC"));
            slice.setValue(8);
            pg.addSlice(slice);
    
            pg.setPadding(5);
            pg.setInnerCircleRatio(200);
    
  2. Log in to comment