|
| 1 | +## 2.4.1 |
| 2 | + |
| 3 | +Five changes, one for each point raised in |
| 4 | +[#3](https://github.com/CtrlAltDevelop/ohlcv_chart/issues/3) about the intraday |
| 5 | +chart. |
| 6 | + |
| 7 | +### Fixed |
| 8 | + |
| 9 | +- **An axis gutter is painted in the chart's own background.** It was filled |
| 10 | + from the canvas edge for the plot's width, which left a gutter on the right |
| 11 | + showing whatever was under the widget, and shifted the fill when a gutter was |
| 12 | + held back on the left. Every band now spans the whole canvas, so a label |
| 13 | + drawn in a gutter has the chart behind it. |
| 14 | + |
| 15 | +- **A price the axis does not reach no longer escapes the candle area.** A |
| 16 | + locked axis makes that ordinary — the range is held where it was, so a tick |
| 17 | + beyond it had nowhere of its own to go and was drawn over the volume and |
| 18 | + indicator panes, or off the canvas where it could not be seen at all. A |
| 19 | + horizontal line at such a price is now left out of the plot and its label is |
| 20 | + pinned to the edge the price went past, marked with an arrow so the level can |
| 21 | + still be found. The current-price line, the signal lines and the trading tags |
| 22 | + are held to the same edge, and the trading lines already were. |
| 23 | + |
| 24 | +### Price axis |
| 25 | + |
| 26 | +- **New `secondaryPriceAxisScale` draws a second axis down the other side.** |
| 27 | + The chart had one price axis, so reading a move as a percentage meant giving |
| 28 | + up the prices. A second axis reads the same candles another way — |
| 29 | + `PriceAxisScale.percentage` for the change since the oldest candle in view — |
| 30 | + in a gutter on the side `verticalTextAlignment` left free, sized by |
| 31 | + `ChartStyle.secondaryPriceAxisWidth`. It marks its own round values rather |
| 32 | + than labelling the price axis's, the grid stays ruled by the price axis, and |
| 33 | + the crosshair and the price tags keep following `priceAxisScale`. The two |
| 34 | + gutters share half the chart's width between them, so a second axis cannot |
| 35 | + crowd the candles out. |
| 36 | + |
| 37 | +- **New `priceFormatter` writes the prices the chart shows.** `fixedLength` |
| 38 | + only said how many decimals to use, so a currency symbol, a thousands |
| 39 | + separator or a tick size had nowhere to go. It takes the writing over the way |
| 40 | + `dateFormatter` does on the date axis, and covers every price the chart says: |
| 41 | + the axis labels, the crosshair's price label, the current-price tag, the |
| 42 | + high, low and signal tags, and the OHLC legend. An axis that reads out a move |
| 43 | + rather than a price — `percentage`, `indexedTo100` — writes that move itself |
| 44 | + and does not ask. |
| 45 | + |
| 46 | +- **New `lockedScaleFollowsPrice` keeps the newest candle on a locked axis.** |
| 47 | + A locked axis holds the range it was given, so a market that trades past that |
| 48 | + range walked off the top or the bottom of the chart until `resetPriceScale` |
| 49 | + was called. With this set the locked range grows just enough to cover the |
| 50 | + newest candle, and never shrinks back or refits to the window — so the axis |
| 51 | + still sits still while scrolling, which is what the lock is for. Only the |
| 52 | + newest candle counts, and only while it is in view: growing the axis to |
| 53 | + swallow the history a scroll moves over would undo the lock a little at a |
| 54 | + time. Off by default, and does nothing without `lockPriceScale`. |
| 55 | + |
| 56 | +### Layout |
| 57 | + |
| 58 | +- **New `ChartStyle.fitContent` spreads a short series across the whole plot.** |
| 59 | + `pointWidth` is a fixed distance, so a handful of intraday bars bunched up |
| 60 | + against the left edge and left the rest of the chart empty. With this set the |
| 61 | + spacing is widened to whatever fills the plot, and the candle and volume bars |
| 62 | + widen with it so they keep their proportions. It only ever widens: a series |
| 63 | + long enough to fill the plot, or one zoomed in past it, is laid out on |
| 64 | + `pointWidth` as before, so the flag can stay on while history pages in. |
| 65 | + |
1 | 66 | ## 2.4.0 |
2 | 67 |
|
3 | 68 | ### A chart that sits still |
|
0 commit comments