Skip to main content
Version: 3.0.0

ConfigSeries

seriesColor

Typedefault
Colornull

set single color for entire series

seriesColor: Colors.deepPurple,

alt

customColor

Typedefault
Color Function(G group, D data, int? index)?null

unlike seriesColor, this property allows for dynamic color assignments based on data points

customColor: (group, data, index) {
return switch (data.domain) {
'Mon' => Colors.blue,
'Tue' => Colors.green,
_ => Colors.deepPurple,
};
},

alt

areaColor

Typedefault
Color Function(G group, D data, int? index)?null

returns the area color for a given data value. Specify for Line type. Can custom for each group. includeArea must be set to true.

seriesColor: Colors.red,
stacked: true,
includeArea: true,
areaColor: (group, data, index) {
return switch (group.id) {
'id' => Colors.green.shade100,
'id2' => Colors.blue.shade100,
_ => Colors.purple.shade100,
};
},

alt

fillColor

Typedefault
Color? Function(G group, D data, int? index)?null

set fill chart where has fill box like bar

fillColor: (group, data, index) {
return switch (data.domain) {
'Tue' => Colors.green,
_ => Colors.deepPurple,
};
},

alt

fillGradient

Typedefault
Gradient? Function(G group, D data, int? index)?null

If render type is bar, you must set fillPattern to FillPattern.gradient.

fillGradient: (group, data, index) {
return const LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.blue,
Colors.purple,
],
);
},

alt

strokeGradient

Typedefault
Gradient? Function(G group, D data, int? index)?null

Set gradient color for stroke.

strokeGradient: (group, data, index) => const LinearGradient(
colors: [Colors.blue, Colors.purpleAccent],
),

alt

targetLineGradient

Typedefault
Gradient? Function(G group, D data, int? index)?null

just like strokeGradient, but better for clip bound size for gradient on each element

targetLineGradient: (group, data, index) {
return const LinearGradient(
colors: [Colors.yellow, Colors.cyan],
);
},

alt

areaGradient

Typedefault
Gradient? Function(G group, D data, int? index)?null

Set gradient for area in line chart. includeArea property must be set to true. and you can adjust alpha channel or opacity from areaOpacity property.

areaGradient: (group, data, index) {
return const LinearGradient(
colors: [Colors.red, Colors.amber],
);
},

alt

fillPattern

Typedefault
FillPattern Function(G group, D data, int? index)?null

dashPattern

Typedefault
List<int>? Function(G group, D data, int? index)?null

specify for line pattern

alt

labelAccessor

Typedefault
String Function(G group, D data, int? index)?null

set custom format value for label series, work for bar type

configSeriesBar: ConfigSeriesBarO(
showBarLabel: true,
labelAccessor: (group, data, index) {
return '${data.measure} km';
},
),

configSeriesPie: ConfigSeriesPieO(
showLabel: true,
arcLabelDecorator: const ArcLabelDecoratorO(
labelPosition: ArcLabelPosition.outside,
),
labelAccessor: (group, data, index) {
return '${data.domain}\n${data.measure} km';
},
),

alt alt

strokeWidthPx

Typedefault
num? Function(G group, D data, int? index)?null

allows for dynamic stroke width assignments based on data points

strokeWidthPx: (group, data, index) {
return switch (data.domain) {
'Mon' => 8,
_ => 2,
};
},

alt

radiusPx

Typedefault
num Function(G group, D data, int? index)?null

allows for dynamic radius series assignments based on data points

radiusPx: (group, data, index) {
return switch (data.domain) {
'Mon' => 12,
'Tue' => 3,
'Wed' => 8,
_ => 5,
};
},

alt

measureOffset

Typedefault
num Function(G group, D data, int? index)?null

starting plot measure to draw chart

measure: (group, data, index) {
return switch (data.domain) {
'Tue' => data.measure - 70,
_ => data.measure,
};
},
measureOffset: (group, data, index) {
return switch (data.domain) {
'Tue' => 70,
_ => 0,
};
},

alt

domain

Typedefault
T Function(G group, D data, int? index)?null

custom domain value

domainLowerBound

Typedefault
T? Function(G group, D data, int? index)?null

custom lower domain value

domainUpperBound

Typedefault
T? Function(G group, D data, int? index)?null

custom upper domain value

measure

Typedefault
num Function(G group, D data, int? index)?null

custom measure value

measureLowerBound

Typedefault
num? Function(G group, D data, int? index)?null

custom lower measure value

measureUpperBound

Typedefault
num? Function(G group, D data, int? index)?null

custom upper measure value