Hello Guys,
first of all I would like to thank Syncfusion for the great products.
Atm i have a problem with the gradient function for Area Series.
I would like to achieve a look like this:
Im pretty sure there is an easy way to do that.
Thanks in advance.
Greetings
|
final List<Color> positiveColor = <Color>[];
positiveColor.add(Colors.green[50]!);
positiveColor.add(const Color.fromARGB(255, 145, 231, 148));
positiveColor.add(const Color.fromARGB(255, 3, 250, 11));
final List<double> stops = <double>[];
stops.add(0.0);
stops.add(0.5);
stops.add(1.0);
final LinearGradient positiveGradientColors = LinearGradient(
colors: positiveColor,
stops: stops,
begin: Alignment.bottomCenter,
end: Alignment.topCenter);
return Scaffold(
body: SfCartesianChart(
series: <ChartSeries<SampleData, num>>[
AreaSeries(
borderColor: const Color.fromARGB(255, 0, 248, 128),
borderWidth: 3,
gradient: positiveGradientColors,
dataSource: chartData,
xValueMapper: (SampleData data, _) => data.x,
yValueMapper: (SampleData data, _) => data.y),
],
)))) |
Thanks for ur fast responding. I will test it in a few days and give a short feedback.
Hello,
thanks for ur answer. Im still not able to get this gradient of my picture below. But i think thats not ur problem. The gradient function is working fine.
Greetings