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:
@@ -6,12 +6,18 @@
|
||||
#include <QClipboard>
|
||||
#include <QCategoryAxis>
|
||||
#include <QtCharts/QLegendMarker>
|
||||
#include <QGraphicsLayout>
|
||||
|
||||
#include "JFJochDatasetInfoChartView.h"
|
||||
|
||||
JFJochDatasetInfoChartView::JFJochDatasetInfoChartView(QWidget *parent)
|
||||
: QChartView(new QChart(), parent) {
|
||||
chart()->legend()->hide();
|
||||
// Reclaim Qt Charts' outer layout padding and trim the inner margins so the axis labels keep
|
||||
// their room even when the dock is short (otherwise they are the first thing Qt drops).
|
||||
chart()->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
chart()->setMargins(QMargins(2, 2, 6, 2));
|
||||
chart()->setBackgroundRoundness(0);
|
||||
setRenderHint(QPainter::Antialiasing);
|
||||
// setRubberBand(QChartView::RubberBand::RectangleRubberBand);
|
||||
setMouseTracking(true);
|
||||
|
||||
Reference in New Issue
Block a user