Skip to content
Snippets Groups Projects
Commit c2ca6d18 authored by HSoreide's avatar HSoreide
Browse files

Make pie-chart labels bold and larger font-size

parent 84238070
No related branches found
No related tags found
2 merge requests!60Hs fix piecharts,!59Hs fix piecharts
......@@ -165,8 +165,7 @@ public class BudgetController extends FinanceController {
//Only adds the budget data for chosen categories to the pie chart
for (ExpenseCategory category : chosenCategories) {
budgetData.add(new Data(category.toString().substring(0, 1).toUpperCase()
.concat(category.toString().substring(1)),
budgetData.add(new Data( category.label,
general.getBudgetItem(category).getBudgetAmount()));
}
return budgetData;
......@@ -177,7 +176,7 @@ public class BudgetController extends FinanceController {
*/
@Override
public void refreshPieChart() {
this.budgetPieChart.setLabelsVisible(true);
this.budgetPieChart.setData(createPieChart());
}
......
......@@ -142,4 +142,31 @@
-fx-border-radius: 30;
-fx-border-color: white;
-fx-text-fill: white;
}
\ No newline at end of file
}
.chart-pie-label {
-fx-font-size: 20;
//-fx-background-color: white;
//-fx-border-radius: 50;
//-fx-border-width: 10;
-fx-background-color: white;
-fx-font-weight: bold;
}
.chart-pie-label-line {
-fx-stroke: rgba(0, 0, 0, 0.90);
-fx-fill: rgba(0, 0, 0, 0.90);
-fx-font-weight: 20;
}
.chart-pie-label {
-fx-fill: black;
-fx-font-size: 20;
}
/*.pie-back {
-fx-background-color: white;
-fx-border-radius: 50;
-fx-border-width: 10;
}*/
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.Cursor?>
<?import javafx.scene.chart.PieChart?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.ContextMenu?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Pane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<?import javafx.geometry.*?>
<?import javafx.scene.*?>
<?import javafx.scene.chart.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="695.0" prefWidth="1130.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.BudgetController">
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="695.0" prefWidth="1130.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.BudgetController">
<children>
<ImageView fitHeight="695.0" fitWidth="1130.0" pickOnBounds="true">
<image>
......@@ -192,7 +177,7 @@
</VBox>
<Pane GridPane.columnIndex="1">
<children>
<PieChart fx:id="budgetPieChart" labelsVisible="false" layoutX="105.0" layoutY="33.0" legendSide="RIGHT" maxHeight="444.0" maxWidth="512.0" prefHeight="302.0" prefWidth="354.0" />
<PieChart fx:id="budgetPieChart" labelsVisible="false" layoutX="16.0" layoutY="33.0" legendSide="RIGHT" maxHeight="444.0" maxWidth="512.0" prefHeight="405.0" prefWidth="479.0" stylesheets="@../style.css" />
</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