Series<T, D> constructor
Series<T, D> ({
- required String id,
- required List<
T> data, - required TypedAccessorFn<
T, D> domainFn, - required TypedAccessorFn<
T, num?> measureFn, - String? displayName,
- Color? seriesColor,
- TypedAccessorFn<
T, Color> ? areaColorFn, - TypedAccessorFn<
T, Color> ? colorFn, - TypedAccessorFn<
T, List< ? dashPatternFn,int> ?> - TypedAccessorFn<
T, DomainFormatter< ? domainFormatterFn,D> > - TypedAccessorFn<
T, D?> ? domainLowerBoundFn, - TypedAccessorFn<
T, D?> ? domainUpperBoundFn, - TypedAccessorFn<
T, Color?> ? fillColorFn, - TypedAccessorFn<
T, Color> ? patternColorFn, - TypedAccessorFn<
T, FillPatternType> ? fillPatternFn, - TypedAccessorFn<
T, String> ? keyFn, - TypedAccessorFn<
T, String> ? labelAccessorFn, - TypedAccessorFn<
T, TextStyleSpec> ? insideLabelStyleAccessorFn, - TypedAccessorFn<
T, TextStyleSpec> ? outsideLabelStyleAccessorFn, - TypedAccessorFn<
T, MeasureFormatter> ? measureFormatterFn, - TypedAccessorFn<
T, num?> ? measureLowerBoundFn, - TypedAccessorFn<
T, num?> ? measureUpperBoundFn, - TypedAccessorFn<
T, num> ? measureOffsetFn, - bool overlaySeries = false,
- TypedAccessorFn<
T, num> ? radiusPxFn, - String? seriesCategory,
- TypedAccessorFn<
T, num?> ? strokeWidthPxFn,
Implementation
factory Series(
{required String id,
required List<T> data,
required TypedAccessorFn<T, D> domainFn,
required TypedAccessorFn<T, num?> measureFn,
String? displayName,
Color? seriesColor,
TypedAccessorFn<T, Color>? areaColorFn,
TypedAccessorFn<T, Color>? colorFn,
TypedAccessorFn<T, List<int>?>? dashPatternFn,
TypedAccessorFn<T, DomainFormatter<D>>? domainFormatterFn,
TypedAccessorFn<T, D?>? domainLowerBoundFn,
TypedAccessorFn<T, D?>? domainUpperBoundFn,
TypedAccessorFn<T, Color?>? fillColorFn,
TypedAccessorFn<T, Color>? patternColorFn,
TypedAccessorFn<T, FillPatternType>? fillPatternFn,
TypedAccessorFn<T, String>? keyFn,
TypedAccessorFn<T, String>? labelAccessorFn,
TypedAccessorFn<T, TextStyleSpec>? insideLabelStyleAccessorFn,
TypedAccessorFn<T, TextStyleSpec>? outsideLabelStyleAccessorFn,
TypedAccessorFn<T, MeasureFormatter>? measureFormatterFn,
TypedAccessorFn<T, num?>? measureLowerBoundFn,
TypedAccessorFn<T, num?>? measureUpperBoundFn,
TypedAccessorFn<T, num>? measureOffsetFn,
bool overlaySeries = false,
TypedAccessorFn<T, num>? radiusPxFn,
String? seriesCategory,
TypedAccessorFn<T, num?>? strokeWidthPxFn}) {
// Wrap typed accessors.
domainFn2(int? index) {
return domainFn(data[index!], index);
}
final domainFn1 = domainFn2;
final measureFn1 = (int? index) => measureFn(data[index!], index);
final areaColorFn1 = areaColorFn == null
? null
: (int? index) => areaColorFn(data[index!], index);
final colorFn1 =
colorFn == null ? null : (int? index) => colorFn(data[index!], index);
final dashPatternFn1 = dashPatternFn == null
? null
: (int? index) => dashPatternFn(data[index!], index);
final domainFormatterFn1 = domainFormatterFn == null
? null
: (int? index) => domainFormatterFn(data[index!], index);
final domainLowerBoundFn1 = domainLowerBoundFn == null
? null
: (int? index) => domainLowerBoundFn(data[index!], index);
final domainUpperBoundFn1 = domainUpperBoundFn == null
? null
: (int? index) => domainUpperBoundFn(data[index!], index);
final fillColorFn1 = fillColorFn == null
? null
: (int? index) => fillColorFn(data[index!], index);
final patternColorFn1 = patternColorFn == null
? null
: (int? index) => patternColorFn(data[index!], index);
final fillPatternFn1 = fillPatternFn == null
? null
: (int? index) => fillPatternFn(data[index!], index);
final labelAccessorFn1 = labelAccessorFn == null
? null
: (int? index) => labelAccessorFn(data[index!], index);
final insideLabelStyleAccessorFn1 = insideLabelStyleAccessorFn == null
? null
: (int? index) => insideLabelStyleAccessorFn(data[index!], index);
final outsideLabelStyleAccessorFn1 = outsideLabelStyleAccessorFn == null
? null
: (int? index) => outsideLabelStyleAccessorFn(data[index!], index);
final measureFormatterFn1 = measureFormatterFn == null
? null
: (int? index) => measureFormatterFn(data[index!], index);
final measureLowerBoundFn1 = measureLowerBoundFn == null
? null
: (int? index) => measureLowerBoundFn(data[index!], index);
final measureUpperBoundFn1 = measureUpperBoundFn == null
? null
: (int? index) => measureUpperBoundFn(data[index!], index);
final measureOffsetFn1 = measureOffsetFn == null
? null
: (int? index) => measureOffsetFn(data[index!], index);
final radiusPxFn1 = radiusPxFn == null
? null
: (int? index) => radiusPxFn(data[index!], index);
final strokeWidthPxFn1 = strokeWidthPxFn == null
? null
: (int? index) => strokeWidthPxFn(data[index!], index);
final keyFn1 =
keyFn == null ? null : (int? index) => keyFn(data[index!], index);
return Series._internal(
id: id,
data: data,
domainFn: domainFn1,
measureFn: measureFn1,
displayName: displayName,
areaColorFn: areaColorFn1,
colorFn: colorFn1,
dashPatternFn: dashPatternFn1,
domainFormatterFn: domainFormatterFn1,
domainLowerBoundFn: domainLowerBoundFn1,
domainUpperBoundFn: domainUpperBoundFn1,
fillColorFn: fillColorFn1,
fillPatternFn: fillPatternFn1,
keyFn: keyFn1,
patternColorFn: patternColorFn1,
labelAccessorFn: labelAccessorFn1,
insideLabelStyleAccessorFn: insideLabelStyleAccessorFn1,
outsideLabelStyleAccessorFn: outsideLabelStyleAccessorFn1,
measureFormatterFn: measureFormatterFn1,
measureLowerBoundFn: measureLowerBoundFn1,
measureUpperBoundFn: measureUpperBoundFn1,
measureOffsetFn: measureOffsetFn1,
overlaySeries: overlaySeries,
radiusPxFn: radiusPxFn1,
seriesCategory: seriesCategory,
seriesColor: seriesColor,
strokeWidthPxFn: strokeWidthPxFn1,
);
}