createTickFormatter method

  1. @override
DateTimeTickFormatter createTickFormatter(
  1. ChartContext context
)
override

A formatter will be created with the DateFormat if it is not null. Otherwise, it will create one with the provided DateTimeFormatterFunction.

Implementation

@override
DateTimeTickFormatter createTickFormatter(ChartContext context) {
  assert(dateFormat != null || formatter != null, 'No formatter provided.');
  return DateTimeTickFormatter.uniform(
    SimpleTimeTickFormatter(
      formatter: dateFormat != null ? dateFormat!.format : formatter!,
    ),
  );
}