在Android中是否有原生方法或库来创建图表?

我想本机呈现而不是加载带有某些Web库的Webview

android - Android-径向图实现-LMLPHP

最佳答案

AnyChart包含此功能。

有一个very comprehensive sample snippet,其核心是:

@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);
}


与数百条定制行一起,结果类似于:

android - Android-径向图实现-LMLPHP

08-16 06:33