@@ -35,41 +35,59 @@ class _BasicAreaChartState extends State<BasicAreaChart> {
3535 Widget build (BuildContext context) {
3636 return GraphifyView (
3737 controller: controller,
38- initialOptions: const {
39- "xAxis" : {
38+ initialOptions: {
39+ "xAxis" : const {
4040 "type" : "category" ,
4141 "boundaryGap" : false ,
4242 "data" : ["Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" , "Sun" ]
4343 },
44- "yAxis" : {
44+ "yAxis" : const {
4545 "type" : "value"
4646 },
47- 'tooltip' : {
47+ 'tooltip' : const {
4848 'trigger' : 'axis' ,
4949 },
5050 "series" : [
5151 {
52- "data" : [150 , 230 , 224 , 218 , 135 , 147 , 260 ],
52+ "data" : const [150 , 230 , 224 , 218 , 135 , 147 , 260 ],
5353 "type" : "line" ,
5454 'smooth' : true ,
5555 'areaStyle' : {
56- 'color' : {
57- 'type' : 'RadialGradient' ,
58- 'x' : 0.1 ,
59- 'y' : 0.6 ,
60- 'r' : 1 ,
61- ' colorStops' : [
62- {
63- ' color' : 'rgba(255, 145, 124, 0.1)' ,
64- ' offset' : 0 ,
65- } ,
66- {
67- ' color' : 'rgba(255, 145, 124, 0.9)' ,
68- ' offset' : 1 ,
69- } ,
56+ 'color' : const GraphifyLinearGradient (
57+ x : 0.1 ,
58+ y : 0.6 ,
59+ x2 : 0.9 ,
60+ y2 : 0. 1 ,
61+ colorStops: [
62+ GraphifyGradientColorStop (
63+ color: Colors .green ,
64+ offset: 1 ,
65+ ) ,
66+ GraphifyGradientColorStop (
67+ color: Colors .red ,
68+ offset: . 4 ,
69+ ) ,
7070 ],
71- },
71+ ). toJson ()
7272 },
73+ // 'areaStyle': {
74+ // 'color': {
75+ // 'type': 'RadialGradient',
76+ // 'x': 0.1,
77+ // 'y': 0.6,
78+ // 'r': 1,
79+ // 'colorStops': [
80+ // {
81+ // 'color': 'rgba(255, 145, 124, 0.1)',
82+ // 'offset': 0,
83+ // },
84+ // {
85+ // 'color': 'rgba(255, 145, 124, 0.9)',
86+ // 'offset': 1,
87+ // },
88+ // ],
89+ // },
90+ // },
7391 }
7492 ]
7593 },
0 commit comments