GridStyle class
Styling for chart grid lines (major and optional minor).
Grid lines can be solid or dashed. Dash patterns follow Canvas API format.
Example:
final grid = GridStyle(
majorColor: Colors.grey[300]!,
majorWidth: 1.0,
majorDashPattern: [5.0, 5.0], // 5px on, 5px off
showMinor: true,
minorColor: Colors.grey[200]!,
minorWidth: 0.5,
);
- Available extensions
- Annotations
-
- @ChartSurface.new(combinedSetters: [CombinedSetter('withMinorGrid', ['showMinor', 'minorColor', 'minorWidth'])])
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- majorColor → Color
-
Color of major grid lines.
final
-
majorDashPattern
→ List<
double> -
Dash pattern for major grid lines. Empty list = solid line.
Pattern format:
[onLength, offLength, onLength, offLength, ...]Example:[5.0, 5.0]= 5px on, 5px offfinal - majorWidth → double
-
Width of major grid lines in pixels. Use 0.0 for no major grid.
final
- minorColor → Color?
-
Color of minor grid lines (if showMinor is true).
final
-
minorDashPattern
→ List<
double> -
Dash pattern for minor grid lines. Empty list = solid line.
final
- minorWidth → double?
-
Width of minor grid lines in pixels.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showMinor → bool
-
Whether to show minor grid lines.
final
Methods
-
clearMinorColor(
) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Clears GridStyle.minorColor tonull. -
clearMinorWidth(
) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Clears GridStyle.minorWidth tonull. -
copyWith(
{Color? majorColor, double? majorWidth, List< double> ? majorDashPattern, Color? minorColor, double? minorWidth, List<double> ? minorDashPattern, bool? showMinor, bool clearMinorColor = false, bool clearMinorWidth = false}) → GridStyle -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
-
withMajorColor(
Color value) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Replaces GridStyle.majorColor withvalue. -
withMajorDashPattern(
List< double> value) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Replaces GridStyle.majorDashPattern withvalue. -
withMajorWidth(
double value) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Replaces GridStyle.majorWidth withvalue. -
withMinorDashPattern(
List< double> value) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Replaces GridStyle.minorDashPattern withvalue. -
withMinorGrid(
{required bool showMinor, required Color minorColor, required double minorWidth}) → GridStyle -
Available on GridStyle, provided by the GridStyleFluent extension
Replaces GridStyle.showMinor, GridStyle.minorColor, and GridStyle.minorWidth together.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
Constants
- colorblindFriendly → const GridStyle
- corporateBlue → const GridStyle
- defaultDark → const GridStyle
- defaultLight → const GridStyle
- highContrast → const GridStyle
- minimal → const GridStyle
- vibrant → const GridStyle