StaticChartDataSource class
An in-memory, zero-boilerplate implementation of ChartDataSource.
Enables developers to feed an existing List<Candle> or JSON map data directly into Im Charts without writing custom data provider code.
- Implemented types
Constructors
-
StaticChartDataSource(List<
Candle> candles) -
Creates a static data source populated with the given
candles. -
StaticChartDataSource.fromMapList(List<
Map< rawList)String, dynamic> > -
Convenient constructor to parse raw OHLCV maps (e.g. from a REST API) directly.
factory
Properties
Methods
-
appendCandle(
Candle candle) → void -
Appends a new closed or live
candleto the dataset. -
dispose(
) → void -
Disposes any active connections or timers.
override
-
getHistoricalData(
{required String symbol, required Timeframe timeframe, int count = 500, DateTime? before}) → Future< List< Candle> > -
Fetches historical OHLCV bars for the specified
symbolandtimeframe. Optionally passbeforeto fetch candles older than that timestamp (for pagination).override -
getLiveTicks(
String symbol) → Stream< Tick> -
Real-time stream of live trades/ticks for the given
symbol.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pushPrice(
double price, {double volume = 1.0}) → void - Emits a live price tick with current timestamp.
-
pushTick(
Tick tick) → void - Emits a new real-time Tick through the live stream.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateCandles(
List< Candle> newCandles) → void -
Replaces all candles with
newCandles.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited