diff --git a/example/lib/widgets/bar_chart.dart b/example/lib/widgets/bar_chart.dart index 5b3e367..1083af5 100644 --- a/example/lib/widgets/bar_chart.dart +++ b/example/lib/widgets/bar_chart.dart @@ -16,7 +16,21 @@ class BarChart extends StatelessWidget { this.itemOptions = const BarItemOptions(), this.stack = false, Key? key, - }) : _mappedValues = [data.map((e) => BarValue(dataToValue(e))).toList()], + }) : _mappedValues = [ + data.map((e) => ChartItem(dataToValue(e))).toList() + ], + super(key: key); + + BarChart.fromItem({ + required List> data, + this.height = 240.0, + this.backgroundDecorations = const [], + this.foregroundDecorations = const [], + this.chartBehaviour = const ChartBehaviour(), + this.itemOptions = const BarItemOptions(), + this.stack = false, + Key? key, + }) : _mappedValues = [data], super(key: key); const BarChart.map( @@ -30,7 +44,7 @@ class BarChart extends StatelessWidget { Key? key, }) : super(key: key); - final List>> _mappedValues; + final List>> _mappedValues; final double height; final bool stack;