static PieChart getPieChart(String title) { PieChart pie = new PieChart(); pie.setTitle(title); pie.setLegendVisible(false); pie.setBackground(Background.EMPTY); pie.setLegendVisible(true); pie.setLegendSide(Side.RIGHT); return pie; } }
static Node createPieChart() { ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList( new PieChart.Data("Sun", 20), new PieChart.Data("IBM", 12), new PieChart.Data("HP", 25), new PieChart.Data("Dell", 22), new PieChart.Data("Apple", 30) ); return new PieChart(pieChartData); }
@Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { // @formatter:off ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(new PieChart.Data("Critical", 13), new PieChart.Data("High", 25), new PieChart.Data("Blocking", 10), new PieChart.Data("Medium", 22), new PieChart.Data("Low", 30)); // @formatter:on chart = new PieChart(pieChartData); chart.setTitle(configuration.getPropertyValue("title")); } }