MPFlutterChart icon indicating copy to clipboard operation
MPFlutterChart copied to clipboard

Linechart setGradientColors not working...

Open nbsathawara opened this issue 4 years ago • 0 comments

I am using linechart in one of my application. I want to show multiple gradient colors. I have used setGradientColors() as follow;

LineDataSet set1 = LineDataSet(vals, Strings.emptyString); set1.setColor1(Colors.black); set1.setDrawValues(false); set1.setDrawFilled(true); List<GradientColor> gradientColors = []; gradientColors.add(GradientColor(Colors.red, Colors.green)); gradientColors.add(GradientColor(Colors.yellow, Colors.blue)); gradientColors.add(GradientColor(Colors.amber, Colors.pink)); gradientColors.add(GradientColor(Colors.purple, Colors.cyan)); gradientColors.add(GradientColor(Colors.red, Colors.yellow)); set1.setGradientColors(gradientColors); set1.setLineWidth(1); set1.setDrawCircles(false);

But its not working and linechart shows only one color as following;

Screenshot 2022-01-20 at 9 29 09 PM

@SunPointed So, pls help to find proper solution. Thanks in advance.

nbsathawara avatar Jan 20 '22 16:01 nbsathawara