SeriesItem.fromMaps constructor
SeriesItem.fromMaps(})
Implementation
factory SeriesItem.fromMaps(
List<Map<String, dynamic>> rows, {
required String name,
required Color color,
String mapXKey = 'x',
String mapYKey = 'y',
String? mapLabelKey,
double pointRadius = 5.0,
bool connectPoints = false,
double lineWidth = 2.0,
bool showPoints = true,
}) {
return SeriesItem(
name: name,
color: color,
pointRadius: pointRadius,
connectPoints: connectPoints,
lineWidth: lineWidth,
showPoints: showPoints,
points: rows
.where((r) => r[mapXKey] != null && r[mapYKey] != null)
.map(
(r) => SeriesPoint.fromMap(
r,
mapXKey: mapXKey,
mapYKey: mapYKey,
mapLabelKey: mapLabelKey,
),
)
.toList(),
);
}