makeLine<T> function
Implementation
charts.Series<LineSeries, T> makeLine<T>(List<LineSeries> lineData,
bool withColor, String lastGroup, int lastAxis, int lastRender) {
charts.Series<LineSeries, T> line;
if (withColor) {
line = charts.Series<LineSeries, T>(
id: lastGroup,
domainFn: (LineSeries row, _) => row.x,
measureFn: (LineSeries row, _) => row.y,
colorFn: (LineSeries row, _) => row.color!,
labelAccessorFn: (LineSeries row, _) => row.yDisplay!,
dashPatternFn: (LineSeries row, _) {
return row.dashPattern;
},
data: lineData);
} else {
line = charts.Series<LineSeries, T>(
id: lastGroup,
domainFn: (LineSeries row, _) => row.x,
measureFn: (LineSeries row, _) => row.y,
labelAccessorFn: (LineSeries row, _) => row.yDisplay!,
dashPatternFn: (LineSeries row, _) {
return row.dashPattern;
},
data: lineData);
}
line
..setAttribute(
charts.measureAxisIdKey, lastAxis > 0 ? secondaryMeasureAxisId : null)
..setAttribute(
charts.rendererIdKey, lastRender > 0 ? secondaryMeasureAxisId : null);
return line;
}