Построение объемной круговой диаграммы
Есть рабочий код написан собственноручно, но есть еще второе задание, сделать из этого объекта 3Д и с вытянутым куском.
Многое перепробовал но решение так и не нашел!
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.chart.PieChart;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
public class Controller {
@FXML
private ResourceBundle resources;
@FXML
private URL location;
@FXML
private TextField OZY;
@FXML
private TextField MotherBoard;
@FXML
private TextField Proc;
@FXML
private TextField Hdd;
@FXML
private Button AddB;
@FXML
private Button CreatB;
@FXML
private Button ClearB;
@FXML
private PieChart pie;
@FXML
private TextField Korpys;
@FXML
void initialize() {
final double[] ozy = {0};
final double[] motherboard = {0};
final double[] procesor = {0};
final double[] hdd = {0};
final double[] korpys = {0};
AddB.setOnAction(event -> {
try {
ozy[0] =Double.parseDouble(OZY.getText());
motherboard[0] =Double.parseDouble(MotherBoard.getText());
procesor[0] =Double.parseDouble(Proc.getText());
hdd[0] =Double.parseDouble(Hdd.getText());
korpys[0] =Double.parseDouble(Korpys.getText());
OZY.clear();
MotherBoard.clear();
Proc.clear();
Hdd.clear();
Korpys.clear();
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setTitle("Information");
alert.setHeaderText(null);
alert.setContentText("Данні успішно внесені, можете побудувати діаграму");
alert.showAndWait();
}
catch (Exception e)
{
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle("ERORR");
alert.setHeaderText(null);
alert.setContentText("Введіть число а не символи");
alert.showAndWait();
}
});
CreatB.setOnAction(event -> {
OZY.setEditable(false);
MotherBoard.setEditable(false);
Proc.setEditable(false);
Hdd.setEditable(false);
Korpys.setEditable(false);
ObservableList<PieChart.Data> pieChartData =
FXCollections.observableArrayList(
new PieChart.Data("Процесор", procesor[0]),
new PieChart.Data("Метаринська плата", motherboard[0]),
new PieChart.Data("Оперативна память", ozy[0]),
new PieChart.Data("Жорсткий диск", hdd[0]),
new PieChart.Data("Копус", korpys[0]));
pie.setData(pieChartData);
pie.setTitle("Вартісь комплектуючих у складі компьютера");
pie.setLabelsVisible(false);
});
ClearB.setOnAction(event -> {
ObservableList<PieChart.Data> pieChartData =
FXCollections.observableArrayList();
pie.setTitle("");
pie.setData(pieChartData);
OZY.setEditable(true);
MotherBoard.setEditable(true);
Proc.setEditable(true);
Korpys.setEditable(true);
Hdd.setEditable(true);
});
}
}