ModBarChart constructor
const
ModBarChart({
- Key? key,
- required String title,
- TextStyle? titleStyle,
- TextAlign titleAlign = TextAlign.left,
- List<
ChartActionButton> actions = const [], - ModChartData? initialData,
- Future<
ModChartData> fetchData(- String period
- dynamic onPeriodChange()?,
- dynamic onDataLoaded()?,
- dynamic onBarClick()?,
- dynamic onError()?,
- BarChartOrientation orientation = BarChartOrientation.horizontal,
- double barHeight = 36,
- double barSpacing = 16,
- double barRadius = 8,
- int maxItemsBeforeScroll = 12,
- bool showTooltip = true,
- bool showValueLabels = true,
- bool enableZoom = true,
- double minZoom = 50.0,
- double maxZoom = 200.0,
- double chartContainerHeight = 400.0,
- double? barChartWidth,
- EdgeInsets? padding,
- List<
Color> ? customColors, - Color? backgroundColor,
- Color? containerBackgroundColor,
- IconData? zoomInIcon,
- IconData? zoomOutIcon,
- IconData? zoomResetIcon,
- ChartActionButtonTheme? actionButtonTheme,
- bool showLegendBorder = true,
- bool showLegendContainer = true,
- String? emptyStateTitle,
- IconData? emptyStateIcon,
- Color? lightSelectedBackgroundColor,
- Color? lightUnselectedBackgroundColor,
- Color? lightSelectedTextColor,
- Color? lightUnselectedTextColor,
- Color? lightBorderColor,
- Color? darkSelectedBackgroundColor,
- Color? darkUnselectedBackgroundColor,
- Color? darkSelectedTextColor,
- Color? darkUnselectedTextColor,
- Color? darkBorderColor,
Implementation
const ModBarChart({
super.key,
required this.title,
this.titleStyle,
this.titleAlign = TextAlign.left,
this.actions = const [],
this.initialData,
this.fetchData,
this.onPeriodChange,
this.onDataLoaded,
this.onBarClick,
this.onError,
this.orientation = BarChartOrientation.horizontal,
this.barHeight = 36,
this.barSpacing = 16,
this.barRadius = 8,
this.maxItemsBeforeScroll = 12,
this.showTooltip = true,
this.showValueLabels = true,
this.enableZoom = true,
this.minZoom = 50.0,
this.maxZoom = 200.0,
this.chartContainerHeight = 400.0,
this.barChartWidth,
this.padding,
this.footer,
this.customColors,
// Background customization
this.backgroundColor,
this.containerBackgroundColor,
// Zoom icons
this.zoomInIcon,
this.zoomOutIcon,
this.zoomResetIcon,
// Action button theme
this.actionButtonTheme,
// Legend customization
this.showLegendBorder = true,
this.showLegendContainer = true,
// Footer options
this.enableFooter = false,
this.emptyStateTitle,
this.emptyStateIcon,
// Light theme colors
this.lightSelectedBackgroundColor,
this.lightUnselectedBackgroundColor,
this.lightSelectedTextColor,
this.lightUnselectedTextColor,
this.lightBorderColor,
// Dark theme colors
this.darkSelectedBackgroundColor,
this.darkUnselectedBackgroundColor,
this.darkSelectedTextColor,
this.darkUnselectedTextColor,
this.darkBorderColor,
});