Search in sources :

Example 21 with PieData

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)));
}
Also used : PieData(org.xclcharts.chart.PieData)

Example 22 with PieData

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)));
}
Also used : PieData(org.xclcharts.chart.PieData)

Example 23 with PieData

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);
}
Also used : ArcPosition(org.xclcharts.event.click.ArcPosition) PointF(android.graphics.PointF) PieData(org.xclcharts.chart.PieData)

Aggregations

PieData (org.xclcharts.chart.PieData)23 ArcPosition (org.xclcharts.event.click.ArcPosition)5 Paint (android.graphics.Paint)3 PointF (android.graphics.PointF)1 ArrayList (java.util.ArrayList)1 PlotDot (org.xclcharts.renderer.line.PlotDot)1 PlotLegend (org.xclcharts.renderer.plot.PlotLegend)1