Skip to content

Commit

Permalink
Improve readability of the daily burnt BSQ chart
Browse files Browse the repository at this point in the history
Relevant issue thread: #3753

Currently the daily burnt BSQ chart under 'DAO -> Facts and Figures' is
distorted by outliers. This introduces a 'Zoom to inliers' toggle (off
by default), which, when toggled on, effectively zooms the chart to
inliers, thus removing the distortion. Also, a moving average is
plotted, to further improve the chart's readibility.

The chart is also changed from an area chart to a line chart, on the
presumption that it was an area chart for cosmetic reasons, but now that
there are two series in it (the moving average was added) an area chart
makes less sense.

Another noteworthy change is that the other chart in the screen, monthly
issued BSQ, has its Y axis set to start at zero, so as to improve
readability. This might seem outside the scope of this commit, but the
other changes involved some refactoring, which involved cleaning up some
duplicated logic, which involved configuring both of these charts
together, which involved forcing zero to be on the axis.

This implementation mixes some plotting logic (responsible for zooming
in on inliers) into the view logic, because I opted to implement said
zooming as an external manipulation of a chart's axis. I chose this in
favor of implementing a new Chart, because it would have required
including multiple large classes (relevant JavaFX's classes can't be
ergonomically extended) to the code base. I presumed that my chosen
solution will be easier to maintain.

I am not entirely happy with this choice and can see myself introducing
some plotting-related classes to encapsulate creating charts like these,
thus unmixing plotting logic from view logic. In the meantime this is a
working solution, and I plan to continue working on these charts in the
near future.
  • Loading branch information
dmos62 committed Jan 11, 2020
1 parent 39fdfbb commit 884c8cb
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 39 deletions.
2 changes: 2 additions & 0 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2251,6 +2251,8 @@ dao.factsAndFigures.supply.compRequestIssueAmount=BSQ issued for compensation re
dao.factsAndFigures.supply.reimbursementAmount=BSQ issued for reimbursement requests

dao.factsAndFigures.supply.burnt=BSQ burnt
dao.factsAndFigures.supply.burntMovingAverage=15 days moving average
dao.factsAndFigures.supply.burntZoomToInliers=Zoom to inliers

dao.factsAndFigures.supply.locked=Global state of locked BSQ
dao.factsAndFigures.supply.totalLockedUpAmount=Locked up in bonds
Expand Down
7 changes: 7 additions & 0 deletions desktop/src/main/java/bisq/desktop/bisq.css
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,13 @@ textfield */
-fx-stroke: -bs-buy;
}

/* The .chart-line-symbol rules change the color of the legend symbol */
#charts-dao .default-color0.chart-series-line { -fx-stroke: -bs-buy; }
#charts-dao .default-color0.chart-line-symbol { -fx-background-color: -bs-buy, -bs-background-color; }

#charts-dao .default-color1.chart-series-line { -fx-stroke: -bs-color-green-4 }
#charts-dao .default-color1.chart-line-symbol { -fx-background-color: -bs-color-green-4, -bs-background-color; }

#charts .default-color0.chart-series-area-fill {
-fx-fill: -bs-sell-transparent;
}
Expand Down
Loading

0 comments on commit 884c8cb

Please sign in to comment.