BarChart

Draws a bar chart.

Properties

  • **animation**: AnimationValue (default: Animation(duration=150ms, curve=LINEAR)) - Controls chart implicit animation.
  • **baseline_y**: Number | None - Baseline value for Y axis.
  • **bgcolor**: ColorValue | None - Background color of the chart.
  • **border**: Border | None - The border around the chart.
  • **bottom_axis**: ChartAxis | None - The appearance of the bottom axis, its title and labels.
  • **group_alignment**: MainAxisAlignment (default: SPACE_EVENLY) - The alignment of the bar groups within this chart. If CENTER, group_spacing can be used.
  • **group_spacing**: Number (default: 16.0) - Space between bar groups.
  • **groups**: list[BarChartGroup] (default: []) - The list of BarChartGroups to draw.
  • **horizontal_grid_lines**: ChartGridLines | None - Controls drawing of chart's horizontal lines.
  • **interactive**: bool (default: True) - Enables automatic tooltips when hovering chart bars.
  • **left_axis**: ChartAxis | None - The appearance of the left axis, its title and labels.
  • **max_y**: Number | None - The maximum displayed value for Y axis.
  • **min_y**: Number | None - The minimum displayed value for Y axis.
  • **right_axis**: ChartAxis | None - The appearance of the right axis, its title and labels.
  • **tooltip**: BarChartTooltip | None (default: BarChartTooltip()) - The tooltip configuration for this chart. If None, tooltips are disabled.
  • **top_axis**: ChartAxis | None - The appearance of the top axis, its title and labels.
  • **vertical_grid_lines**: ChartGridLines | None - Controls drawing of chart's vertical lines.
  • Events

  • **on_event**: EventHandler[[BarChartEvent]] | None - Called when an event occurs on this chart, such as a click or hover.