ChartTheme constructor
const
ChartTheme({
- required Color backgroundColor,
- required Color textColor,
- required Color gridColor,
- required Color axisColor,
- required List<
Color> gradientColors, - double shadowElevation = 4.0,
- double borderRadius = 16.0,
- bool showGrid = true,
- bool showAxis = true,
- bool showLegend = true,
- bool showTooltip = true,
- Color cardBorderColor = const Color(0x00000000),
- Color overlayColor = const Color(0x14000000),
- Color crosshairColor = const Color(0x66000000),
- Color tooltipBackgroundColor = const Color(0xFF111827),
- Color tooltipBorderColor = const Color(0x1FFFFFFF),
- List<
BoxShadow> tooltipShadow = const [BoxShadow(color: Color(0x1A000000), blurRadius: 18, offset: Offset(0, 8), spreadRadius: -6), BoxShadow(color: Color(0x0F000000), blurRadius: 10, offset: Offset(0, 4), spreadRadius: -6)], - double gridLineWidth = 1.0,
- double gridDashWidth = 4.0,
- double gridDashSpace = 4.0,
- int xAxisLabelRotation = 0,
- int yAxisLabelRotation = 0,
- TextStyle? axisLabelStyle,
- TextStyle? tooltipStyle,
- EdgeInsets padding = const EdgeInsets.fromLTRB(40, 20, 20, 40),
Implementation
const ChartTheme({
required this.backgroundColor,
required this.textColor,
required this.gridColor,
required this.axisColor,
required this.gradientColors,
this.shadowElevation = 4.0,
this.borderRadius = 16.0,
this.showGrid = true,
this.showAxis = true,
this.showLegend = true,
this.showTooltip = true,
this.cardBorderColor = const Color(0x00000000),
this.overlayColor = const Color(0x14000000),
this.crosshairColor = const Color(0x66000000),
this.tooltipBackgroundColor = const Color(0xFF111827),
this.tooltipBorderColor = const Color(0x1FFFFFFF),
this.tooltipShadow = const [
BoxShadow(
color: Color(0x1A000000),
blurRadius: 18,
offset: Offset(0, 8),
spreadRadius: -6,
),
BoxShadow(
color: Color(0x0F000000),
blurRadius: 10,
offset: Offset(0, 4),
spreadRadius: -6,
),
],
this.gridLineWidth = 1.0,
this.gridDashWidth = 4.0,
this.gridDashSpace = 4.0,
this.xAxisLabelRotation = 0,
this.yAxisLabelRotation = 0,
this.axisLabelStyle,
this.tooltipStyle,
this.padding = const EdgeInsets.fromLTRB(40, 20, 20, 40),
});