viewer: keep plot axis labels readable when compressed

When the plot dock was short, Qt Charts dropped the axis labels first, making
the plot hard to read.

- Reclaim Qt Charts' outer graphics-layout padding and trim the inner margins
  (both chart views) so the plot and its labels get the available space.
- Raise the chart minimum height (dataset-info 80 -> 140, per-image 120 -> 140)
  so the dock can't be squeezed below the point where the axis labels fit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 16:26:15 +02:00
co-authored by Claude Opus 4.8
parent 94b66348c5
commit c5457e2e27
3 changed files with 11 additions and 2 deletions
+4 -1
View File
@@ -8,11 +8,14 @@
#include <QApplication>
#include <QCategoryAxis>
#include <QRegularExpression>
#include <QGraphicsLayout>
JFJochSimpleChartView::JFJochSimpleChartView(QWidget *parent)
: QChartView(new QChart(), parent) {
chart()->legend()->hide();
setMinimumHeight(120); // soft floor: let the host dock/window decide the height
chart()->layout()->setContentsMargins(0, 0, 0, 0); // reclaim padding for the plot + labels
chart()->setMargins(QMargins(2, 2, 6, 2));
setMinimumHeight(140); // soft floor: enough for the axis labels to stay readable
setRenderHint(QPainter::Antialiasing);
setMouseTracking(true);
//setRubberBand(QChartView::RubberBand::HorizontalRubberBand);