Search in sources :

Example 1 with AttachedTextValuePieChart

use of com.kyj.fx.voeditor.visual.component.chart.AttachedTextValuePieChart in project Gargoyle by callakrsos.

the class PMDViolationbyPieChartComposite method createNode.

/* (non-Javadoc)
	 * @see com.kyj.fx.voeditor.visual.component.pmd.chart.PMDViolationChartVisualable#createNode()
	 */
@Override
public Node createNode() {
    picChart = new AttachedTextValuePieChart();
    picChart.setLabelConverter(new StringConverter<PieChart.Data>() {

        @Override
        public String toString(PieChart.Data object) {
            int value = (int) object.getPieValue();
            double percent = (value * 100) / total.get();
            return String.format("%s\ncount : %d\n%.2f%%", object.getName(), value, percent);
        }

        @Override
        public PieChart.Data fromString(String string) {
            // TODO Auto-generated method stub
            return null;
        }
    });
    picChart.setChartGraphicsCustomAction((data, node) -> {
        chartGraphicsCustomAction(data, node);
    });
    dataList = picChart.getData();
    return picChart;
}
Also used : AttachedTextValuePieChart(com.kyj.fx.voeditor.visual.component.chart.AttachedTextValuePieChart) Data(javafx.scene.chart.PieChart.Data) AttachedTextValuePieChart(com.kyj.fx.voeditor.visual.component.chart.AttachedTextValuePieChart) PieChart(javafx.scene.chart.PieChart) Data(javafx.scene.chart.PieChart.Data)

Aggregations

AttachedTextValuePieChart (com.kyj.fx.voeditor.visual.component.chart.AttachedTextValuePieChart)1 PieChart (javafx.scene.chart.PieChart)1 Data (javafx.scene.chart.PieChart.Data)1