chartGrid method
Implementation
Widget chartGrid(double gh, double gw, BuildContext context, List<Point> points) {
return Padding(
padding: const EdgeInsets.only(left: 20),
child: Container(
height: gh * 0.7 + 1,
width: gw * 0.9 + 1,
color: Colors.white,
child: Stack(
children: [
Center(
child: SizedBox(
height: gh,
width: gw,
child: ListView.builder(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.vertical,
itemCount: points.length,
itemBuilder: (_, i) {
return Column(
children: [
axisXLines(context),
SizedBox(
height: gh * 0.7 / (points.length - 1) - 1,
),
],
);
},
),
),
),
Center(
child: SizedBox(
height: gh,
width: gw,
child: ListView.builder(
physics: const BouncingScrollPhysics(),
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemCount: points.length,
itemBuilder: (_, i) {
return Row(
children: [
axisYLines(context),
if (i == points.length - 1)
Container()
else
SizedBox(
width: gw * 0.9 / (points.length - 1) - 1,
)
],
);
},
),
),
),
],
),
),
);
}