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;
}
Aggregations