ProgressBarChart constructor

ProgressBarChart({
  1. Key? key,
  2. double minWidth = 0,
  3. EdgeInsetsGeometry padding = const EdgeInsets.all(20),
  4. BarChartStyle barChartStyle = BarChartStyle.vertical,
  5. required ChartAxis xAxis,
  6. required ChartAxis yAxis,
  7. required List<ProgressBarBundle> barBundleList,
  8. double barGroupSpace = 30,
  9. double singleBarWidth = 30,
  10. double barMaxValue = 0,
  11. Color selectedHintTextColor = Colors.white,
  12. Color selectedHintTextBackgroundColor = Colors.black,
  13. OnBarItemClickInterceptor? onBarItemClickInterceptor,
  14. BrnProgressBarChartSelectCallback? barChartSelectCallback,
  15. double height = 300,
})

create BrnProgressBarChart

Implementation

ProgressBarChart(
    {Key? key,
    this.minWidth = 0,
    this.padding = const EdgeInsets.all(20),
    this.barChartStyle = BarChartStyle.vertical,
    required this.xAxis,
    required this.yAxis,
    required this.barBundleList,
    this.barGroupSpace = 30,
    this.singleBarWidth = 30,
    this.barMaxValue = 0,
    this.selectedHintTextColor = Colors.white,
    this.selectedHintTextBackgroundColor = Colors.black,
    this.onBarItemClickInterceptor,
    this.barChartSelectCallback,
    this.height = 300})
    : super(key: key) {
  if (BarChartStyle.horizontal == barChartStyle) {
    assert(barBundleList[0].barList.length == yAxis.axisItemList.length,
        '水平柱状图个数与Y轴坐标数目要相等');
  } else if (BarChartStyle.vertical == barChartStyle) {
    assert(barBundleList[0].barList.length == xAxis.axisItemList.length,
        '竖直柱状图个数与X轴坐标数目要相等');
  }
}