2

Is there a native way or library to create a chart as this in Android?

I would like to render this natively rather than loading up a webview with some web library

Radial chart

htafoya
  • 18,261
  • 11
  • 80
  • 104

2 Answers2

1

For other people wondering, I did it with progressBars using a custom shape background, you can select the background, the "gray" area, and the progress, and even animate them.

htafoya
  • 18,261
  • 11
  • 80
  • 104
0

AnyChart contains this functionality.

There is a very comprehensive sample snippet, the core of which is:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_chart_common);

    AnyChartView anyChartView = findViewById(R.id.any_chart_view);
    anyChartView.setProgressBar(findViewById(R.id.progress_bar));

    CircularGauge circularGauge = AnyChart.circular();
    circularGauge.data(new SingleValueDataSet(new String[] { "23", "34", "67", "93", "56", "100"}));

    anyChartView.setChart(circularGauge);
}

Which, along with a few hundred customisation lines, results in something similar to:

radial chart

Jake Lee
  • 7,549
  • 8
  • 45
  • 86
  • You have to purchase it for commercial use or get the license for educational purpose. https://www.anychart.com/buy/non-commercial-license/ – Chanaka Fernando Apr 23 '23 at 17:27