Radius of Doughnut chart in AchartEngine

筅森魡賤 提交于 2019-12-02 02:31:45

renderer.setScale((flaot)1.3) solved my problem but the inner and outer radius is approx not prefect.

You have to just chage value of decCoef (variable in DoughnutChart class). In DefaultRenderer add your own radius variable and create getter and setter. now, use this variable in DoughnutChart.

for example ,

 DefaultRenderer defaultRenderer = new DefaultRenderer();
defaultRenderer.setmWidth(0.1f);

In DoughnutChart class :

public class DoughnutChart extends RoundChart {
    private float mWidth; // make your own variable and initialize in constructor 

    public DoughnutChart(MultipleCategorySeries dataset, DefaultRenderer renderer) {
       super(null, renderer);
        mDataset = dataset;
        mWidth = renderer.getmWidth();
   }
   double decCoef =  mWidth / cLength; // change value of decCoef by using our variable. 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!