Android achartengine doughnut chart

71 Views Asked by At

Hi all I am trying to reduce the inner radius of doughnut chart in Android development by using achartengine. I declared my chart layout as such:

<LinearLayout
      android:id="@+id/doughtnut_chart"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal">
</LinearLayout>

Then, I customized the renderer by using this:

renderer.setScale((float)1.4);

However, the radius of the circle is not reducing. I can't find any solution online either.

Any ideas? Thanks in advance.

1

There are 1 best solutions below

1
Dan D. On

The renderer.setScale() is the correct API to use for reducing the size, the parameter should probably be something smaller than 1.

Once done this, just call mChartView.repaint() in order to do the visual refresh, in case you are modifying the size during runtime.