LineChart constructor

LineChart({
  1. List<double>? data,
  2. required List<String> labels,
  3. List<LineChartSeries>? series,
  4. double height = 200.0,
  5. String strokeColor = '#6366f1',
  6. String fillColor = 'rgba(99, 102, 241, 0.08)',
  7. double strokeWidth = 2.5,
  8. String? className,
  9. Map<String, Object?> props = const {},
  10. Map<String, Object?> style = const {},
  11. DartStyle? dartStyle,
})

Implementation

LineChart({
  List<double>? data,
  required List<String> labels,
  List<LineChartSeries>? series,
  double height = 200.0,
  String strokeColor = '#6366f1',
  String fillColor = 'rgba(99, 102, 241, 0.08)',
  double strokeWidth = 2.5,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
}) : super(
        'div',
        props: mergeComponentProps(
          props,
          className: className,
          defaultStyle: const {'width': '100%'},
          dartStyle: dartStyle,
          style: style,
        ),
        children: [
          _buildSvg(
            series ??
                [
                  LineChartSeries(
                    data: data ?? const [],
                    strokeColor: strokeColor,
                    fillColor: fillColor,
                    strokeWidth: strokeWidth,
                  ),
                ],
            labels,
            height,
          ),
        ],
      );