Hi everyone,
I wanted to say a different number of y values should be created according to the id of the person entering the page.That is, when I say how many y values should be while running, it should create a y value accordingly.
How can I get this without if else operator?
series: <ChartSeries>[
// Initialize line series
SplineSeries<_CurrentValues, String>(
dataSource: currentValues,
name: currentValuesLegendTitle,
xValueMapper: (_CurrentValues data, _) => data.x,
yValueMapper: (_CurrentValues data, _) => data.y,
color: Colors.black38),
SplineSeries<_CurrentValues1, String>(
dataSource: currentValues1,
name: currentValuesLegendTitle1,
xValueMapper: (_CurrentValues1 data, _) => data.x,
yValueMapper: (_CurrentValues1 data, _) => data.y1,
color: Colors.blue),
SplineSeries<_CurrentValues2, String>(
dataSource: currentValues2,
name: currentValuesLegendTitle2,
xValueMapper: (_CurrentValues2 data, _) => data.x,
yValueMapper: (_CurrentValues2 data, _) => data.y2,
color: const Color.fromRGBO(238, 182, 78, 1)),
]
I want create this Splineseries dynamically by jsondata how can i do this ?