ChartState<T>.line constructor

  1. @Deprecated('Use ChartState(foregroundDecorations: [SparkLineDecoration()])')
ChartState<T>.line(
  1. ChartData<T> data, {
  2. required BubbleItemOptions itemOptions,
  3. ChartBehaviour behaviour = const ChartBehaviour(),
  4. List<DecorationPainter> backgroundDecorations = const <DecorationPainter>[],
  5. List<DecorationPainter> foregroundDecorations = const <DecorationPainter>[],
})

Create line chart with foreground sparkline decoration and background grid decoration

Implementation

@Deprecated('Use ChartState(foregroundDecorations: [SparkLineDecoration()])')
factory ChartState.line(
  ChartData<T> data, {
  required BubbleItemOptions itemOptions,
  ChartBehaviour behaviour = const ChartBehaviour(),
  List<DecorationPainter> backgroundDecorations = const <DecorationPainter>[],
  List<DecorationPainter> foregroundDecorations = const <DecorationPainter>[],
}) {
  return ChartState(
    data: data,
    itemOptions: itemOptions,
    behaviour: behaviour,
    backgroundDecorations: backgroundDecorations.isEmpty
        ? [GridDecoration()]
        : backgroundDecorations,
    foregroundDecorations: foregroundDecorations.isEmpty
        ? [SparkLineDecoration()]
        : foregroundDecorations,
  );
}