Skip to content

Release 2.4.1: five answers to the intraday chart feedback - #4

Merged
CtrlAltDevelop merged 7 commits into
mainfrom
some-insights-on-using-intraday-charts
Sep 12, 2026
Merged

CtrlAltDevelop merged 7 commits into
mainfrom
some-insights-on-using-intraday-charts

Conversation

@CtrlAltDevelop

Copy link
Copy Markdown
Owner

Closes #3.

Five changes, one for each point raised in the issue. Each is its own commit.

Fit a short series to the width — ChartStyle.fitContent

pointWidth is a fixed distance, so a handful of intraday bars bunched up
against the left edge and left the rest of the chart empty. Fitting widens the
spacing to fill the plot, and widens the candle and volume bars with it so they
keep their proportions. It only ever widens, so a series long enough to fill the
plot is laid out on pointWidth as before and the flag can stay on while
history pages in.

A fitted series is exactly as wide as the plot, so getMinTranslateX holds the
scroll at zero rather than leaving the half point the last candle's centre
normally needs.

Keep a price the locked axis cannot reach inside the candle area — bug fix

A locked axis holds the range it was given, so a tick beyond it had nowhere of
its own to be drawn: the line was painted over the volume and indicator panes,
or off the canvas where it was invisible.

A horizontal line at such a price is now left out of the plot, and its label is
pinned to the edge the price went past and marked with an arrow so the level can
still be found. The current-price line, the signal lines and the trading tags
are clamped to the same edge — they were clamped to the window's extremes,
which under a lock are not the axis's.

Keep the newest candle on a locked axis — lockedScaleFollowsPrice

Opt-in, so an existing lockPriceScale: true chart behaves exactly as before.
The locked range grows just enough to cover the newest candle and never shrinks
back or refits to the window, so the axis still sits still while the chart is
scrolled. Only the newest candle counts, and only while it is in view: growing
the axis to swallow the history a scroll moves over would undo the lock a little
at a time.

Write the chart's prices — priceFormatter

fixedLength only said how many decimals a price is written to, so a currency
symbol, a thousands separator or a tick size had nowhere to go. The new callback
is the counterpart to dateFormatter and covers every price the chart itself
says: the axis labels, the crosshair's price label, the current-price tag, the
high, low and signal tags, and the OHLC legend. An axis that reads out a move
rather than a price writes that move itself and does not ask.

A second price axis — secondaryPriceAxisScale

The chart had one price axis, so reading a move as a percentage meant giving up
the prices. A second axis reads the same candles another way, in a gutter on the
side verticalTextAlignment left free and sized by
ChartStyle.secondaryPriceAxisWidth. It marks its own round values rather than
labelling the price axis's, the grid stays ruled by the price axis, and the
crosshair and price tags keep following priceAxisScale. The two gutters are
clamped against each other, so between them they can never take more than half
the chart's width.

Also in here

  • Background fill fix. Each band was filled from the canvas edge for the
    plot's width, so a gutter on the right showed whatever was under the widget
    and a gutter on the left shifted the fill. Every band now spans the canvas.
  • Example app. A toggle for each change, and the intraday demo uses
    fitContent instead of working the spacing out by hand.
  • Goldens for the fitted series (before and after), the second axis, the
    currency prices and the edge-marked level.
  • One existing perf test priced its drawings below everything on screen, which
    no longer resolves an anchor now that an unreachable line is skipped before
    the lookup. Repriced around the newest candle; its subject is unchanged.

Release

Version 2.4.1, with the changelog entry and the README's install line updated.

Testing

898 tests pass, flutter analyze and dart format clean, and the example
builds for both entry points. 22 new tests, including three that fail without
the out-of-range fix.

pointWidth is a fixed distance, so a handful of intraday bars bunched up
against the left edge and left the rest of the chart empty. Fitting widens
the spacing to fill the plot, and widens the candle and volume bars with it
so they keep their proportions.

It only ever widens, so a series long enough to fill the plot is laid out on
pointWidth as before and the flag can stay on while history pages in. A
fitted series is exactly as wide as the plot, so the scroll holds at zero
rather than leaving the half point the last candle's centre normally needs.
A locked axis holds the range it was given, so a tick beyond it had nowhere
of its own to be drawn: the line was painted over the volume and indicator
panes, or off the canvas where it was invisible.

A horizontal line at such a price is now left out of the plot, and its label
is pinned to the edge the price went past and marked with an arrow so the
level can still be found. The current-price line, the signal lines and the
trading tags are clamped to the same edge; the trading lines already skipped
themselves, and now say so through the same shared test.

The large-history perf test priced its drawings below everything on screen,
which no longer resolves an anchor at all now that an unreachable line is
skipped before the lookup. Priced around the newest candle instead.
…Price

A locked axis holds the range it was given, so a market that trades past it
walked off the top or the bottom of the chart until resetPriceScale was
called. The new flag grows the locked range just enough to cover the newest
candle, and never shrinks it back or refits it to the window, so the axis
still sits still while the chart is scrolled.

Only the newest candle counts, and only while it is in view: growing the
axis to swallow the history a scroll moves over would undo the lock a little
at a time. Whether it is in view is asked of the painter as it stands, which
is last frame's window over last frame's candles, so a tick that has just
arrived is measured against the window it arrived into rather than waiting a
frame.
fixedLength only said how many decimals a price is written to, so a currency
symbol, a thousands separator or a tick size had nowhere to go. The new
callback takes the writing over, the way dateFormatter already does on the
date axis.

It covers every price the chart itself says: the axis labels, the crosshair's
price label, the current-price tag, the high, low and signal tags, and the
OHLC legend. An axis that reads out a move rather than a price writes that
move itself and does not ask. Drawings keep their own titles.
The chart had one price axis, so reading a move as a percentage meant giving
up the prices. secondaryPriceAxisScale reads the same candles a second way in
a gutter on the side verticalTextAlignment left free.

It marks its own round values rather than labelling the price axis's, so a
percentage axis reads +2%, +4%, +6%. The grid stays ruled by the price axis:
a second set of lines over one set of candles would say nothing the second
set of labels does not, and the crosshair and the price tags keep following
priceAxisScale.

The two gutters are clamped against each other rather than separately, so
between them they can never take more than half the chart's width.
The intraday demo was working the candle spacing out by hand, which is what
ChartStyle.fitContent now does; it sets the flag instead. The tour app gets a
toggle for each of the rest: a locked axis that follows the price, a level
the axis cannot reach, fitting the candles to the width, and prices written
as currency.

Goldens for four of them, including a short series before and after fitting,
which is the complaint the issue opened with.

Drawing those turned up a background filled from the canvas edge for the
plot's width: a gutter on the right showed whatever was under the widget, and
a gutter on the left shifted the fill. Every band now spans the canvas.
Five changes, one for each point raised in issue #3 about the intraday
chart: candles fitted to the width, a price the locked axis cannot reach
held inside the candle area, a locked axis that can follow the price, a
formatter for the prices the chart writes, and a second price axis.
@CtrlAltDevelop CtrlAltDevelop self-assigned this Sep 12, 2026
@CtrlAltDevelop CtrlAltDevelop linked an issue Sep 12, 2026 that may be closed by this pull request
@CtrlAltDevelop CtrlAltDevelop added bug Something isn't working enhancement New feature or request labels Sep 12, 2026
@CtrlAltDevelop
CtrlAltDevelop merged commit 18b2a4f into main Sep 12, 2026
1 check passed
@CtrlAltDevelop
CtrlAltDevelop deleted the some-insights-on-using-intraday-charts branch September 12, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some insights on using intraday charts

1 participant