List of usage examples for javafx.scene.chart PieChart PieChart
public PieChart()
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());/*from www. j ava 2 s.co m*/ pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); System.out.println(pieChart.labelLineLengthProperty()); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());//w w w . jav a 2s.c o m pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); System.out.println(pieChart.getStartAngle()); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());//from w ww .j a v a 2s . c o m pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); pieChart.setLabelLineLength(8); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());//from w w w. j ava 2 s. com pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); System.out.println(pieChart.labelsVisibleProperty()); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());/*from ww w . ja v a2s . c om*/ pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); pieChart.setLabelsVisible(true); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());/* w ww .j av a 2 s.c o m*/ pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); pieChart.requestLayout(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { PieChart pieChart = new PieChart(); pieChart.setData(getChartData());//from w w w .j a va 2 s . com pieChart.setTitle("Title"); pieChart.setLegendSide(Side.LEFT); pieChart.setClockwise(false); pieChart.setLabelsVisible(false); StackPane root = new StackPane(); root.getChildren().add(pieChart); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); System.out.println(pieChart.isClockwise()); }
From source file:com.jscriptive.moneyfx.ui.chart.ChartFrame.java
/** * This method is invoked when the "by category" button has been toggled * * @param actionEvent/*from www .jav a 2 s.c o m*/ */ public void byCategoryToggled(ActionEvent actionEvent) { final PieChart pieChart = new PieChart(); pieChart.setTitle("Transaction balance by categories"); pieChart.setLegendSide(LEFT); chartFrame.setCenter(pieChart); ToggleButton toggle = (ToggleButton) actionEvent.getTarget(); if (toggle.isSelected()) { Service<Void> service = new Service<Void>() { @Override protected Task<Void> createTask() { return new Task<Void>() { @Override protected Void call() throws Exception { ValueRange<LocalDate> period = getTransactionOpRange(accountCombo.getValue(), yearCombo.getValue()); if (period.isEmpty()) { return null; } Platform.runLater(() -> pieChart.setTitle(format("%s for transactions from %s until %s", pieChart.getTitle(), period.from().format(DATE_FORMATTER), period.to().format(DATE_FORMATTER)))); categoryRepository.findAll().stream() .sorted((c1, c2) -> c1.getName().compareTo(c2.getName())).forEach(category -> { List<Transaction> found = (accountCombo.getValue() == ALL_ACCOUNTS) ? transactionRepository.findByCategory(category) : transactionRepository.findByAccountAndCategory( accountCombo.getValue(), category); if (INTEGER_ZERO.compareTo(yearCombo.getValue()) < 0) { found = found.stream().filter( trx -> yearCombo.getValue().equals(trx.getDtOp().getYear())) .sorted((t1, t2) -> t1.getDtOp().compareTo(t2.getDtOp())) .collect(toList()); } List<Transaction> transactions = new ArrayList<>(found.size()); transactions.addAll(found); Platform.runLater(() -> { double value = getSum(transactions); String name = format("%s [%s]", category.getName(), CurrencyFormat.getInstance().format(value)); PieChart.Data data = new PieChart.Data(name, value); pieChart.getData().add(data); data.getNode().addEventHandler(MOUSE_CLICKED, event -> handleCategoryChartMouseClickEvent( (accountCombo.getValue() == ALL_ACCOUNTS) ? null : accountCombo.getValue(), category, yearCombo.getValue(), event)); }); }); return null; } }; } }; service.start(); } }