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({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.
factory
SfChartThemeData.raw({required Brightness brightness, required Color axisLabelColor, required Color axisLineColor, required Color axisTitleColor, required Color backgroundColor, required Color titleTextColor, required Color crosshairBackgroundColor, required Color crosshairLabelColor, required Color crosshairLineColor, required Color legendBackgroundColor, required Color legendTextColor, required Color legendTitleColor, required Color majorGridLineColor, required Color majorTickLineColor, required Color minorGridLineColor, required Color minorTickLineColor, required Color plotAreaBackgroundColor, required Color plotAreaBorderColor, required Color selectionRectColor, required Color selectionRectBorderColor, required Color selectionTooltipConnectorLineColor, required Color titleBackgroundColor, required Color tooltipColor, required Color tooltipSeparatorColor, required Color tooltipLabelColor, required Color waterfallConnectorLineColor})
Create a SfChartThemeData given a set of exact values. All the values must be specified.
const

Properties

axisLabelColor Color
Specifies the color for axis labels.
final
axisLineColor Color
Specifies the color for axis line.
final
axisTitleColor Color
Specifies the color for axis title.
final
backgroundColor Color
Specifies the background color of chart widgets.
final
brightness Brightness
The brightness of the overall theme of the application for the 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
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
legendTitleColor Color
Specifies the title color of the legend.
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
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
titleBackgroundColor Color
Specifies the background color for title of the chart.
final
titleTextColor Color
Specifies the color of the chart 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
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}) 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.