Skip to content
Snippets Groups Projects
Commit 38da673c authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Refresh pie chart in budget window

parent ac4fe916
No related branches found
No related tags found
3 merge requests!43Merging frontend-testing into master,!38"Made progressbar dynamic in accordance to spending. Added balance field....,!37Made the sub progress bars respond to changes in expense
......@@ -93,6 +93,9 @@ public class BudgetController implements FinanceController {
descriptionCol.setCellValueFactory(new PropertyValueFactory<BudgetItem, String>("budgetDescription"));
try { //Initialize registers, tableview and pie charts
//if (FileHandlingBudget.hasBudgetSet - from line 4/5, so after the general amount and such) {
//add, edit and delete buttons are removed.
general = loadBudgetDataFromFile("Budget");
budgetList = FXCollections.observableArrayList(general.getBudgetItems());
budgetTableView.setItems(budgetList);
......@@ -197,6 +200,7 @@ public class BudgetController implements FinanceController {
}
//Updates the tableview using the register
refreshTableView();
refreshPieChart();
}
......@@ -217,6 +221,7 @@ public class BudgetController implements FinanceController {
if (isConfirmed.isPresent() && isConfirmed.get() == ButtonType.OK) {
general.deleteItemFromBudget(item.getBudgetCategory());
refreshTableView();
refreshPieChart();
}
}
......
......@@ -60,7 +60,7 @@
</Pane>
</left>
<center>
<Label fx:id="title" text="Budget" textAlignment="CENTER" BorderPane.alignment="CENTER">
<Label fx:id="title" text="BUDGET" textAlignment="CENTER" BorderPane.alignment="CENTER">
<font>
<Font name="Lucida Console" size="48.0" />
</font>
......@@ -150,7 +150,7 @@
<children>
<Pane>
<children>
<Label alignment="CENTER" layoutX="99.0" layoutY="-12.0" text="Amount at disposal: 1000">
<Label alignment="CENTER" layoutX="135.0" text="Max amount: 1000">
<font>
<Font name="Lucida Console" size="24.0" />
</font>
......@@ -184,7 +184,7 @@
</VBox>
<Pane GridPane.columnIndex="1">
<children>
<PieChart fx:id="budgetPieChart" layoutX="95.0" layoutY="99.0" legendSide="RIGHT" maxHeight="444.0" maxWidth="512.0" prefHeight="302.0" prefWidth="354.0" />
<PieChart fx:id="budgetPieChart" layoutX="105.0" layoutY="33.0" legendSide="RIGHT" maxHeight="444.0" maxWidth="512.0" prefHeight="302.0" prefWidth="354.0" />
</children>
</Pane>
</children>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment