ohlcv_chart 2.6.0
ohlcv_chart: ^2.6.0 copied to clipboard
Candlestick charts for Flutter with 31 indicators, 29 drawing tools and 39 more chart widgets: depth, order flow, series, pie, treemap, sankey. Pure CustomPainter, no WebView.
2.6.0 - 2026-09-16 #
Added #
TreemapChart— tiles sized by value using the squarified layout, with nested groups and headers, colour byHeatmapScaleor palette, fitted labels, touch, tooltips and grow-in animation.layOutTreemapandtreemapTileAtare public. See Treemap.GaugeChart— a dial for a single value, with any start and sweep angle, coloured ranges, a value bar, a needle, major and minor ticks, centre text or a custom centre widget, and animated transitions between values.GaugeLayoutis public. See Gauge.FunnelChart— tapered or stepped stages sized by value, with a minimum width, conversion from the first and previous stage, labels inside or beside each stage, shape-accurate touch, tooltips and animation.layOutFunnelandfunnelSegmentAtare public. See Funnel.SankeyChart— flows between nodes drawn as ribbons sized by value, with columns derived from the links, cycle-safe layout, blended or fixed ribbon colours, node and ribbon touch, hover highlighting with the rest faded back, tooltips and grow-in animation.layOutSankey,sankeyNodeAtandsankeyLinkAtare public. See Sankey.SunburstChart— a hierarchy as rings round a centre, taking the sameTreemapItemtree as the treemap, with any start and sweep angle, a depth limit, curved upright labels, a centre widget, touch that picks the deepest ring, tooltips and sweep-in animation.layOutSunburstandsunburstArcAtare public. See Sunburst.BoxPlotChart— quartiles, median, whiskers, mean and outliers for several sets of numbers side by side, withBoxPlotStats.fromSamplesdoing the statistics (interpolated quartiles, Tukey whiskers), a value axis, grid, column-wide touch, tooltips and grow-in animation.BoxPlotStats,boxPlotRange,layOutBoxPlotandboxPlotBoxAtare public. See Box plot.HistogramChart— the shape of a distribution, withhistogramBinscounting raw samples by bin count, bin width or the square-root rule, a separate colour for bins below zero, reference lines, both axes, a grid, column-wide touch, tooltips and grow-up animation.HistogramBin,layOutHistogramandhistogramBarAtare public. See Histogram.BubbleChart— two axes and a third number carried by bubble area, with automatic or fixed ranges, axis titles, a grid, reference lines on both axes, labels inside the bubbles that fit, smallest-first hit testing, tooltips and grow-in animation.bubbleRange,layOutBubblesandbubbleAtare public. See Bubble.CalendarChart— daily values laid out as real month panels, coloured by anyHeatmapScale, with a range made symmetric about zero by default, a configurable first weekday, monthly totals in the headers, optional day numbers and weekday initials, touch, tooltips and fade-in animation.layOutCalendar,calendarCellAt,calendarValueRangeandcalendarWeekdayRowHeightare public. See Calendar.EquityCurveChart— an account's value over time with an underwater drawdown panel beneath it, the deepest fall marked and labelled, a crosshair that follows a drag, value, percentage and time axes, tooltips and draw-in animation.equityDrawdowns,equityStats(peak, trough, total return, max drawdown and its dates) andlayOutEquityCurveare public. See Equity curve.OptionPayoffChart— an options strategy's profit at expiry, with long and short call, put and underlying legs, quantity and contract size, profit and loss shaded apart, strike lines, a spot marker, a crosshair that follows a drag, tooltips and draw-in animation.OptionLeg,optionPayoff,optionBreakEvens,optionPriceRangeandlayOutOptionPayoffare public. See Options payoff.VolatilityCurveChart— implied volatility against strike or maturity, with several curves at once, solid or dashed lines, smoothing that cannot overshoot, an at-the-money marker, a legend, percentage axis, a crosshair that reads every curve at once, tooltips and draw-in animation.volatilityRangeandlayOutVolatilityare public. See Volatility curve.MarketProfileChart— time at price drawn as TPO letters or blocks, withbuildMarketProfilereading your candles into levels by tick size or row count and working out the point of control and the 70% value area, a price axis, row touch, tooltips and grow-out animation.MarketProfile,layOutMarketProfileandmarketProfileBarAtare public. See Market profile.FootprintChart— bid against ask volume at every price inside every bar, each cell shaded by size and outlined where the flow was one-sided, with each bar's point of control, a thin candle behind each column, numbers that drop out when there is no room, a price axis, cell touch and tooltips.FootprintLevel,FootprintBar,footprintCumulativeDelta,footprintPriceRange,layOutFootprintandfootprintCellAtare public. See Footprint.BookHeatmapChart— resting order-book liquidity over time, one column per snapshot and one row per price, with gamma-shaped brightness so a book with one huge wall stays readable, a mid-price track, a price axis, a crosshair that follows a drag, and a readout of the level under the pointer.BookLevel,BookSnapshot,bookPriceRange,layOutBookHeatmapandbookHeatmapCellAtare public. See Order-book heatmap.CumulativeDeltaChart— buying less selling as a running total, with each bar's own delta in a panel beneath, divergences against price marked both ways, a crosshair that follows a drag, tooltips and draw-in animation.DeltaBar,cumulativeDelta,deltaBarsFromFootprint,deltaDivergencesandlayOutCumulativeDeltaare public. See Cumulative delta.WaterfallChart— a bridge from one total to another, each step picking up where the last left off, with totals and subtotals on the baseline, connectors, values over the bars, touch, tooltips and grow-in animation.WaterfallStep,waterfallTotals,waterfallRange,layOutWaterfallandwaterfallBarAtare public. See Waterfall.TradeTimelineChart— when an account was in the market: each trade a bar from entry to exit in a lane per symbol, overlapping trades packed into rows, coloured and shaded by result, long or short arrows, open trades running to now, an open-trade count strip, a crosshair, tooltips and animation.TimelineTrade,tradeTimelineRange,packTradeRows,tradeTimelineExposureandlayOutTradeTimelineare public. See Trade timeline.RMultipleChart— trade results in R as a histogram split at zero, with win rate, average win and loss, expectancy, profit factor and SQN over it, and lines at zero and the expectancy.RMultipleStats,rMultiplesFrom,rMultipleBinsanddefaultRMultipleStatsare public. See R-multiple distribution.MonteCarloChart— simulated equity paths as percentile bands round the median, with faint sample paths, the real curve laid over, dashed start and ruin levels, a summary of final equity, loss and ruin odds and drawdown, a crosshair, tooltips and draw-in animation.runMonteCarlobootstraps trades with compound or fixed sizing and a seed;MonteCarloResult,MonteCarloResult.fromPathsandlayOutMonteCarloare public. See Monte Carlo fan.SeasonalityChart— results across the calendar, month by year, weekday by hour or weekday by month, gathered by compounding, sum, mean, median, win rate or count, with a total per row and an average per column, coloured from loss through zero to profit on a heatmap.SeasonalSample,seasonalReturnsFromPrices,seasonalityTableandseasonalAggregateare public. See Seasonality.OpenInterestChart— open interest over price in one panel and funding in another, interest scaled to its own swings rather than down to zero, funding bars hanging either way off a zero line, a crosshair down both panels, tooltips and a draw-in animation.openInterestMovesreads price and interest together into new longs, longs closing, new shorts or shorts covering;OpenInterestPoint,OpenInterestMove,moveLabel,OpenInterestLayoutandlayOutOpenInterestare public. See Open interest and funding.LiquidityMapChart— where the leveraged stops sit: liquidation size bucketed up the price axis, longs growing in from the left and shorts from the right, the largest bucket labelled, a line at the current price, andlayout.exposureTo(price)for everything a move that far would set off.LiquidityLevel,LiquiditySide,LiquidityBin,liquidityBins,LiquidityMapLayout,LiquidityBinLayoutandlayOutLiquidityMapare public. See Liquidity map.- A Gallery tab in the example app — every chart that is not the
candlestick, depth or series screen, 34 of them, with a page each: a
searchable list grouped by what the charts are for, and a page per chart
holding everything that chart has worth showing. The charts and their sample
data live in
example/lib/src/gallery/, and the screenshot tool builds the documentation's images from that same list, so the pictures are of the charts the example runs. SparklineGrid— small multiples: a name, a little line and a number per tile, laid out in columns, every tile scaled to its own series unless told to share one, with breaks where values are missing, a dot at each line's end, an optional baseline at its first value, per-sample touch, tooltips and a draw-in animation.SparklineTile,SparklineGridLayout,SparklineTileLayoutandlayOutSparklineGridare public. See Sparkline grid.ParallelChart— many things compared on many measures at once: an axis per measure with its own scale, invertible so the best is always highest, broken lines where a value is missing, the held line drawn over the rest, each axis' ends written, tooltips and a draw-in animation.ParallelAxis,ParallelLine,ParallelScale,parallelScales,ParallelLayout,ParallelLineLayoutandlayOutParallelare public. See Parallel coordinates.ChordChart— flow between nodes both ways round a ring, cycles drawn rather than broken: arcs as long as everything passing through their node, pads taken out of the turn before the arcs share it, ribbons bending through the centre and coloured by their larger end, labels outside the ring, fading, tooltips and a sweep-open animation.ChordNode,ChordFlow,ChordTotals,ChordArc,ChordRibbon,ChordLayoutandlayOutChordare public. See Chord.MarimekkoChart— two dimensions at once: columns as wide as they are big, each split by its own shares, cells with the same label sharing a colour across columns, gaps taken out before the shares are worked out, clipped headers with each column's share of the width, names inside the cells that fit them, tooltips and a draw-in animation.MarimekkoColumn,MarimekkoCell,MarimekkoLayout,MarimekkoColumnLayout,MarimekkoCellLayoutandlayOutMarimekkoare public. See Marimekko.StreamChart— a stack that flows: bands stacked on a wiggle, silhouette or zero baseline, ordered inside-out so the busiest bands sit where the stack moves least, with eased edges, names written in each band's thickest period, a period crosshair, fading, tooltips and a draw-in animation.stackStreamworks out the baseline the Byron and Wattenberg way;StreamSeries,StreamBaseline,StreamOrder,StreamStack,StreamLayout,StreamSeriesLayoutandlayOutStreamare public. See Stream graph.ViolinChart— the shape of a distribution rather than only its quartiles, as violins side by side or as an overlapping ridgeline, every shape measured against the tallest peak so their areas compare, with the box-plot quartiles inside them, a value axis inaxisWidthbeside the violins and their names inlabelHeightunder them, tooltips and a draw-in animation.kernelDensityestimates the shape with a Gaussian kernel and Silverman's bandwidth;DensityCurve,ViolinSeries,ViolinShape,ViolinLayout,ViolinSeriesLayoutandlayOutViolinare public. See Violin and ridgeline.SlopeChart— how things moved between periods, as a slope chart on a value scale or a bump chart on a rank one, with eased crossings, labels and values at both ends of every line, broken lines where a series has no value, column-first hit testing, fading, tooltips and a draw-in animation.SlopeSeries,SlopeScale,SlopeLayout,SlopeSeriesLayout,rankValuesandlayOutSlopeare public. See Slope and bump.DumbbellChart— two values a row joined by a bar, every row on one shared scale, end dots coloured by direction, a value axis and gridlines under them, optional numbers outside the dots, touch reporting, tooltips and a draw-in animation.DumbbellRow,DumbbellLayout,DumbbellRowLayoutandlayOutDumbbellare public. See Dumbbell.WaffleChart— parts of a whole as a grid of squares, a cell per per cent, shared out by largest remainder so no slice is more than one cell from its true share, filled from any corner, with an optional total that leaves the rest of the grid empty, dimming, tooltips and a fill-in animation.WaffleSlice,WaffleFill,WaffleLayout,waffleCountsandlayOutWaffleare public. See Waffle.BulletChart— a measure against its target on a banded qualitative track, a row per KPI, each row on its own scale, with a target tick, the value written at the end, rows that shrink to fit a short box, touch reporting, tooltips and a draw-in animation.BulletRow,BulletBand,BulletLayout,BulletRowLayoutandlayOutBulletare public. See Bullet.PairSpreadChart— the relationship between two symbols for pair trading: their difference at a hedge ratio, their ratio or the log of it, with a rolling mean and standard-deviation bands over it and a z-score panel below, entry and exit signals marked on both, a shared crosshair, tooltips and animation.PairPoint,alignPairSeries,pairHedgeRatio,pairSpread,pairZScores,pairSignalsandlayOutPairSpreadare public. See Pair spread.
Fixed #
- Backspace no longer deletes a selected drawing while typing. The chart's keyboard shortcuts (Delete, Backspace, ⌘A, ⌘C, ⌘V, ⌘D, undo, redo and restacking) are now ignored while a text field has focus, including the line editor's own label field and any text field elsewhere in the app.
- Indicators update when only the volume, high or low of the newest candle changes. The indicator cache previously compared only the close, so a trade at an unchanged price left volume-based indicators (VolumeMA, OBV, MFI, VWAP, volume profile) and range-based ones (ATR, Donchian) stale.
ChartOverviewredraws when the newest candle is updated in place.- Scroll animations no longer leak. Each fling and animated scroll created
an
AnimationControllerthat was never disposed.
Performance #
- The current-price countdown no longer redraws the chart. The now-price line, high/low markers and signals are drawn on a separate layer, so the countdown's once-a-second update repaints only that layer instead of rebuilding the widget and redrawing every candle.
- Dragging the crosshair by touch no longer redraws the chart. A long-press drag now repaints only the crosshair layer, as mouse hover already did.
ChartOverviewwithoutcolorsno longer repaints on every rebuild.
Documentation #
- Rewritten README, documentation pages and changelog. The prose is shorter and more direct, with features grouped by area, reference tables and consistent headings. No API names, examples or behaviour descriptions were removed.
- The pub.dev package description and screenshot captions are reworded.
2.5.0 #
This release adds general-purpose chart widgets — SeriesChart, PieChart,
RadarChart and HeatmapChart — so apps no longer need a second charting
package for non-financial data. It also simplifies the KChartWidget
constructor, removes the flutter_svg dependency and lowers the minimum SDK
versions.
Breaking changes #
watermarkAssetPathis replaced bywatermark. The new parameter accepts any widget (Image.asset,Icon,Text, orSvgPicturefromflutter_svg).watermarkScale,watermarkAlignmentandChartColors.watermarkColorbehave as before. The watermark is now painted over the candle area and ignores pointer events. To migrate, removewatermarkAssetPathor pass the image aswatermark.timeFrameis nowDuration?. Code that reads it back from the widget as non-null needs a fallback.
Added — SeriesChart #
SeriesChartplots numeric x/y data.LineSeries,BarSeriesandScatterSeriestakeSeriesPoint(x, y)values, or plain values through.values(placed atx = 0, 1, 2, …).nullproduces a gap. Multiple series can be combined in one chart and are drawn in list order.- Line styles:
LineCurve.linear,smooth,stepandmonotone(which never overshoots adjacent points). Lines support dashes, gradients, per-point dots viadotBuilder,shadow,stepPosition, and anegativeColorbelowbaseline, split at the exact crossing point. - Area fills:
SeriesFillfades from the line's peak to the baseline, withnegativeGradientfor values below it.toBaseline: falsefills to the bottom of the plot.SeriesBetweenFillshades the region between two lines. - Bars: rounded ends via
radius; fixed or relative width bounded byminWidthandmaxWidth; colour vianegativeColororcolorBuilder; optionaltrackColor,borderandlabelBuilder. Bars sharing astackare stacked, and aSeriesPointwithlowrenders a floating bar for ranges and waterfalls. - Scatter: per-point size, colour, shape (circle, square, diamond, cross)
and labels.
SeriesTouchSnap.nearestPointreads out a single point. - Error bars:
SeriesPoint.xErrorandyError, styled bySeriesErrorBars. - Axes:
SeriesXAxisaccepts a label list,ticks,intervalorlabelBuilder, and skips overlapping labels.SeriesYAxissupportsformatter, side and fixedwidthfor aligning stacked charts. Both axes supporttitleandhidden;SeriesXAxis.sideplaces labels above the plot. - Grid and annotations:
SeriesGrid(solid or dashed), plotborder,SeriesReferenceLineandSeriesBand. - Value range: the y range fits the visible
minX–maxXwindow, with padding that ends on round ticks and never crosses zero for all-positive data.minY,maxYandincludeZerooverride it. - Orientation:
SeriesOrientation.horizontalrotates the chart, including fills, gradients, crosshair and tooltip. - Touch and tooltips: the crosshair activates on
press,longPress,tapor hover. The default tooltip lists every series;SeriesTooltip.builderprovides a custom widget, positioned automatically within the chart bounds.onTouchreports the x value and each series' value, ornullon release. SeriesChartControllersynchronises the crosshair across charts.SeriesRangeSelectorshows a miniature of the full data set with a draggable, resizable window.- Animation: with
animationDurationset, values interpolate between updates, and new data grows from the baseline, including on first build.
Added — pie, radar and heatmap charts #
PieChartrenders pie, doughnut and ring-gauge charts. EachPieSectionis sized by its share of the total and supports a colour or gradient, configurable label position, individualradius,offset(exploded slices), border andbadgewidget.centerSpaceRadiusandcenterChildcreate a doughnut with centre content;sectionsSpace,startDegreeOffsetandclockwisecontrol layout. Touched sections grow bytouchedSectionGrowth.RadarChartcompares multipleRadarSeriesacross namedfeatures. Series support fill, dashed outlines and dots. The grid can be polygonal or circular, withtickCountrings betweenminValueandmaxValue, spokes and optional tick labels (showTicks).onTouchreports the nearest feature.HeatmapChartcolours a grid by value, from a matrix or sparseHeatmapCells. Colour scales:HeatmapGradientScale(continuous) andHeatmapStepScale(banded). IncludesHeatmapAxisrow and column labels, in-cell labels vialabelBuilderwith automatic contrast,hoverBorder,tooltipBuilder,squareCellsfor contribution graphs andHeatmapLegend. Touching an empty cell reports the cell with no value.- Layout helpers:
layOutPie,pieSectionAt,radarCorner,RadarLayoutandHeatmapLayoutare public for testing and custom overlays. - All three widgets support animated updates.
Changed #
isTrendLineandtimeFrameare optional.KChartWidget(candles, ChartColors())is now a complete chart. Drawing tools are disabled unlessisTrendLineis set. WithouttimeFrame, the current-price label shows the price only, with no countdown timer.- Minimum SDK lowered to Flutter 3.27 and Dart 3.6 (previously Flutter 3.47 and Dart 3.13).
- Wider dependency ranges:
decimalfrom 3.0.0 andintlfrom 0.19.0 to below 0.21, for compatibility with theintlversion pinned byflutter_localizations. Tests pass on both the lowest and latest versions. - Removed dependency:
flutter_svg.
Documentation #
- New pages: Series charts, Pie chart, Radar chart, Heatmap and Migrating from fl_chart and candlesticks.
- Corrected the drawing-kind count in
theming.mdand the count of fully recomputed indicators inindicators.md.
2.4.1 #
This release addresses the intraday-chart issues reported in #3.
Fixed #
- Axis gutters use the chart background. The background was previously filled only across the plot width, so a right-hand gutter showed whatever was behind the widget and a left-hand gutter shifted the fill. Background bands now span the full canvas.
- Out-of-range prices stay inside the candle area. With a locked axis, ticks outside the visible range were drawn over the volume and indicator panes or off the canvas. Horizontal lines outside the range are now omitted, and their labels are pinned to the nearest edge with an arrow. The current-price line, signal lines and trading tags follow the same rule.
Added #
secondaryPriceAxisScaledraws a second price axis on the opposite side (for example,PriceAxisScale.percentagealongside prices), sized byChartStyle.secondaryPriceAxisWidth. It computes its own round values; the grid, crosshair and price tags continue to followpriceAxisScale. The two gutters together are limited to half the chart width.priceFormattercustomises how prices are displayed — currency symbols, thousands separators, tick sizes — similar todateFormatter. It applies to axis labels, the crosshair label, current-price, high/low and signal tags, and the OHLC legend.percentageandindexedTo100axes keep their own formatting.lockedScaleFollowsPriceexpands a locked axis just enough to keep the newest candle visible while it is in view. The range never shrinks or refits to the window. Disabled by default; requireslockPriceScale.ChartStyle.fitContentwidens candle spacing so a short series fills the plot, scaling candle and volume bars proportionally. It never narrows spacing, so it can stay enabled as more history loads.
2.4.0 #
Added #
scrollEnabledandzoomEnableddisable the chart's built-in gestures, for fixed views such as a single session, a thumbnail or a static figure.- With scrolling disabled, drags and flings are ignored and
onLoadMoreis never called. - With zooming disabled, pinch is ignored and the zoom slider (web and desktop) is hidden.
- Disable both together: zooming out can otherwise create room to scroll.
- Programmatic control through
KChartController(zoomIn,zoomOut,setChartScale,goToIndex,fitAll, …) is unaffected. - To show the full series, set
ChartStyle.pointWidthto roughly the chart width divided by the candle count.
- With scrolling disabled, drags and flings are ignored and
lockPriceScalekeeps the price axis fixed while scrolling instead of refitting it to the visible candles, which avoids jumps when paging history throughonLoadMore. It locks to the current range, so enabling it does not move the chart;resetPriceScalerefits and locks again.- High/low markers still track the visible window, and a locked axis can still be dragged and zoomed.
- Reset the scale when switching instruments. New candles and live ticks need no action.
ChartStyle.priceAxisWidthreserves a gutter for the price labels on the side set byverticalTextAlignment. Candles, grid, indicator panes and the date axis stop at the gutter, and the plot is clipped to its bounds. The default of0keeps the previous behaviour.
Fixed #
onLoadMoreis now invoked. The callback was accepted but never called. It now fires when a drag or fling reaches either edge — once per arrival, not every frame — withtrueat the newest candle andfalseat the oldest.- Toggling
showInfoDialogno longer throws. Re-enabling the readout subscribed twice to a single-subscription stream, surfacing asLateInitializationError: Field '_children' has not been initialized. The stream controller is now a broadcast controller.
2.3.1 #
Performance #
This release improves rendering performance with no API or visual changes.
Paint time per frame (µs) — 140 candles, 1200×800, median of three runs.
Filled bar: 2.3.1. Hollow bar: 2.3.0.
0 200 400 µs
┼──┬──┬──┬──┼──┬───┬──┬──┼──┬──┬──┬
candles ███████████████████░░░░░░░░░ 312 ← 445 1.4×
OHLC bars ██████████████████░░░░░░ 285 ← 391 1.4×
line ████████████░░░░░░░ 190 ← 307 1.6×
area ████████████░░░░░░░░░░░░ 191 ← 386 2.0×
baseline ███████████░░░░░░░░░░ 173 ← 344 2.0×
step line ██████████░░░░░░░░░ 162 ← 300 1.9×
high-low band ██████████░░░░░░░░░░░ 163 ← 344 2.1×
columns ██████████░░░░░░ 164 ← 254 1.5×
candles + 6 indicators ████████████████████████░░░░░░░░ 382 ← 522 1.4×
a mouse move ████░░░░░░░░░░░░░░░░░░░░░░░░ 72 ← 445 6.2×
Long history behind the visible window:
0 1000 2000 µs
┼──┬──┬──┬──┼──┬──┬──┬──┼──┬──┬──┬─
50k candles, 20 lines ██░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 198 ← 2668 13.5×
With a long history, frame cost previously grew with the total number of candles; it now depends only on what is visible — 13.5× faster (2668 µs to 198 µs).
Benchmarks are in test/paint_benchmark.dart (not part of flutter test).
Regression checks in test/render_perf_test.dart count draw calls rather than
time, so they are stable across machines. See the new
performance page for details.
- Batched series drawing. Line, area and band series are now drawn as one
path instead of one
drawPathper candle. Over a 90-candle window, draw calls drop from 479 to 212 (line), 569 to 213 (area) and 573 to 217 (high-low band). Volume moving averages are also batched, reducing candles from 573 to 395 calls and bars from 663 to 485. - Separate crosshair layer. The chart and crosshair now sit behind separate repaint boundaries, and the crosshair updates without a rebuild. Mouse movement repaints only the crosshair, its labels and the legends.
- Text layout caching. Axis and legend labels are cached by string, colour and size.
- Constant-time drawing anchors. Resolving a drawing's timestamp to a candle index previously searched the entire series for every anchor on every frame. A per-series lookup table is now built once.
- Skipped work when unused. Event alignment is skipped for charts without events, and the alert sweep is skipped when no drawing has alerts.
Fixed #
- Area and baseline fills were painted in per-candle slices that overlapped the line, tinting it progressively. The fill is now drawn once, beneath the line.
- Pane legends are no longer clipped by the high and low price markers.
Tests #
- Added
test/render_perf_test.dartandtest/counting_canvas.dart, aCanvaswrapper that counts draw calls. Assertions measure how draw calls grow with window size, excluding canvas-sized elements such as the grid. - Added golden tests for the step line, high-low band and columns chart types.
2.3.0 #
Added #
DepthRatioBarshows the share of resting volume on each side of the order book. Enable it withshowRatioBar: trueonDepthChartorDepthLadder; it uses the same levels as the widget above it, includingzoom. Changes animate, and an empty book shows a neutral track. Sized byDepthChartStyle.ratioBarHeightandratioFontSize.
2.2.0 #
Indicators #
SessionVwapIndicator— VWAP that resets at each session boundary (daily, weekly, monthly or yearly, matching pivot sessions), with volume-weighted standard-deviation bands.deviations: 0draws the average only. For a VWAP over the visible range, rebuildAnchoredVwapIndicatorfromonVisibleRangeChanged, as shown in the indicators guide.TimeframeIndicator— computes any indicator on a higher timeframe, such as a daily moving average on a 15-minute chart. Each candle uses the last higher-timeframe bar closed before it opened, so values never repaint or look ahead. Aggregation is available asCandleTransforms.resampleandCandleTransforms.bucketIndices, using the chart's day and calendar boundaries.AroonIndicator— Aroon Up and Down as percentages overperiodcandles, in a 0–100 pane with guides at 30 and 70. Supports incremental updates. Colours:ChartColors.aroonUpColorandaroonDownColor.
Navigation #
ChartLinksynchronises the visible window and crosshair across charts. Any chart can lead, and feedback loops are prevented.syncFromaligns a chart added later.ChartLink(crosshair: false)andChartLink(window: false)sync one aspect only.crosshairPriceandpriceScalealso sync the vertical position and price-axis zoom/pan; they are off by default because they only apply to charts of the same instrument.ChartLink.all()enables everything.- Crosshair control on
KChartController:crosshairIndex,crosshairPrice,showCrosshair(index, price: …)andhideCrosshair(), plusKChartWidget.onCrosshairChanged. The crosshair is tracked by candle index so charts of different widths stay aligned, and a programmatic crosshair behaves as a hover so it never interrupts user input. - Price-axis pan on the controller:
pricePanandsetPricePan, alongside the existingpriceZoom. ChartOverview— a compact chart of the full history with the visible window highlighted. Drag the window to scroll, drag its edges to zoom, or tap to jump. It uses the sameKChartControlleras the main chart, so both stay in sync.
Drawing tools #
- Magnet mode applies to anchor drags as well as placement. Dragging a whole drawing remains unsnapped so its shape is preserved.
Workspaces #
IndicatorTemplateandIndicatorTemplatessave and apply named sets of indicators. Saving under an existing name replaces it in place, andIndicatorTemplate.startersprovides four default sets. Serialised with the workspace codec;unsaveablelists indicators the catalog cannot rebuild.ChartWorkspaceserialises indicators, drawings, chart type and price-axis settings to JSON.indicatorToJsonandindicatorFromJsonhandle single indicators; unknown entries are skipped rather than throwing.indicatorTypeRebuildingfinds the catalog entry that exactly rebuilds an indicator.indicatorTypeOfmatches by name only, which could not distinguish daily and weekly pivots.
Fixed #
SessionVwapIndicatorno longer draws bands on the first candle of a session, which produced a vertical spike at every session open. Bands start from the second candle.TimeframeIndicatorlegend labels now include the timeframe (for example,MA20@1D) so they are distinguishable from the chart's own indicators.ChartOverviewandChartLinkno longer throw when a controller notifies during build; updates are deferred to the end of the frame. The overview also reads the window after layout rather than before.- A linked crosshair is no longer clamped to the previous window when the window moves in the same frame.
- Reading a chart's visible window before its first layout now returns
nullinstead of throwingLateInitializationError.
Package #
- Breaking for documentation links: the
docs/directory is renamed todoc/, following pub conventions. Update any links to pages underdocs/. KChartHosthas new members:chartCrosshairIndex,chartCrosshairPrice,chartPricePan,setChartPricePan, and apriceargument onshowChartCrosshair. This interface is implemented only byKChartWidget; custom implementations must add these members.KChartControllergained additions only.
2.1.0 #
Axes #
- Round tick values. Both axes now select round values first and place
gridlines at them, instead of labelling evenly spaced pixels. The price axis
shows
70000, 69500, 69000rather than70429, 69745, 69060, and the date axis lands on times such as06:00, 12:00, 18:00. - Logarithmic axes step at 1, 2 and 5 times each power of ten, falling back to linear steps for narrow ranges. Percentage axes use round percentages.
- Intraday date axes show clock times, with the date where the day changes. A
custom
dateFormatterorChartStyle.dateTimeFormatstill takes precedence. - Overlapping date labels are omitted.
- Tick boundaries follow the displayed time zone, so half-hour
timeZoneOffsetvalues still produce round local times. - New public helpers for custom axes:
niceTicks,niceLogTicks,niceStep,niceTimeStep,timeBucketandstartsNewDay.
Replay #
ChartReplayControllerreplays a chart candle by candle. Pass it toKChartWidget.replay; the chart, indicators, current-price line and legend only see data up toposition. Controls:start,stepForward,stepBack,play,pause,toggle,setIntervalandstop. Listeners are notified on every change.
Sessions and per-bar colour #
KChartWidget.sessionshades pre-market and after-hours periods. ATradingSessiondefines open and close times and trading days in the displayed time zone; sessions wherecloseis at or beforeopenspan midnight. Consecutive out-of-session candles are drawn as a single band. Colour:ChartColors.extendedHoursColor.KChartWidget.candleColoroverrides the colour of individual candles, bars and columns. Returnnullto keep the default up/down colour.CandleEntityis now exported.
Price scale #
PriceAxisScale.indexedTo100labels the axis relative to the oldest visible candle at 100.KChartWidget.invertPriceAxisinverts the price axis. Candles, drawings, crosshair, orders and comparisons all follow, and logarithmic axes remain logarithmic.- Candle colour is now determined from prices rather than pixel positions, so inverted axes colour candles correctly. Wicks and OHLC bars use sorted extents for the same reason.
showAverageClosedraws a dashed line at the mean close of the visible window (ChartColors.avgColor).showHighLowOnAxislabels the visible high and low on the price axis.
Orders and positions #
KChartWidget.ordersandpositionsdisplay account data. AChartOrderis drawn at its price and aChartPositionat its average entry, each as a full-width line with an axis tag (for example,Buy 0.5,Long 1.5 +812.4). They are not drawings and are not saved with layouts.- Draggable orders.
onOrderDraggedfires during the drag andonOrderMovedon release. The chart does not modify the order itself; the app applies the change.ChartOrder.draggabledisables dragging per order, and orders are not draggable without anonOrderMovedhandler. onOrderTappedandonPositionTappedcallbacks. A press without movement is reported as a tap.- New
TradeSide,OrderKindandTradingStyle(viaChartStyle.trading), andChartColors.buyColor,sellColorandtradeColor.
Indicator panes #
Indicator.scale—IndicatorScale.linear(default),.logarithmicor.percentage(change from the first visible value). Ticks are computed in the chosen space; logarithmic panes fall back to linear when values reach zero.ChainedIndicatorcomputes one indicator over another's output, such as RSI of MACD. Warm-up periods are combined, and pane settings, guides, format and colours come from the applied indicator.flattenToCandlesis exported.Indicator.alertsandKChartWidget.onIndicatorAlertreport when the latest value crosses a declared level, such asIndicatorAlert(level: 70)orIndicatorAlert(level: 0, line: 2). Fires once per crossing, for overlays and panes.
Event marks #
KChartWidget.eventsshows badges below the candle area forChartEventKind.earnings,.dividend,.split,.newsand.custom, each with a default letter and colour.ChartEvent.label,colorandiconoverride them.- Events are matched to the nearest candle by time;
resolveEventsis exported. onEventTappedreports taps on badges, which take priority over selection and drawing input.- New
ChartColors.eventColorsandeventColor, andChartStyle.eventMarkRadiusandeventMarkGap. A radius of0hides the badges while keeping the data.
Visible range #
KChartController.visibleRangereturns aChartVisibleRangewith the first and last index, their timestamps, candle count and duration.KChartWidget.onVisibleRangeChangedfires after a frame in which the visible range actually changed.showRange,showTimeRange,goToIndex,goToDateandfitAllmove the window.showRangeadjusts zoom and scroll together;goToIndexandgoToDatescroll only, animated by default. Each returns whether the window moved.indexRangeCoveringandindexNearestare exported.
Chart types #
ChartType.stepLine,ChartType.hlcAreaandChartType.columns.ChartStyle.hlcAreaOpacitysets the HLC band opacity. HLC area and columns keep indicator overlays, legends and high/low markers.
Candle transforms #
CandleTransforms.lineBreak,kagi,pointAndFigureandrangeBars, alongside Heikin-Ashi and Renko. Each returns regular candles, so indicators and drawing tools work unchanged.kagiaccepts the reversal as a price or, withasPercent, a percentage.atrBrickSizecan size bricks, boxes, reversals and ranges.
Comparisons #
KChartWidget.comparisonsoverlays other instruments as lines. By default eachComparisonSeriesis rebased to the main series at the left edge of the window to show relative performance;ComparisonScale.priceplots actual prices instead.- Points are aligned to candles by timestamp (last point at or before each candle). Gaps break the line.
- The price range expands to include comparisons, and each has a legend row showing its percentage change.
- New
ChartColors.comparisonColorsandgetComparisonColor, separate from the moving-average palette. ComparisonSeries.ofCandles,alignComparison,comparisonAnchor,comparisonPriceAtandresolveComparisonsare exported.
Context menu #
- Right-click menu on the chart and on drawings. Drawing actions: coordinates, duplicate, copy, bring to front, send to back, lock, hide, alert and delete, applied to the whole selection. Chart actions: paste, select all, fit price scale, scroll to latest, undo, redo and clear. Right-clicking a drawing selects it.
KChartWidget.showContextMenudisables the menu;contextMenuBuildercustomises or replaces it.- New
ChartMenuItem,ChartMenuDivider,ChartMenuRequest,ChartMenuBuilderandshowChartMenu.
Drawing interaction #
- Multi-select. Shift- or ⌘-click adds to the selection and ⌘A selects all. Selected drawings move, delete (as one undo step) and restyle together; the line editor shows the selection count.
ChartDrawingControlleraddsselection,selectionLength,hasMultipleSelected,isSelected,selectMany,selectAll,addToSelection,removeFromSelection,toggleSelection,clearSelectionandremoveAll.selectedis unchanged.- Copy, paste and duplicate with ⌘C, ⌘V and ⌘D, offset from the original.
Controller:
copyToClipboard,canPaste,clipboardLength,clearClipboard,paste,duplicate. Chart:copySelection,pasteDrawings,duplicateSelection. - Stacking order with ⌘] / ⌘[ (one step) and ⇧⌘] / ⇧⌘[ (to front/back).
Controller:
bringToFront,sendToBack,bringForward,sendBackward,indexOf.ChartDrawings:moveToFront,moveToBack,moveForward,moveBackward,indexOf. The drawing manager gains reorder buttons. DrawingTemplatestores a drawing's colour, thickness, stroke, fill and label visibility for reuse across drawing types. Controller:saveTemplate,putTemplate,applyTemplate,removeTemplate,templates,templatesToJson,loadTemplates.- Coordinates dialog for editing a drawing's anchor prices and candles.
KChartWidget.showDrawingCoordinateshides the button,showDrawingCoordinatesDialogopens it programmatically, anddrawingAnchors,setDrawingAnchoranddrawingAnchorsAreEditableprovide generic anchor access. - Alerts on more drawings. The
AlertingDrawingmixin is applied toHorizontalLine,TrendLine,ParallelChannelandFibRetracementviaalertLevelsAt.KChartWidget.onDrawingAlertreports the drawing, candle and price;onAlertCrossedcontinues to fire for horizontal lines. TwoPointDrawing.priceOnLineAtreturns a line's price at a given time.- Drawing manager rows support duplicate, reorder and shift/⌘-click selection.
showStackingControlshides the reorder buttons.
Fixed #
ChartDrawings.saveno longer moves an edited drawing to the top of the stack.NumberUtil.formatprinted whole numbers as200.200; it now prints200.00.- Order and position tags now round size and P&L to two decimals.
Drawing tools #
- 13 new tools (29 total):
pitchfork,gannFan,gannBox,fibExtension,fibFan,fibTimeZones,regressionTrend,xabcd,priceRange,dateRange,callout,pathandflag, each with hit testing, drag handles and serialisation. MultiPointDrawingstores a variable number of anchors;XabcdDrawingandPathDrawingare built on it. Finish a variable-point drawing by tapping the same point twice or switching tools (which now completes rather than discards an open path).RegressionChannelfits a least-squares line to closes across its span with bands atdeviationsstandard deviations.fitRegressionis exported.PitchforkDrawingsupports Andrews', Schiff and modified Schiff variants.GannFan,GannBox,FibFan,FibTimeZonesandFibExtensioncomplete the Gann and Fibonacci sets.PriceRangeDrawing,DateRangeDrawing,CalloutDrawingandFlagDrawing.- Shared geometry for fans, boxes and pitchforks in
shape_geometry.dart. DrawingTranslationsnames for all new tools, andChartDrawingsgetters:pitchforks,gannFans,gannBoxes,fibExtensions,fibFans,fibTimeZones,regressions,xabcds,priceRanges,dateRanges,callouts,paths,flags.
Indicators #
VolumeProfileIndicator— volume by price band, with point of control, value area and up/down volume split. Colours:ChartColors.profileUpColor,profileDownColor,profilePocColor,profileValueAreaColor.PivotPointsIndicator— pivot, three supports and three resistances from the previous session.PivotMethod.standard,.fibonacciand.camarilla; sessionsPivotSession.day,.week,.monthand.year.AnchoredVwapIndicator— VWAP from a chosen candle onwards.- Indicators can return an
IndicatorProfileofProfileBins fromcomputeProfileto draw horizontal histograms. - Catalog entries:
VP,PIVOT,PIVOTFIB,PIVOTCAM,PIVOTWandAVWAP. Pivot names include the session (PIVOTW,PIVOTM,PIVOTY) so they round-trip through saved layouts.
Price scale #
- Draggable price axis. Drag the label strip to stretch or compress, drag
vertically on the chart to pan, and double-tap the labels to refit.
KChartWidget.priceScaleDragdisables it;ChartStyle.priceScaleGripWidthsets the grab area. KChartControlleraddspriceZoom,setPriceZoom,stretchPrice,compressPriceandresetPriceScale.
Panes #
- Indicator panes show gridlines and labels at round values instead of only their extremes. Panes with fixed ranges (RSI, KDJ, WR) keep their guides.
- MACD and Awesome Oscillator panes draw a zero line.
- The volume pane shows a reference level.
Theming #
ChartColors.gridColumnColorfor vertical gridlines, defaulting to a lighter shade ofgridColor.
API #
BaseChartRenderer.drawGridtakes an optionalcolumnXsso all panes share vertical gridlines. Affects only custom renderer subclasses.DrawingToolbaris now exported.ChartStyle.gridRowsandgridColumnsare documented as label density rather than line counts.
2.0.0 #
Drawing tools #
- Placement flow: horizontal and vertical lines are placed with one tap; trend lines with one tap per end, previewing the second end. Press-and-drag still works, and small accidental movement no longer discards the anchor.
- With a mouse, armed horizontal and vertical tools preview their position.
- Escape or switching tools cancels a partially placed drawing.
- The line editor no longer opens during placement.
KChartWidget.magnetModesnaps placement to the nearest open, high, low or close withinDrawingStyle.magnetSnapDistance.- Six new tools:
DrawingTool.ray,.extendedLine,.arrow,.horizontalRay,.rectangleand.fibRetracement. LineExtension,TrendLine.extendandTrendLine.arrowimplement the line variants; trend lines saved by earlier versions still load.HorizontalLine.startTimeturns a level into a ray.RectangleDrawingandFibRetracement, withKChartWidget.rectangles,fibRetracements,onAddRectangle,onRemoveRectangle,onAddFibRetracementandonRemoveFibRetracement.TwoPointDrawingbase class, supporting individual anchor drags or moving the whole shape.DrawingStyle.arrowHeadLength,.rectangleFillOpacity,.fibLevelsand.fibFillOpacity.- The label field applies to rectangles, and Fibonacci level labels no longer overlap.
- Seven more tools:
DrawingTool.measure(price, percent, candles and time),.channel,.position(risk-to-reward),.ellipse,.triangle,.textand.brush. MeasureDrawing,ParallelChannel,PositionDrawing,EllipseDrawing,TriangleDrawing,TextAnnotation,FreehandDrawingand theThreePointDrawingbase class.LabelledDrawingandFilledDrawingexpose the label field and fill slider to every applicable drawing.DrawingStyle.shapeFillOpacity,.measureFillOpacity,.channelFillOpacity,.positionFillOpacity,.showFillControland.showAlertControl.
Persistence #
- All drawings serialise.
ChartLine.toJsonanddrawingFromJsonround-trip a layout:jsonEncode(drawings.toJson())to save,ChartDrawings.fromJsonto load. Unknown drawing kinds are skipped, so layouts from newer versions still open. ChartDrawings— an ordered collection with typed views (horizontalLines,trendLines,positions, …) andcopyDrawingfor deep copies.KChartWidget.drawings,onAddDrawingandonRemoveDrawinghandle all drawing kinds. Per-kind lists and callbacks are unchanged.
Undo and redo #
ChartDrawingController(viaKChartWidget.drawingController) owns all drawings and records every add, edit, move and delete as an undoable step.- Keyboard shortcuts: ⌘Z / ⇧⌘Z (Ctrl+Z / Ctrl+Y on other platforms), Delete and
Escape.
enableKeyboardShortcutsdisables them. - The controller also owns the selection, keeping external panels and the chart in sync.
KChartWidget.selectAfterDrawingcontrols whether the editor opens after each placement.
Drawing manager #
DrawingManagerlists all drawings with show/hide, lock, delete, undo, redo and clear. Tapping a row selects the drawing.ChartLine.hiddenhides a drawing without removing it.DrawingTranslationscovers the manager and all seventeen drawing kinds vianameOf.
Alerts #
HorizontalLine.alertandKChartWidget.onAlertCrossedreport when the latest candle closes across a level, once per crossing. The editor's bell button toggles the alert.
Chart types #
KChartWidget.chartType:ChartType.candles,.bars,.line,.areaand.baseline(filled towardsbaselinePriceor the oldest visible close).isLine: truestill produces an area chart.CandleTransforms.heikinAshiand.renko, with.atrBrickSizefor ATR-based brick sizing.
Price axis #
KChartWidget.priceAxisScale:PriceAxisScale.logarithmicand.percentage(change from the oldest visible candle). Non-positive ranges fall back to linear.ChartPainter.calculatePriceand the crosshair price use the renderer's inverse mapping, fixing a small crosshair offset on linear axes.
Desktop support #
KChartWidget.crosshairOnHovershows the crosshair on mouse hover.KChartWidget.showOhlcLegenddisplays date, OHLC, change and volume above the chart, localised byChartTranslations.- Fixed a repaint loop caused by notifying the info dialog on every paint.
- Fixed the info dialog throwing on the oldest candle.
Programmatic control #
KChartController:zoomIn,zoomOut,zoomTo,scrollToNow,isAtRightEdgeandcapture(PNG export without overlays).- A scroll-to-latest button appears when scrolled away from the newest candle
(
showScrollToNowButton, tooltipChartTranslations.jumpToNow).
Panes, sessions and time zones #
- Indicator panes can be resized by their lower edge (
resizablePanes) and reordered by their legend (reorderablePanes,onReorderPane). NewChartStyle.paneResizeTolerance,.paneGrabHeight,.minPaneHeightand.maxPaneHeight. ChartStyle.showSessionDividersandChartColors.sessionDividerColormark the start of each day.KChartWidget.timeZoneOffsetshifts displayed times on axes, crosshair, legend and day boundaries without modifying data.ChartStyle.copyWith.- Fixed pointer events not reaching the chart's
Listener, which was blocked by an enclosingMouseRegion.
Example app #
- Demonstrates all tools, chart types, price axes, transforms, the drawing manager, undo/redo, JSON save/restore, PNG capture, pane resizing and reordering, session dividers and time zones.
- Control panel options wrap as chips to avoid overflow on narrow screens.
Tests #
- Golden tests for chart types, Heikin-Ashi, Renko, logarithmic axis, legend, session dividers and all drawings.
- New test suites for serialisation, the drawing controller and shortcuts, the drawing manager, shapes, alerts, price axes, chart types, transforms, panes, sessions and hover.
1.1.0 #
Line editor #
- Redesigned line editor. Selecting a line opens a floating, draggable
toolbar with a colour grid and opacity slider, thickness presets and slider,
stroke style previews, a label field, and lock, delete and done buttons. It
replaces the previous
SimpleDialogpickers and is hosted in the app overlay to avoid gesture conflicts with the chart. DrawingStyle(KChartWidget.drawingStyle) configures available colours, thicknesses and strokes, visible controls, toolbar appearance and position, handle and label geometry, dash lengths and tap tolerance.DrawingTranslations(ChartTranslations.drawing) localises the editor.LineStyle(solid,dashed,dotted) onChartLine, and aChartLine.opacityaccessor.isDashedstill works.- Editing, renaming or moving a line now fires the matching
onAdd*callback, so changes can be persisted. - Trend lines can be selected and dragged by their stroke, not only their endpoints.
DepthChartStyleandDepthChartColorsare now exported.
Fixed — line editor #
- The long-press readout no longer overflows; rows ellipsise and the card sizes
between the new
infoDialogWidthandinfoDialogMaxWidth. - Line thickness and handle shape no longer distort with horizontal zoom.
- Vertical line labels are drawn once and respect
showLabel. - Vertical lines no longer have an extra hard-coded 1-pixel overlay.
- Line label padding is symmetric.
Indicators #
Indicators are now configurable instances rather than enum flags, so the same indicator can be added multiple times with different settings and colours.
- Breaking:
mainStateLi,secondaryStateLiandmaDayListare replaced by a singleindicatorslist — for exampleMaIndicator(period: 20),AtrIndicator(period: 8)orMacdIndicator(fast: 5, slow: 34, signal: 5).MainStateandSecondaryStateare removed. Overlays draw on the main chart; other indicators each get a pane, in list order. - Multiple instances of the same indicator are supported, with automatic theme colours.
- Each instance accepts
color, orcolorsfor multi-line indicators (BOLL,MACD,KDJ,DMI), overridingChartColors. - Indicators are compared by type and settings, excluding colours.
indicators.upsert(...)updates a matching indicator;toggleandremoveIndicatorare also available. Duplicate entries are de-duplicated. indicatorCatalogdescribes every indicator's settings, ranges, defaults and colour slots for building configuration UIs. SeeIndicatorType.create,valuesOf,lineLabels,defaultColorsandindicatorTypeOf.- Indicator calculations are now pure functions shared by indicators and
DataUtil. - Custom indicators: subclass
Indicatorand implementlabel,lines,settingsandcompute.
12 new indicators:
- Overlays:
SupertrendIndicator,KeltnerIndicator,DonchianIndicatorandIchimokuIndicator(with a shaded cloud and standard displacement). - Swing analysis, controlled by
depth:ZigZagIndicator,FibonacciIndicator(retracement of the latest swing) andElliottWaveIndicator(labels1–5andA–C; a swing-based reading, not a rules-validated count). - Panes:
StochRsiIndicator(20/80 guides),RocIndicator,TrixIndicator,VolumeMaIndicatorandAwesomeIndicator. - New line shapes for any indicator:
IndicatorShape.pivotLine,IndicatorShape.markers(withmarkerLabel) andfillsbetween two lines (withfillColor). - Swing indicators default to
depth: 0, which sizes the threshold automatically (about eight swings across the data). The label showsauto. - New
ChartColorsentries:keltnerColor,donchianColor,conversionColor,baseColor,spanAColor,spanBColor,laggingColor,stochRsiColor,rocColor,trixColor,volumeMaColor,awesomeColor,zigzagColor,fibonacciColorandwaveColor.
Depth chart #
mode(DepthChartMode):cumulative(default),histogram,combinedandladder.DepthLadderwidget, usable standalone, withlevelsandbarsShowTotal.scale(DepthScale):linear,logandpercent.zoomlimits levels to a fraction of the mid price, falling back to the full book if nothing remains.DepthBookandDepthLevelderive per-level sizes from cumulative curves;DepthBook.fromCurvesis public.- The long-press readout shows both the level size and cumulative total.
- New
DepthChartTranslationsentries (size,total,bids,asks,spread) andDepthChartStyle.barWidthFactor,ladderRowHeightandladderFontSize.
Rendering #
- New overlays:
EMA(sharing theMApalette) andVWAP. - New sub-charts:
ATR(14),OBV,MFI(14, with 20/80 guides) andDMI(+DI, −DI and ADX, with a 20 guide), each with its ownChartColorsentry.DataUtil.calculatecomputes them;calcEMA,calcVWAP,calcATR,calcOBV,calcMFIandcalcDMIare public. - The main chart range includes
EMAandVWAP, as it does forBOLLandSAR. mBaseHeightis optional; the candle area fills the remaining height (360 in an unbounded box). Pane heights are available viaBaseDimension.volumeHeight,secondaryPaneHeightandlegendRowHeight.- Visual refinements: coloured pane separators, padded axis-label pills, translucent legend pills, optional hollow up candles, a dashed current-price line in up/down colours, high/low markers with leader lines, configurable crosshair dashes and an aligned, tinted watermark.
- New
ChartStylefields:hollowUpCandles,gridStrokeWidth,separatorWidth,axisLabelBackground,axisLabelPadding,labelCornerRadius,legendPadding,legendSpacing,crossDashLength,crossDashGap,nowPriceDashed,watermarkAlignment,watermarkScale. NewChartColorsfields:separatorColor,axisLabelBgColor,legendBgColor,watermarkColor. DepthEntity.bidsandDepthEntity.asksbuild cumulative curves from raw order-book levels.VerticalTextAlignmentis now exported.- The example app demonstrates all overlays and panes, drawing tools with two
editor styles, live updates,
onLoadMorepagination, signal markers, readout styles, light and dark themes, German localisation, hollow candles and the depth chart, with a responsive layout.
Fixed — rendering #
- Pivot-line indicators such as ZigZag now draw segments that span the visible window.
- Indicators with no visible values no longer draw an empty path.
isTapShowInfoDialognow works: a tap opens, moves and closes the readout.- Crosshair price and date labels are shown and hidden together with the crosshair, and suppressed while drawing or dragging.
- The volume pane separator no longer uses a hard-coded
Colors.amber. - The vertical grid draws the requested number of columns instead of ~120 mostly off-screen lines.
- The current-price line uses
nowPriceUpColorandnowPriceDnColor. - The watermark is centred in the candle area.
- The candle area no longer collapses when panes need more height than available; panes shrink instead.
- The bottom price label is omitted when it would overlap a pane legend.
NumberUtil.formatCompactpreserves the sign of negative values.
1.0.0 #
Initial release, extracted from an internal application module.
KChartWidgetwith candlestick and line rendering, pinch zoom, fling scroll, long-press crosshair and info dialog, current-price line with candle countdown, and an SVG watermark.- Main-chart overlays:
MA,BOLLandSAR. - Secondary charts:
MACD,KDJ,RSI,WRandCCI. - Trend, horizontal and vertical line drawing tools with selection, dragging, colour and thickness editing, and add/remove callbacks.
- Buy/sell
SignalEntitymarkers. DepthChartfor cumulative bid/ask depth with a long-press readout.ChartStyle,ChartColorsandChartTranslations, plusDepthChartStyle,DepthChartColorsandDepthChartTranslations, for styling and localisation.DataUtil.calculatecomputes all indicators over a candle list.- Supports iOS, Android, web, Windows, macOS and Linux. The zoom slider is shown only on web and desktop.
Fixed #
DataUtil.calculateno longer throws on an empty list.- Secondary charts scale correctly when an indicator stays below zero (the
running maximum was seeded with
double.minPositive). SARresets its acceleration factor consistently on both reversal directions.- The current-price countdown timer starts and stops when
showNowPricechanges.
