Task: Add X/Y axis labels to GMM preview charts

Table of Contents

This page documents a task in the GMM improvements: tidy up synthetic data generation loose ends story. It captures the goal, current status, acceptance, and any notes or results.

Goal

The Live Return Distribution Preview and Live Sample Price Paths Preview charts on the FX Rate → Price behaviour tab render without numeric axis labels/ticks, making them hard to read (see reference screenshot attached to the story). Add labelled X and Y axes to both charts.

Status

Field Value
State DONE
Parent story GMM improvements: tidy up synthetic data generation loose ends
Now Done.
Waiting on Nothing.
Next Move to the next task.
Last touched 2026-07-02

Acceptance

  • Live Return Distribution Preview shows a labelled X axis ("Return per Update %") and Y axis ("Probability") with numeric ticks.
  • Live Sample Price Paths Preview shows a labelled X axis ("Update Steps") and Y axis ("Price") with numeric ticks.

Plan

Both charts (ReturnDistributionChart, SamplePricePathsChart in projects/ores.qt/synthetic/) already configured QValueAxis titles, ranges and grid/label colours in their constructors — the axes were never actually missing. The bug: both called palette().color(QPalette::WindowText) to pick text/grid colours, but the app's dark theme is applied purely via a QSS stylesheet (main.cpp, :/TradingStyle.qss), never via QApplication::setPalette, so QWidget::palette() on a freshly-constructed, unparented widget returns Qt's default light-mode colours — near-black text on QChart::ChartThemeDark's near-black background, effectively invisible. Fixed by switching both charts to the same explicit theme-colour constants FxSpotChartWindow already uses (QColor(0xCB, 0xD5, 0xE1) text, QColor(255, 255, 255, 18) grid) instead of reading palette().

Notes

Root cause confirmed by comparing against the working FxSpotChartWindow (projects/ores.qt/mktdata/), which hardcodes its axis colours rather than reading palette().

PRs

PR Title
#1409 [synthetic] GMM improvements: chart axes, per-component PDFs, Ornstein-Uhlenbeck

Review

Comment summary File Decision Notes
       

Result

Fixed both ReturnDistributionChart and SamplePricePathsChart to use explicit theme colours instead of QWidget::palette(), which was returning invisible near-black text/gridlines against the dark chart background. Axis titles, ranges and ticks were already correctly configured; only the colour was wrong. Built ores.qt.synthetic.lib clean (clang debug/make).

Emacs 29.3 (Org mode 9.6.15)