ohlcv_chart β€” the most complete candlestick chart for Flutter, with every drawing tool and indicator

Read the changelog and the docs. This package moves quickly β€” a release can carry several new indicators, a new widget or two, and behaviour that has been sharpened since the last one. The list below is a summary and goes stale between releases; CHANGELOG.md says what actually changed and why, and doc/ has a page per feature with the detail. Both are worth a minute before you upgrade, and before you conclude something is missing.

Support

The full package is free to use in your own projects β€” every chart type, all 31 indicators and all 29 drawing tools, nothing held back, nothing paywalled, commercial projects included. I keep it updated weekly: new indicators, drawing tools and fixes land as I use it myself.

If it saves you some work, all I ask in return is:

That is the whole price, and it is what keeps the weekly updates coming.

A candlestick (K-line) chart, a market-depth chart, and line, bar, scatter, pie, radar and heatmap charts for Flutter, drawn entirely with CustomPainter β€” no WebView, no JavaScript bridge. One package for the trading screen and for the balance, growth and report charts around it.

Named for the open-high-low-close-volume bars it renders.

Candles with moving averages, volume and MACD

Features

  • Series charts for everything else β€” SeriesChart draws plain values rather than candles: lines with four curves, areas that fade to a baseline and split colour where they cross it, bars that group, stack or float, scatter plots, error bars, a band between two lines, axes you write, name or hide, a chart you can turn on its side, a tooltip of your own, one crosshair shared across charts, a range strip for long data and animated data changes. The migration guide maps fl_chart and candlesticks onto it.
  • A pie chart and a radar chart β€” PieChart for a pie, a doughnut with a widget in its hole or a ring gauge, with exploded slices and badges; RadarChart for a web of features with one outline per series. The two shapes an axis cannot draw, in the same package as the rest.
  • A heatmap β€” HeatmapChart colours a grid of squares by their value, from a matrix or from sparse cells: a fading or a stepped colour scale, labels in the squares and down both sides, a legend, and a readout for the square under the pointer. A contribution graph, a correlation matrix or sales by weekday and hour.
  • Eight chart types β€” candles, OHLC bars, a line, a step line, a filled area, an HLC area, a baseline chart and columns β€” plus Heikin-Ashi, Renko, three-line break, Kagi, point & figure and range bars as transforms of the candles themselves.
  • 31 indicators, each a configured instance rather than a flag β€” so ATR(8), ATR(14) and ATR(20) are three panes, with their own settings and colours.
  • Main-chart overlays β€” MA, EMA, BOLL, SAR, VWAP in three flavours β€” whole-series, anchored to a candle, or restarted each session with standard-deviation bands β€” Supertrend, Keltner and Donchian channels, the Ichimoku Cloud, pivot points and a volume profile.
  • Swing readers β€” a zigzag through the swing highs and lows, Fibonacci retracement of the last swing, and Elliott wave labels, all sized to the market by default.
  • Sub-charts β€” MACD, KDJ, RSI, WR, CCI, ATR, OBV, MFI, DMI, Aroon, Stochastic RSI, ROC, TRIX, a volume average and the Awesome oscillator, each in its own stacked pane β€” resizable and reorderable by dragging.
  • Linear, logarithmic, percentage or indexed-to-100 price axis, so a decade of compounding reads as well as an afternoon β€” invertible, with the window's high, low and average close markable on it.
  • A price scale you can drag β€” pull the labels to stretch or flatten the candles, drag the chart to slide the window, double-tap to fit it back; from code as well, through the controller.
  • A price axis that can be pinned β€” lockPriceScale holds it at one range instead of refitting it to whatever is on screen, so scrolling moves the candles under a scale that stays put rather than rescaling every number on the axis; and priceAxisWidth holds a gutter back for the labels, so the candles stop short of them instead of sliding underneath.
  • Axes that read as round numbers β€” both axes choose their values first and are ruled where the labels fall, so a price scale steps 69000, 69500, 70000 and an intraday date axis lands on the hour, never on whatever value happened to fall on an evenly spaced pixel.
  • 29 drawing tools β€” levels and rays, trend lines, arrows, extended lines, boxes, ellipses, triangles, parallel channels, pitchforks, Gann fans and boxes, four Fibonacci tools, a regression trend with its bands, XABCD patterns, multi-leg paths, price and date brackets, a measuring tool, planned positions with their risk-to-reward, notes, callouts, flags and freehand strokes; each placed by tap or drag, then dragged, locked, hidden and removed.
  • A line editor that opens on selection: colour, opacity, thickness, solid/dashed/dotted stroke, fill, label text and visibility, alerts, lock and delete β€” every option list, control and pixel of it configurable through DrawingStyle.
  • Undo and redo, through a ChartDrawingController that owns the drawings and their history, with ⌘Z, β‡§βŒ˜Z and Delete on the chart itself.
  • Select several and edit them together β€” shift- or ⌘-click, or ⌘A; then drag, restyle or delete the lot in one step, with ⌘C/⌘V/⌘D to copy and ⌘]/⌘[ to restack.
  • Exact coordinates β€” a dialog over any drawing's anchors, each price and candle typed in rather than placed by eye.
  • Style templates β€” save one drawing's look and put it on the rest.
  • Indicator templates β€” a named set of indicators saved and put on any chart in one gesture, with four starter sets to begin from.
  • A layout that persists β€” every drawing serialises, so jsonEncode(drawings.toJson()) and ChartDrawings.fromJson are the whole story.
  • A drawing manager β€” a ready-made panel listing what is drawn, with show/hide, lock, delete, undo, redo and clear.
  • Price alerts on a level, a trend line, either side of a channel or every step of a retracement, reported when the market crosses one.
  • Indicator alerts β€” an RSI over 70, a histogram turning positive β€” and panes that can be logarithmic or read as a percentage, with any indicator computable over another's output.
  • Higher timeframes β€” a daily moving average on a fifteen-minute chart, through TimeframeIndicator; each candle reads the last higher-timeframe bar that had closed when it opened, so the line never repaints and never shows a value from its own future.
  • A right-click menu on the chart and on any drawing β€” coordinates, duplicate, restack, lock, hide, alert, delete; paste, select all, fit the scale, undo β€” with your own items added through one builder.
  • Crosshair on hover and an OHLC legend above the chart, which is how a chart reads on a desktop.
  • Or no interaction at all β€” scrollEnabled and zoomEnabled turn the chart's own gestures off, for an intraday session, a thumbnail or a figure that is meant to sit still rather than be navigated; your own code can still drive it.
  • Driven from your own code β€” KChartController zooms, scrolls back to the live candle and hands you the chart as a PNG.
  • The visible window, read and set β€” which candles are on screen, go-to-date, fit-to-screen, and a callback whenever it moves.
  • An overview strip β€” ChartOverview draws the whole history under the chart with the visible window lit; drag it to scrub, drag its edges to zoom, tap to jump.
  • Charts kept in step β€” ChartLink holds any number of charts on the same window and crosshair, so scrolling, zooming or pointing at one carries the rest with it; ChartLink.all() carries the crosshair's price and the price axis too, for one market shown twice.
  • Compare a second instrument β€” overlay any number of other series, rebased so relative performance reads off the same axis, matched to your candles by time.
  • Bar replay β€” rewind to any candle and step or play the market forward, with the indicators only knowing what has arrived.
  • Buy/sell signal markers pinned to candles.
  • Event marks β€” earnings, dividends, splits and news badged under the candle they happened on, and tappable.
  • Orders and positions β€” live lines from your venue, tagged with side, size and P&L, and draggable to amend.
  • Extended-hours shading β€” the pre-market and after-hours stretches washed behind the candles β€” and a per-bar colour of your own.
  • Depth chart β€” a separate DepthChart widget for the order book, drawn as the cumulative curve, a per-rung histogram, both at once, or a numeric ladder of price, size and running total, on a linear, log or percentage axis and zoomable to the levels around the mid, with an optional bid/ask ratio bar underneath showing which way the resting orders lean.
  • Info dialog on long press, either the built-in Material popup or your own builder.
  • "Now price" line with a live countdown to the close of the current candle.
  • Session dividers and a display time zone, so an intraday chart breaks where the trader's day does.
  • A watermark of your own β€” any widget, such as an Image.asset of your logo, painted faintly in one colour over the candle area.
  • Fully themeable β€” ChartStyle for geometry, ChartColors for every colour, DrawingStyle for the drawing tools; ChartTranslations for every label. Filled or hollow candles, dashed or solid crosshair, pane separators, axis-label pills and a placed, tinted watermark.
  • Fits its box β€” the candles take whatever height the volume and indicator panes leave, so the chart works from a phone to a desktop window without arithmetic on your side.

The whole package in pictures

Every widget, every chart type and every tool below is in this one package, and each picture links to the page that covers it.

Series, pie, radar and heatmap charts

Four business charts
Four business charts
A return split at zero, profit bars, flows with a tooltip and a sparkline.
Pie and radar
Pie and radar
A doughnut with its total in the hole, and a web scoring two strategies.
Heatmap
Heatmap
Six months of activity, and orders by hour and weekday, by value.
Scatter
Scatter
A dot per trade, shaped and coloured by the point, read out one at a time.
Stacked and turned
Stacked and turned
Bars piled on each other on a chart running rightwards, both axes named.
Floating bars and bands
Floating bars and bands
A waterfall, and a forecast inside its band with error bars.
A window over long data
A window over long data
Three series over five months, with the strip that moves the window.
One crosshair, two panels
One crosshair, two panels
A balance panel over a profit panel, marking the same day in both.
Depth chart
Depth chart
Cumulative bid and ask depth from the order book.
Depth, four ways
Depth, four ways
The curve, the per-rung bars, both at once, or a numeric ladder.
The bid/ask ratio bar
The bid/ask ratio bar
Which way the resting orders lean, under the depth chart.

Candles, and the ways to draw them

Eight chart types
Eight chart types
Bars, baseline, area, step line, HLC area and columns.
Four bar transforms
Four bar transforms
Line break, Kagi, point & figure and range bars.
Heikin-Ashi and Renko
Heikin-Ashi and Renko
The same market re-aggregated before it is drawn.
A second instrument
A second instrument
Another series over the same window, rebased or at its own prices.
Dark and light
Dark and light
The same chart under both palettes, every colour yours.

31 indicators

Main-chart overlays
Main-chart overlays
The Ichimoku cloud and Supertrend, over Stochastic RSI and Awesome.
Profile and anchored VWAP
Profile and anchored VWAP
A volume profile and a VWAP anchored to a candle.
Swing readers
Swing readers
A zigzag, a Fibonacci retracement and Elliott wave labels.
Stacked panes
Stacked panes
Three ATRs at different periods, each in its own resizable pane.
Higher timeframes
Higher timeframes
A four-hour average and RSI over fifteen-minute candles.
Built from the catalogue
Built from the catalogue
The example app's add-indicator sheet, generated from it.

Drawing tools, orders and events

29 drawing tools
29 drawing tools
Trend and horizontal lines with labels, snapped and persisted.
Rays, boxes and fibs
Rays, boxes and fibs
A ray, an arrow, a horizontal ray, a range box and a retracement.
The line editor
The line editor
Every control of a selected drawing, styled by DrawingStyle.
Orders and positions
Orders and positions
A working order and an open position, each tagged on the axis.
Planning a trade
Planning a trade
A planned position with its risk-to-reward, inside a channel.
Event marks
Event marks
Earnings, a dividend, a split and news under the candles.

Reading it, and driving it

Legend and crosshair
Legend and crosshair
The OHLC row above the chart, reading from the crosshair.
The long-press readout
The long-press readout
The card over a held candle, or a builder of your own.
The overview strip
The overview strip
The whole series under the chart, with the visible window lit.
Linked charts
Linked charts
Two charts sharing one crosshair.
Bar replay
Bar replay
Rewind, then step or play the market forward.
Held mid-replay
Held mid-replay
The chart stopped at the 150th candle of 420, under a transport bar.

The axes, the session and the box

Four price axes
Four price axes
Linear, log, percentage or indexed to 100 β€” and invertible.
A log axis
A log axis
Stepping by ratio, so a decade of compounding reads evenly.
The date axis
The date axis
The round time values the chart picks, or your own formatter.
Sessions and time zones
Sessions and time zones
Pre-market and after-hours washed behind the candles.
Session VWAP
Session VWAP
A VWAP restarted each session, with its standard-deviation band.
Fits its box
Fits its box
The candle area filling the box, and pinned to a height.
A watermark of your own
A watermark of your own
Any widget, painted faintly over the candle area.

Install

dependencies:
  ohlcv_chart: ^2.5.0

Quick start

Feed a KChartWidget a List<KLineEntity>, having run DataUtil.calculate over it so the indicator fields are populated:

import 'package:ohlcv_chart/ohlcv_chart.dart';

DataUtil.calculate(candles);

KChartWidget(
  candles,
  ChartColors(),
  timeFrame: const Duration(minutes: 15),
  indicators: [MaIndicator(period: 20), MacdIndicator()],
  fixedLength: 2,
);

That is a working chart. The candlestick chart page covers the rest of the constructor, and the example app is a tour of every switch in the package.

Documentation

One page per feature, in doc/:

Candlestick chart The candles, and the shape KLineEntity expects
Series charts SeriesChart for values: lines, areas, bars, scatter, touch, a range strip, animation
Pie chart PieChart: sections, a doughnut hole, badges, touch
Radar chart RadarChart: a web of features with an outline per series
Heatmap HeatmapChart: a grid coloured by value, with a scale and a legend
Indicators 31 of them as instances, the catalogue, pane scales, chaining, higher timeframes, alerts
Comparing a second instrument Other series over the same window, rebased or at their own prices
Chart types Eight ways to draw a series, and six transforms of the candles
Price axis Linear, log, percentage or indexed to 100; inverting, dragging, locking it, and its gutter
The date axis Round time values, and taking the axis over yourself
The legend and the crosshair The OHLC row, and the crosshair on hover
The long-press readout The card over a held candle, and your own builder
Drawing tools All 29 tools, persistence, undo, multi-select, templates, alerts
Customising the line editor Every control of the editor, through DrawingStyle
Orders and positions Live lines from your venue, tagged and draggable
Event marks Earnings, dividends, splits and news under the candles
Sessions and time zones Day dividers, display time zone, extended hours, per-bar colour
Driving the chart KChartController, the visible window, and a chart with no gestures
Panes Stacking, resizing and reordering the indicator panes
Bar replay Rewind, then step or play the market forward
Sizing How the candle area and the panes divide the height
Depth chart The order-book widget: four modes, three axes
Theming ChartStyle, ChartColors and ChartTranslations
Migrating from 1.x What changed, and what to use instead
Migrating from fl_chart and candlesticks Their APIs mapped onto this package's, with worked examples

Notes

  • Needs Dart 3.6 and Flutter 3.27 or later.
  • The zoom slider renders only where there is no pinch gesture β€” web and desktop.
  • watermark takes any widget and paints it in ChartColors.watermarkColor, so a full-colour logo reads as a silhouette; the package no longer depends on flutter_svg β€” pass SvgPicture.asset(...) from it yourself for an SVG.

Credits

The rendering core began as a derivative of the open-source k_chart package and has since been substantially extended with drawing tools, signals, multi-indicator stacking and a reworked painter pipeline.

License

MIT β€” see LICENSE.

Libraries

ohlcv_chart
Candlestick (K-line), market-depth and series charts for Flutter.