use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class CircleChart02View method setPercentage.
// 百分比
public void setPercentage(int per) {
// PieData(标签,百分比,在饼图中对应的颜色)
mlPieData.clear();
int color = Color.rgb(72, 201, 176);
if (per < 40) {
mDataInfo = "容易容易";
} else if (per < 60) {
mDataInfo = "严肃认真";
color = Color.rgb(246, 202, 13);
} else {
mDataInfo = "压力山大";
color = Color.rgb(243, 75, 125);
}
mlPieData.add(new PieData(Integer.toString(per) + "%", per, color));
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class CircleChart04View method setPercentage.
// 百分比
public void setPercentage(int per) {
// PieData(标签,百分比,在饼图中对应的颜色)
mlPieData.clear();
int color = Color.rgb(72, 201, 176);
mDataInfo = "研究进行中......";
color = Color.rgb(243, 75, 125);
mlPieData.add(new PieData("Golang GO!", per, color));
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class DountChart01View method triggerClick.
// 触发监听
private void triggerClick(float x, float y) {
if (!chart.getListenItemClickStatus())
return;
ArcPosition record = chart.getPositionRecord(x, y);
if (null == record)
return;
PieData pData = lPieData.get(record.getDataID());
boolean isInvaldate = true;
for (int i = 0; i < lPieData.size(); i++) {
PieData cData = lPieData.get(i);
if (i == record.getDataID()) {
if (cData.getSelected()) {
isInvaldate = false;
break;
} else {
cData.setSelected(true);
}
} else
cData.setSelected(false);
}
if (isInvaldate)
this.invalidate();
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class DountChart01View method chartDataSet.
private void chartDataSet() {
// 设置图表数据源
// PieData(标签,百分比,在饼图中对应的颜色)
lPieData.add(new PieData("Solaris", "20%", 20, Color.rgb(77, 83, 97)));
lPieData.add(new PieData("Aix", "30%", 30, Color.rgb(148, 159, 181)));
lPieData.add(new PieData("HP-UX", "10%", 10, Color.rgb(253, 180, 90)));
lPieData.add(new PieData("Linux", "40%", 40, Color.rgb(52, 194, 188)));
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class PieChart01View method chartDataSet.
private void chartDataSet() {
/*
//设置图表数据源
chartData.add(new PieData("HP","20%",20,(int)Color.rgb(155, 187, 90)));
chartData.add(new PieData("IBM","30%",30,(int)Color.rgb(191, 79, 75),false));
chartData.add(new PieData("DELL","10%",10,(int)Color.rgb(242, 167, 69)));
//将此比例块突出显示
chartData.add(new PieData("EMC","40%",40,(int)Color.rgb(60, 173, 213),false));
*/
chartData.add(new PieData("closed", "9%", 9, Color.rgb(155, 187, 90)));
chartData.add(new PieData("inspect", "3%", 3, Color.rgb(191, 79, 75)));
chartData.add(new PieData("open", "76%", 76f, Color.rgb(242, 167, 69)));
chartData.add(new PieData("workdone", "6%", 6, Color.rgb(60, 173, 213)));
chartData.add(new PieData("dispute", "6%", 6, Color.rgb(90, 79, 88)));
}
Aggregations