SfChartThemeData class

Holds the color and typography values for a SfChartTheme. Use this class to configure a SfChartTheme widget.

To obtain the current theme, use SfChartTheme.of.

Widget build(BuildContext context) {
  return Scaffold(
    body: SfChartTheme(
      data: SfChartThemeData(
        brightness: Brightness.dark,
        backgroundColor: Colors.blue[300]
      ),
      child: SfCartesianChart()
    )
  );
}

See also:

Mixed-in types
Annotations

Constructors

SfChartThemeData({Color? axisLabelColor, Color? axisLineColor, Color? axisTitleColor, Color? backgroundColor, Color? titleTextColor, Color? crosshairBackgroundColor, Color? crosshairLabelColor, Color? crosshairLineColor, Color? legendBackgroundColor, Color? legendTextColor, Color? legendTitleColor, Color? majorGridLineColor, Color? majorTickLineColor, Color? minorGridLineColor, Color? minorTickLineColor, Color? plotAreaBackgroundColor, Color? plotAreaBorderColor, Color? selectionRectColor, Color? selectionRectBorderColor, Color? selectionTooltipConnectorLineColor, Color? titleBackgroundColor, Color? tooltipColor, Color? tooltipSeparatorColor, Color? tooltipLabelColor, Color? waterfallConnectorLineColor, TextStyle? titleTextStyle, TextStyle? axisTitleTextStyle, TextStyle? axisLabelTextStyle, TextStyle? axisMultiLevelLabelTextStyle, TextStyle? plotBandLabelTextStyle, TextStyle? legendTitleTextStyle, TextStyle? legendTextStyle, TextStyle? dataLabelTextStyle, TextStyle? tooltipTextStyle, TextStyle? trackballTextStyle, TextStyle? crosshairTextStyle, TextStyle? selectionZoomingTooltipTextStyle})
Creating an argument constructor of SfChartThemeData class.
const
SfChartThemeData.raw({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, TextStyle? titleTextStyle, TextStyle? axisTitleTextStyle, TextStyle? axisLabelTextStyle, TextStyle? axisMultiLevelLabelTextStyle, TextStyle? plotBandLabelTextStyle, TextStyle? legendTitleTextStyle, TextStyle? legendTextStyle, TextStyle? dataLabelTextStyle, TextStyle? tooltipTextStyle, TextStyle? trackballTextStyle, TextStyle? crosshairTextStyle, TextStyle? selectionZoomingTooltipTextStyle})
Create a SfChartThemeData given a set of exact values. All the values must be specified.
factory

Properties

axisLabelColor Color?
Specifies the color for axis labels.
final
axisLabelTextStyle TextStyle?
Specifies the text style for axis label.
final
axisLineColor Color?
Specifies the color for axis line.
final
axisMultiLevelLabelTextStyle TextStyle?
Specifies the text style for axis multi-level label.
final
axisTitleColor Color?
Specifies the color for axis title.
final
axisTitleTextStyle TextStyle?
Specifies the text style for axis title.
final
backgroundColor Color?
Specifies the background color of chart widgets.
final
crosshairBackgroundColor Color?
Specifies the background color of the crosshair.
final
crosshairLabelColor Color?
Specifies the color of the crosshair text.
final
crosshairLineColor Color?
Specifies the crosshair line color.
final
crosshairTextStyle TextStyle?
Specifies the text style for crosshair label.
final
dataLabelTextStyle TextStyle?
Specifies the text style for data label.
final
hashCode int
The hash code for this object.
no setteroverride
legendBackgroundColor Color?
Specifies the background color of the legend.
final
legendTextColor Color?
Specifies the text color of the legend.
final
legendTextStyle TextStyle?
Specifies the text style for legend text.
final
legendTitleColor Color?
Specifies the title color of the legend.
final
legendTitleTextStyle TextStyle?
Specifies the text style for legend title.
final
majorGridLineColor Color?
Specifies the color for major grid line of an axis.
final
majorTickLineColor Color?
Specifies the color for major tick line of an axis.
final
minorGridLineColor Color?
Specifies the color for minor grid line of an axis.
final
minorTickLineColor Color?
Specifies the color for minor tick line of an axis.
final
plotAreaBackgroundColor Color?
Specifies the background color of the plot area of the chart.
final
plotAreaBorderColor Color?
Specifies the border color of the plot area of the chart.
final
plotBandLabelTextStyle TextStyle?
Specifies the text style for plot band label.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionRectBorderColor Color?
Specifies the stroke color of an rectangle which is used for selection zooming.
final
selectionRectColor Color?
Specifies the color of an rectangle which is used for selection zooming.
final
selectionTooltipConnectorLineColor Color?
Specifies the connector line color which is used in selection zooming.
final
selectionZoomingTooltipTextStyle TextStyle?
Specifies the text style for selection zooming interactive label.
final
titleBackgroundColor Color?
Specifies the background color for title of the chart.
final
titleTextColor Color?
Specifies the color of the chart title.
final
titleTextStyle TextStyle?
Specifies the text style for title.
final
tooltipColor Color?
Specifies the color of the tooltip.
final
tooltipLabelColor Color?
Specifies the text color of the tooltip.
final
tooltipSeparatorColor Color?
Specifies the line color of the tooltip which separates the header and values.
final
tooltipTextStyle TextStyle?
Specifies the text style for tooltip label.
final
trackballTextStyle TextStyle?
Specifies the text style for trackball label.
final
waterfallConnectorLineColor Color?
Specifies the connector line color for the waterfall chart.
final

Methods

copyWith({Brightness? brightness, Color? axisLabelColor, Color? axisLineColor, Color? axisTitleColor, Color? backgroundColor, Color? titleTextColor, Color? crosshairBackgroundColor, Color? crosshairLabelColor, Color? crosshairLineColor, Color? legendBackgroundColor, Color? legendTextColor, Color? legendTitleColor, Color? majorGridLineColor, Color? majorTickLineColor, Color? minorGridLineColor, Color? minorTickLineColor, Color? plotAreaBackgroundColor, Color? plotAreaBorderColor, Color? selectionRectColor, Color? selectionRectBorderColor, Color? selectionTooltipConnectorLineColor, Color? titleBackgroundColor, Color? tooltipColor, Color? tooltipSeparatorColor, Color? tooltipLabelColor, Color? waterfallConnectorLineColor, TextStyle? titleTextStyle, TextStyle? axisTitleTextStyle, TextStyle? axisLabelTextStyle, TextStyle? axisMultiLevelLabelTextStyle, TextStyle? plotBandLabelTextStyle, TextStyle? legendTitleTextStyle, TextStyle? legendTextStyle, TextStyle? dataLabelTextStyle, TextStyle? tooltipTextStyle, TextStyle? trackballTextStyle, TextStyle? crosshairTextStyle, TextStyle? selectionZoomingTooltipTextStyle}) SfChartThemeData
Creates a copy of this chart theme data object with the matching fields replaced with the non-null parameter values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(SfChartThemeData? a, SfChartThemeData? b, double t) SfChartThemeData?
Linearly interpolate between two themes.