createVirtualTick method

  1. @override
Tick createVirtualTick(
  1. int epoch,
  2. double quote
)
override

Creates a virtual tick for crosshair display when cursor is outside data range. Each series type should implement this to return the appropriate tick type.

This method is responsible for creating a virtual data point that represents the cursor position when it's outside the actual data range. Different chart types will create different types of ticks - line charts create simple Tick objects, while candle charts create Candle objects with all OHLC values set to the same quote value.

Parameters:

  • epoch - The timestamp for the virtual tick.
  • quote - The price/quote value for the virtual tick.

Returns: A virtual tick of the appropriate type for this series.

Implementation

@override
Tick createVirtualTick(int epoch, double quote) {
  return Tick(epoch: epoch, quote: quote);
}