java,// 柱状图,BarChart barChart = findViewById(R.id.barChart);,List entries = new ArrayList();,entries.add(new BarEntry(0, 20));,entries.add(new BarEntry(1, 40));,entries.add(new BarEntry(2, 60));,BarDataSet dataSet = new BarDataSet(entries, "Label");,BarData barData = new BarData(dataSet);,barChart.setData(barData);,barChart.invalidate(); // refresh,,// 曲线图,LineChart lineChart = findViewById(R.id.lineChart);,List lineEntries = new ArrayList();,lineEntries.add(new Entry(0, 10));,lineEntries.add(new Entry(1, 30));,lineEntries.add(new Entry(2, 50));,LineDataSet lineDataSet = new LineDataSet(lineEntries, "Label");,LineData lineData = new LineData(lineDataSet);,lineChart.setData(lineData);,lineChart.invalidate(); // refresh,
``Powered By Z-BlogPHP 1.7.3