SimpleBar

The SimpleBar is a type of BarGroup which accepts only one yValue and tells the Widget to draw a Single Bar of height representing the yValue.

...
import 'package:chart_it/chart_it.dart';

class TestBarCharts extends StatefulWidget {
  const TestBarCharts({Key? key}) : super(key: key);

  @override
  State<TestBarCharts> createState() => _TestBarChartsState();
}

class _TestBarChartsState extends State<TestBarCharts> {
  @override
  Widget build(BuildContext context) {
    return BarChart(
      ... // any chart configs
      data: BarSeries(
        barData: <BarGroup>[
          SimpleBar(
            xValue: 1,
            yValue: BarData(yValue: 23),
          ),
          SimpleBar(
            xValue: 2,
            yValue: BarData(yValue: 44),
          ),
          SimpleBar(
            xValue: 3,
            yValue: BarData(yValue: 35),
          ),
        ],
      ),
    );
  }
}

Class Properties

NameTypeRequiredDefault Value

xValue

num

true

-

yValue

num

true

-

padding

double

false

10.0

style

BarDataStyle?

false

null

Last updated