各种自定义图表库,使用简单,支持扩展
自定义图标库,使用方便,扩展性强,后续会添加更多开发中使用到的图表
build.gradle中添加依赖:
implementation 'com.openxu.viewlib:OXViewLib:'指定java版本,否则会报错: android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } ... }
…
…ProgressPieChart chart1 = (ProgressPieChart)findViewById(R.id.chart1);
chart1.setProSize(DensityUtil.dip2px(this, 5)); //圆环宽度
chart1.setLoading(false);
chart1.setProColor(Color.parseColor("#ff0000")); //进度颜色
//环形中间显示的lable
List lables = new ArrayList<>();
lables.add(new ChartLable("60.0%",
DensityUtil.sp2px(this, 12), Color.parseColor("#ff0000")));
lables.add(new ChartLable("完成率",
DensityUtil.sp2px(this, 8), getResources().getColor(R.color.text_color_light_gray)));
chart1.setData(100, 60, lables);……暂无开放 Issues,或尚未同步最近议题。