htafoya
htafoya

Reputation: 19273

Android - Radial Chart implementation

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

Upvotes: 2

Views: 709

Answers (2)

htafoya
htafoya

Reputation: 19273

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.

Upvotes: 1

Jake Lee
Jake Lee

Reputation: 7979

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

Upvotes: 0

Related Questions