diff --git a/desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java b/desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java index b51b4fe4835..6956dcb18aa 100644 --- a/desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java +++ b/desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java @@ -31,6 +31,7 @@ import bisq.desktop.main.offer.SellOfferView; import bisq.desktop.main.offer.offerbook.OfferBookListItem; import bisq.desktop.util.CurrencyListItem; +import bisq.desktop.util.DisplayUtils; import bisq.desktop.util.GUIUtil; import bisq.core.locale.CurrencyUtil; @@ -216,7 +217,7 @@ protected void activate() { tradeCurrencySubscriber = EasyBind.subscribe(model.selectedTradeCurrencyProperty, tradeCurrency -> { String code = tradeCurrency.getCode(); - volumeColumnLabel.set(Res.get("shared.amountWithCur", code)); + volumeColumnLabel.set(Res.get("offerbook.volume", code)); xAxis.setTickLabelFormatter(new StringConverter<>() { int cryptoPrecision = 3; @@ -499,9 +500,7 @@ public TableCell call(TableColumn observable, Number oldValue, Number newValue) { if (offer != null && offer.getPrice() != null) { - setText(""); - setGraphic(new ColoredDecimalPlacesWithZerosText(model.getVolume(offer), - model.getMaxNumberOfPriceZeroDecimalsToColorize(offer))); + renderCellContentRange(); model.priceFeedService.updateCounterProperty().removeListener(listener); } } @@ -517,9 +516,7 @@ public void updateItem(final OfferListItem offerListItem, boolean empty) { model.priceFeedService.updateCounterProperty().addListener(listener); setText(Res.get("shared.na")); } else { - setText(""); - setGraphic(new ColoredDecimalPlacesWithZerosText(model.getVolume(offer), - model.getMaxNumberOfPriceZeroDecimalsToColorize(offer))); + renderCellContentRange(); } } else { model.priceFeedService.updateCounterProperty().removeListener(listener); @@ -528,12 +525,25 @@ public void updateItem(final OfferListItem offerListItem, boolean empty) { setGraphic(null); } } + + /** + * Renders cell content, if it has a single value or a range. + * Should not be called for empty cells + */ + private void renderCellContentRange() { + String volumeRange = DisplayUtils.formatVolume(offer, true, 2); + + setText(""); + setGraphic(new ColoredDecimalPlacesWithZerosText(volumeRange, + model.getMaxNumberOfPriceZeroDecimalsToColorize(offer))); + } + }; } }); // amount - TableColumn amountColumn = new AutoTooltipTableColumn<>(Res.get("shared.amountWithCur", Res.getBaseCurrencyCode())); + TableColumn amountColumn = new AutoTooltipTableColumn<>(Res.get("shared.BTCMinMax")); amountColumn.setMinWidth(115); amountColumn.setSortable(false); amountColumn.getStyleClass().add("number-column"); @@ -547,8 +557,8 @@ public TableCell call(TableColumn