use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class RadarChart03View method chartDataSet1.
private void chartDataSet1() {
// 设置图表数据源
// PieData(标签,百分比,在饼图中对应的颜色)
// (int)Color.rgb(39, 51, 72)));
roseData1.add(new PieData("", 7, Color.rgb(190, 254, 175)));
// (int)Color.rgb(39, 51, 72)));
roseData1.add(new PieData("", 12, Color.rgb(190, 254, 175)));
// (int)Color.rgb(39, 51, 72)));
roseData1.add(new PieData("", 13, Color.rgb(190, 254, 175)));
// (int)Color.rgb(77, 83, 97) ));
roseData1.add(new PieData("", 15, Color.rgb(190, 254, 175)));
// (int)Color.rgb(148, 159, 181)));
roseData1.add(new PieData("", 27, Color.rgb(190, 254, 175)));
// (int)Color.rgb(253, 180, 90)));
roseData1.add(new PieData("", 32, Color.rgb(190, 254, 175)));
// (int)Color.rgb(52, 194, 188)));
roseData1.add(new PieData("", 55, Color.rgb(190, 254, 175)));
// (int)Color.rgb(39, 51, 72)));
roseData1.add(new PieData("", 35, Color.rgb(190, 254, 175)));
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class CircleChart03View method setPercentage.
// 百分比
public void setPercentage(int per) {
if (per < 50) {
mDataInfo = "轻松搞定";
chart.getLabelPaint().setColor(Color.WHITE);
chart.getDataInfoPaint().setColor(Color.WHITE);
} else if (per < 70) {
mDataInfo = "充满活力";
chart.getLabelPaint().setColor(Color.rgb(85, 41, 124));
chart.getDataInfoPaint().setColor(Color.WHITE);
} else {
mDataInfo = "不堪重负";
chart.getLabelPaint().setColor(Color.RED);
chart.getDataInfoPaint().setColor(Color.RED);
}
// PieData(标签,百分比,在饼图中对应的颜色)
mlPieData.clear();
mlPieData.add(new PieData(Integer.toString(per) + "%", per, Color.rgb(72, 201, 176)));
}
use of org.xclcharts.chart.PieData in project XCL-Charts by xcltapestry.
the class ClickPieChart01View method triggerClick.
// 触发监听
private void triggerClick(float x, float y) {
ArcPosition record = chart.getPositionRecord(x, y);
if (null == record)
return;
PieData pData = chartData.get(record.getDataID());
Toast.makeText(this.getContext(), "[此处为View返回的信息] key:" + pData.getKey() + " Label:" + pData.getLabel(), Toast.LENGTH_SHORT).show();
if (null != onClickListener)
onClickListener.onClick(new PointF(x, y), record);
}
Aggregations