Search in sources :

Example 6 with ArcPosition

use of org.xclcharts.event.click.ArcPosition 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

ArcPosition (org.xclcharts.event.click.ArcPosition)6 PieData (org.xclcharts.chart.PieData)5 Paint (android.graphics.Paint)2 PointF (android.graphics.PointF)2 DisplayMetrics (android.util.DisplayMetrics)1 ViewGroup (android.view.ViewGroup)1 LayoutParams (android.view.ViewGroup.LayoutParams)1 FrameLayout (android.widget.FrameLayout)1 RelativeLayout (android.widget.RelativeLayout)1 ChartArcListener (org.xclcharts.event.click.ChartArcListener)1