BarChart constructor

BarChart({
  1. List<double>? data,
  2. required List<String> labels,
  3. List<BarChartSeries>? series,
  4. double height = 200.0,
  5. String barColor = '#6366f1',
  6. String? className,
  7. Map<String, Object?> props = const {},
  8. Map<String, Object?> style = const {},
  9. DartStyle? dartStyle,
})

Implementation

BarChart({
  List<double>? data,
  required List<String> labels,
  List<BarChartSeries>? series,
  double height = 200.0,
  String barColor = '#6366f1',
  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 ??
                [
                  BarChartSeries(
                    data: data ?? const [],
                    barColor: barColor,
                  ),
                ],
            labels,
            height,
          )
        ],
      );