BarChart constructor

BarChart({
  1. required List<double> values,
  2. int? width,
  3. int? height,
  4. UvStyle? barStyle,
  5. UvStyle? axisStyle,
  6. UvStyle? gridStyle,
  7. UvStyle? labelStyle,
  8. bool showAxis = true,
  9. bool showGrid = false,
  10. int gridRows = 3,
  11. int gridCols = 0,
  12. List<String>? xLabels,
  13. List<String>? yLabels,
  14. List<ChartLegendEntry>? legendEntries,
  15. int legendColumns = 1,
  16. int legendRowGap = 0,
  17. ChartLegendPosition legendPosition = ChartLegendPosition.topRight,
  18. int legendPadding = 1,
  19. String barChar = '█',
  20. int barGap = 1,
  21. int? crosshairX,
  22. int? crosshairY,
  23. UvStyle? crosshairStyle,
  24. Key? key,
})

Creates a BarChart with the given data and display options.

When width or height is null the chart fills the available constraint space (responsive mode).

Set crosshairX and crosshairY to draw a crosshair overlay at that position (e.g. from mouse hover).

Implementation

BarChart({
  required this.values,
  this.width,
  this.height,
  this.barStyle,
  this.axisStyle,
  this.gridStyle,
  this.labelStyle,
  this.showAxis = true,
  this.showGrid = false,
  this.gridRows = 3,
  this.gridCols = 0,
  this.xLabels,
  this.yLabels,
  this.legendEntries,
  this.legendColumns = 1,
  this.legendRowGap = 0,
  this.legendPosition = ChartLegendPosition.topRight,
  this.legendPadding = 1,
  this.barChar = '█',
  this.barGap = 1,
  this.crosshairX,
  this.crosshairY,
  this.crosshairStyle,
  super.key,
});