Skip to content

Commit

Permalink
Add reuse comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Raghava-Chittidi committed Nov 24, 2024
1 parent 5643e7c commit b18b6e4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/seedu/hireme/ui/ChartWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public void update(Map<Status, Integer> insights) {
pieChart.layout();

final double totalApplications = total;
/* Solution below adapted from
https://stackoverflow.com/questions/35479375/display-additional-values-in-pie-chart
*/
data.forEach(dataSegment -> {
String stringToBeBound = StringUtil.getPercentageString(dataSegment.getPieValue(),
totalApplications);
Expand All @@ -110,6 +113,9 @@ public void update(Map<Status, Integer> insights) {
* @param stringToBeBound The string that needs to be bound to the data segment.
*/
public void bindPieChartDataSegment(PieChart.Data dataSegment, String stringToBeBound) {
/* Solution below adapted from
https://stackoverflow.com/questions/35479375/display-additional-values-in-pie-chart
*/
StringExpression exp = Bindings.concat(dataSegment.getName(), " ", stringToBeBound);
dataSegment.nameProperty().bind(exp);
}
Expand Down

0 comments on commit b18b6e4

Please sign in to comment.