SfChartThemeData constructor
SfChartThemeData({
- Brightness? brightness,
- Color? backgroundColor,
- Color? axisLabelColor,
- Color? axisTitleColor,
- Color? axisLineColor,
- Color? majorGridLineColor,
- Color? minorGridLineColor,
- Color? majorTickLineColor,
- Color? minorTickLineColor,
- Color? titleTextColor,
- Color? titleBackgroundColor,
- Color? legendTextColor,
- Color? legendTitleColor,
- Color? legendBackgroundColor,
- Color? plotAreaBackgroundColor,
- Color? plotAreaBorderColor,
- Color? crosshairLineColor,
- Color? crosshairBackgroundColor,
- Color? crosshairLabelColor,
- Color? tooltipColor,
- Color? tooltipLabelColor,
- Color? tooltipSeparatorColor,
- Color? selectionRectColor,
- Color? selectionRectBorderColor,
- Color? selectionTooltipConnectorLineColor,
- Color? waterfallConnectorLineColor,
Creating an argument constructor of SfChartThemeData class.
Implementation
factory SfChartThemeData(
{Brightness? brightness,
Color? backgroundColor,
Color? axisLabelColor,
Color? axisTitleColor,
Color? axisLineColor,
Color? majorGridLineColor,
Color? minorGridLineColor,
Color? majorTickLineColor,
Color? minorTickLineColor,
Color? titleTextColor,
Color? titleBackgroundColor,
Color? legendTextColor,
Color? legendTitleColor,
Color? legendBackgroundColor,
Color? plotAreaBackgroundColor,
Color? plotAreaBorderColor,
Color? crosshairLineColor,
Color? crosshairBackgroundColor,
Color? crosshairLabelColor,
Color? tooltipColor,
Color? tooltipLabelColor,
Color? tooltipSeparatorColor,
Color? selectionRectColor,
Color? selectionRectBorderColor,
Color? selectionTooltipConnectorLineColor,
Color? waterfallConnectorLineColor}) {
brightness = brightness ?? Brightness.light;
final bool isLight = brightness == Brightness.light;
backgroundColor ??= Colors.transparent;
axisLabelColor ??= isLight
? const Color.fromRGBO(104, 104, 104, 1)
: const Color.fromRGBO(242, 242, 242, 1);
axisTitleColor ??= isLight
? const Color.fromRGBO(66, 66, 66, 1)
: const Color.fromRGBO(255, 255, 255, 1);
axisLineColor ??= isLight
? const Color.fromRGBO(181, 181, 181, 1)
: const Color.fromRGBO(101, 101, 101, 1);
majorGridLineColor ??= isLight
? const Color.fromRGBO(219, 219, 219, 1)
: const Color.fromRGBO(70, 74, 86, 1);
minorGridLineColor ??= isLight
? const Color.fromRGBO(234, 234, 234, 1)
: const Color.fromRGBO(70, 74, 86, 1);
majorTickLineColor ??= isLight
? const Color.fromRGBO(181, 181, 181, 1)
: const Color.fromRGBO(191, 191, 191, 1);
minorTickLineColor ??= isLight
? const Color.fromRGBO(214, 214, 214, 1)
: const Color.fromRGBO(150, 150, 150, 1);
titleTextColor ??= isLight
? const Color.fromRGBO(66, 66, 66, 1)
: const Color.fromRGBO(255, 255, 255, 1);
titleBackgroundColor ??= Colors.transparent;
legendTextColor ??= isLight
? const Color.fromRGBO(53, 53, 53, 1)
: const Color.fromRGBO(255, 255, 255, 1);
legendBackgroundColor ??= isLight
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(0, 0, 0, 1);
legendTitleColor ??= isLight
? const Color.fromRGBO(66, 66, 66, 1)
: const Color.fromRGBO(255, 255, 255, 1);
plotAreaBackgroundColor ??= Colors.transparent;
plotAreaBorderColor ??= isLight
? const Color.fromRGBO(219, 219, 219, 1)
: const Color.fromRGBO(101, 101, 101, 1);
crosshairLineColor ??= isLight
? const Color.fromRGBO(79, 79, 79, 1)
: const Color.fromRGBO(255, 255, 255, 1);
crosshairBackgroundColor ??= isLight
? const Color.fromRGBO(79, 79, 79, 1)
: const Color.fromRGBO(255, 255, 255, 1);
crosshairLabelColor ??= isLight
? const Color.fromRGBO(229, 229, 229, 1)
: const Color.fromRGBO(0, 0, 0, 1);
tooltipColor ??= isLight
? const Color.fromRGBO(0, 8, 22, 0.75)
: const Color.fromRGBO(255, 255, 255, 1);
tooltipLabelColor ??= isLight
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(0, 0, 0, 1);
tooltipSeparatorColor ??= isLight
? const Color.fromRGBO(255, 255, 255, 1)
: const Color.fromRGBO(150, 150, 150, 1);
selectionRectColor ??= isLight
? const Color.fromRGBO(41, 171, 226, 0.1)
: const Color.fromRGBO(255, 217, 57, 0.3);
selectionRectBorderColor ??= isLight
? const Color.fromRGBO(41, 171, 226, 1)
: const Color.fromRGBO(255, 255, 255, 1);
selectionTooltipConnectorLineColor ??= isLight
? const Color.fromRGBO(79, 79, 79, 1)
: const Color.fromRGBO(150, 150, 150, 1);
waterfallConnectorLineColor ??= isLight
? const Color.fromRGBO(0, 0, 0, 1)
: const Color.fromRGBO(255, 255, 255, 1);
return SfChartThemeData.raw(
brightness: brightness,
axisLabelColor: axisLabelColor,
axisLineColor: axisLineColor,
axisTitleColor: axisTitleColor,
backgroundColor: backgroundColor,
titleTextColor: titleTextColor,
crosshairBackgroundColor: crosshairBackgroundColor,
crosshairLabelColor: crosshairLabelColor,
crosshairLineColor: crosshairLineColor,
legendBackgroundColor: legendBackgroundColor,
legendTextColor: legendTextColor,
legendTitleColor: legendTitleColor,
majorGridLineColor: majorGridLineColor,
majorTickLineColor: majorTickLineColor,
minorGridLineColor: minorGridLineColor,
minorTickLineColor: minorTickLineColor,
plotAreaBackgroundColor: plotAreaBackgroundColor,
plotAreaBorderColor: plotAreaBorderColor,
selectionRectColor: selectionRectColor,
selectionRectBorderColor: selectionRectBorderColor,
selectionTooltipConnectorLineColor: selectionTooltipConnectorLineColor,
titleBackgroundColor: titleBackgroundColor,
tooltipColor: tooltipColor,
tooltipSeparatorColor: tooltipSeparatorColor,
tooltipLabelColor: tooltipLabelColor,
waterfallConnectorLineColor: waterfallConnectorLineColor);
}