From 7fcd875c7142f3bf3cc0ce8115944ad6922553e3 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Fri, 7 Mar 2025 13:55:18 +0800 Subject: [PATCH] -- --- .../class_student/class_student_view.dart | 389 +++++++++--------- .../student_work_detail_logic.dart | 14 +- .../student_work_detail_state.dart | 3 + .../student_work_detail_view.dart | 79 ++-- .../widget/line_chart.dart | 237 +++++++++++ 5 files changed, 494 insertions(+), 228 deletions(-) create mode 100644 making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart diff --git a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart index 17f88ce..88af4f0 100644 --- a/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/class_student/class_student_view.dart @@ -44,205 +44,208 @@ class _ClassStudentPageState extends State { actions: const [ ReturnToHomepage(), ], + elevation: 0, ), - body: Padding( - padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), - child: Obx(() { - return EasyRefresh( - firstRefresh: false, - taskIndependence: true, - controller: logic.refreshController, - header: MaterialHeader(), - footer: TaurusFooter(), - onRefresh: () async { - logic.getList(); - }, - child: state.studentList.isNotEmpty - ? Utils.isPad() - ? GridView( - shrinkWrap: true, - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 10.r, - crossAxisSpacing: 10.r, - childAspectRatio: 556 / 112, - ), - children: - List.generate(state.studentList.length, (index) { - StudentItem item = state.studentList[index]; - return InkWell( - onTap: () { - // RouterManager.router.navigateTo(context, - // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); - Get.toNamed(Routes.studentWorkDetailPage, - arguments: { - 'studentName': item.name, - 'studentId': item.id, - 'subject':state.subject, - }); - }, - child: Container( - padding: EdgeInsets.symmetric(horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10.r)), - color: Colors.white, - ), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Text( - item.name, - style: TextStyle( - fontSize: 12.sp, - color: Theme.of(context).primaryColor), - )), - state.page == 'answerTrajectory' - ? Container( - height: 20.r, - width: 70.r, - decoration: BoxDecoration( - border: Border.all( - width: 1.r, - color: const Color(0xFFB2DA93)), - borderRadius: BorderRadius.all( - Radius.circular(20.r)), - ), - child: Center( - child: Text('详情', - style: TextStyle( - fontSize: 10.r, - color: Color(0xFFB2DA93))), - )) - : state.page == 'history' - ? Container( + body: Obx(() { + return EasyRefresh( + firstRefresh: false, + taskIndependence: true, + controller: logic.refreshController, + header: MaterialHeader(), + footer: TaurusFooter(), + onRefresh: () async { + logic.getList(); + }, + child: state.studentList.isNotEmpty + ? Utils.isPad() + ? GridView( + shrinkWrap: true, + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, + mainAxisSpacing: 0.r, + crossAxisSpacing: 0.r, + childAspectRatio: 556 / 90, + ), + children: + List.generate(state.studentList.length, (index) { + StudentItem item = state.studentList[index]; + return InkWell( + onTap: () { + // RouterManager.router.navigateTo(context, + // '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); + Get.toNamed(Routes.studentWorkDetailPage, + arguments: { + 'studentName': item.name, + 'studentId': item.id, + 'subject':state.subject, + }); + }, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(0.r)), + color: Colors.transparent, + border: Border(left: BorderSide(width: + (index + 1)%2 == 0? 1.r:0,color: const Color(0xFFA5A5A5)),bottom: BorderSide(width: 1.r,color: const Color(0xFFA5A5A5))) + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Text( + item.name, + style: TextStyle( + fontSize: 12.sp, + color: Theme.of(context).primaryColor), + )), + state.page == 'answerTrajectory' + ? Container( height: 20.r, width: 70.r, decoration: BoxDecoration( - color: - Theme.of(context).primaryColor, - borderRadius: - BorderRadius.all( - Radius.circular( - 20.r))), + border: Border.all( + width: 1.r, + color: const Color(0xFFB2DA93)), + borderRadius: BorderRadius.all( + Radius.circular(20.r)), + ), child: Center( - child: Text( - '历史作业', + child: Text('详情', style: TextStyle( fontSize: 10.r, - color: Colors.white), - )), - ) - : item.priorityAnnotate - ? InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, false); - EasyLoading.show( - status: 'loading...'); - }, - child: Container( - height: 20.r, - width: 80.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 4.r)), - color: const Color( - 0xFFEBE4FF), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Padding( - padding: - EdgeInsets.only( - left: 3.r), - child: Image.asset( - 'assets/images/youx_icon_active.png', - width: 14.r, - height: 14.r, - ), - ), - Padding( - padding: - EdgeInsets.only( - top: 2.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: Theme.of(context).primaryColor), - ), - ), - ], - ), + color: Color(0xFFB2DA93))), + )) + : state.page == 'history' + ? Container( + height: 20.r, + width: 70.r, + decoration: BoxDecoration( + color: + Theme.of(context).primaryColor, + borderRadius: + BorderRadius.all( + Radius.circular( + 20.r))), + child: Center( + child: Text( + '历史作业', + style: TextStyle( + fontSize: 10.r, + color: Colors.white), + )), + ) + : item.priorityAnnotate + ? InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, false); + EasyLoading.show( + status: 'loading...'); + }, + child: Container( + height: 20.r, + width: 80.r, + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular( + 4.r)), + color: const Color( + 0xFFEBE4FF), ), - ) - : InkWell( - onTap: () { - logic.setJobReadLevel( - item.id, true); - EasyLoading.show( - status: 'loading...'); - }, - child: Container( - height: 20.r, - width: 80.r, - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular( - 4.r)), - color: const Color( - 0xFFE1E1E1), - ), - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Padding( - padding: - EdgeInsets.only( - left: 3.r), - child: Image.asset( - 'assets/images/youx_icon_default.png', - width: 14.r, - height: 14.r, - ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + EdgeInsets.only( + left: 3.r), + child: Image.asset( + 'assets/images/youx_icon_active.png', + width: 14.r, + height: 14.r, ), - Padding( - padding: - EdgeInsets.only( - top: 2.r, - left: 4.r), - child: Text( - '优先批阅', - style: TextStyle( - fontSize: 10.sp, - color: const Color( - 0xFF8A9691)), - ), + ), + Padding( + padding: + EdgeInsets.only( + top: 2.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: Theme.of(context).primaryColor), ), - ], - ), + ), + ], ), ), - ], - ), + ) + : InkWell( + onTap: () { + logic.setJobReadLevel( + item.id, true); + EasyLoading.show( + status: 'loading...'); + }, + child: Container( + height: 20.r, + width: 80.r, + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular( + 4.r)), + color: const Color( + 0xFFE1E1E1), + ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Padding( + padding: + EdgeInsets.only( + left: 3.r), + child: Image.asset( + 'assets/images/youx_icon_default.png', + width: 14.r, + height: 14.r, + ), + ), + Padding( + padding: + EdgeInsets.only( + top: 2.r, + left: 4.r), + child: Text( + '优先批阅', + style: TextStyle( + fontSize: 10.sp, + color: const Color( + 0xFF8A9691)), + ), + ), + ], + ), + ), + ), + ], ), - ); - }), - ) - : ListView.builder( - itemBuilder: (context, index) { + ), + ); + }), + ) + : Padding( + padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), + child: ListView.builder( + itemBuilder: (context, index) { StudentItem item = state.studentList[index]; return InkWell( onTap: () { @@ -414,13 +417,13 @@ class _ClassStudentPageState extends State { ), ), ); - }, - itemCount: state.studentList.length, - ) - : const MyEmptyWidget(), - ); - }), - ), + }, + itemCount: state.studentList.length, + ), + ) + : const MyEmptyWidget(), + ); + }), ); } ); diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart index ce0d2fa..797bc81 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_logic.dart @@ -37,7 +37,14 @@ class StudentWorkDetailLogic extends GetxController with RequestToolMixin, GetSi ); StudentHistory data = await getClient().getStudentHistory(params); state.studentData.value = data; - for (var element in state.studentData.value.items.items) { + /* state.kgtLine.value = [{'id':0,'rate':0}]; + state.zgtLine.value = [{'id':0,'rate':0}]; + state.allLine.value = [{'id':0,'rate':0}];*/ + state.kgtLine.value = []; + state.zgtLine.value = []; + state.allLine.value = []; + for (var i = 0;i studentData = Rx(StudentHistory(0, 0, Items([], 0), 0)); late final int subject; + late RxList kgtLine = [].obs; + late RxList zgtLine = [].obs; + late RxList allLine = [].obs; } diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart index f35531f..dfd5863 100644 --- a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/student_work_detail_view.dart @@ -1,3 +1,4 @@ +import 'package:fl_chart/fl_chart.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; @@ -9,6 +10,7 @@ import 'package:making_school_asignment_app/common/utils/utils.dart'; import 'package:making_school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart'; import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/job_condition_filter.dart'; +import 'package:making_school_asignment_app/page/home_page/children/student_work_detail/widget/line_chart.dart'; import 'package:making_school_asignment_app/page/home_page/widget/progress_bar.dart'; import 'package:making_school_asignment_app/routes/app_pages.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart'; @@ -124,16 +126,22 @@ class _StudentWorkDetailPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + /* Text( '总览:', style: TextStyle( fontSize: 12.sp, color: Theme.of(context).primaryColor, fontWeight: FontWeight.w600), + ),*/ + SizedBox(height: 10.r,), + SizedBox( + height: 200.r, + child: LineChartCon(isShowingMainData: true,lineNum: 3,line1:state.kgtLine.value,line2: state.zgtLine.value,line3: state.allLine.value,), ), + SizedBox(height: 20.r,), ProgressBar( title: '客观题正确率:', - color:Theme.of(context).primaryColor, + color:const Color(0xFF4DE6BF), percent: state.studentData.value.kgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), @@ -145,7 +153,7 @@ class _StudentWorkDetailPageState extends State { marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '总正确率:', - color: Theme.of(context).primaryColor, + color: const Color(0xFF1890FF), percent: state.studentData.value.correctRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), @@ -153,6 +161,7 @@ class _StudentWorkDetailPageState extends State { ), ); }), + Obx(() { return JobConditionFilter( controller: logic.tabController, @@ -221,8 +230,8 @@ class _StudentWorkDetailPageState extends State { height: 10.r, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFF4CC793), - border: Border.all(width: 1.r, color: Theme.of(context).primaryColor), + color: const Color(0xFF00B386), + border: Border.all(width: 1.r, color: const Color(0xFF00B386)), ), ), SizedBox( @@ -240,8 +249,8 @@ class _StudentWorkDetailPageState extends State { height: 10.r, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(5.r)), - // color: Color(0xFFFF7474), - border: Border.all(width: 1.r, color: Color(0xFFFF7474)), + color: const Color(0xFFCB191B), + border: Border.all(width: 1.r, color: const Color(0xFFCB191B)), ), ), SizedBox( @@ -422,7 +431,7 @@ class _StudentWorkDetailPageState extends State { '客:', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), SizedBox( width: 5.r, @@ -444,16 +453,18 @@ class _StudentWorkDetailPageState extends State { width: 25.r, height: 25.r, decoration: BoxDecoration( - color: Colors.transparent, + color: subjective.state == 3 + ?const Color(0xFF00B386):subjective.state == 2 + ? const Color(0xFFCB191B):Colors.transparent, border: Border.all( width: 1.r, color: subjective.state == 0 - ? Color(0xFFDDDDDD) + ? const Color(0xFFDDDDDD) : subjective.state == 3 - ?Theme.of(context).primaryColor + ?const Color(0xFF00B386) : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), + ? const Color(0xFFCB191B) + : const Color(0xFF666666)), borderRadius: BorderRadius.all(Radius.circular(12.5.r))), child: Center( child: Text( @@ -464,16 +475,15 @@ class _StudentWorkDetailPageState extends State { color: subjective .state == 0 - ? Color( + ? const Color( 0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? Colors.white : subjective.state == 2 - ? Color( - 0xFFFF7474) - : Color( + ?Colors.white + : const Color( 0xFF666666)), )), ); @@ -484,7 +494,7 @@ class _StudentWorkDetailPageState extends State { '无', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), ], ), @@ -499,7 +509,7 @@ class _StudentWorkDetailPageState extends State { '主:', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), SizedBox( width: 5.r, @@ -521,16 +531,18 @@ class _StudentWorkDetailPageState extends State { width: 25.r, height: 25.r, decoration: BoxDecoration( - color: Colors.transparent, + color: subjective.state == 3 + ? const Color(0xFF00B386):subjective.state == 2 + ? const Color(0xFFCB191B):Colors.transparent, border: Border.all( width: 1.r, color: subjective.state == 0 - ? Color(0xFFDDDDDD) + ? const Color(0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? const Color(0xFF00B386) : subjective.state == 2 - ? Color(0xFFFF7474) - : Color(0xFF666666)), + ? const Color(0xFFCB191B) + : const Color(0xFF666666)), borderRadius: BorderRadius.all(Radius.circular(12.5.r))), child: Center( child: Text( @@ -541,16 +553,15 @@ class _StudentWorkDetailPageState extends State { color: subjective .state == 0 - ? Color( + ? const Color( 0xFFDDDDDD) : subjective.state == 3 - ? Theme.of(context).primaryColor + ? Colors.white : subjective.state == 2 - ? Color( - 0xFFFF7474) - : Color( + ? Colors.white + : const Color( 0xFF666666)), )), ); @@ -561,25 +572,25 @@ class _StudentWorkDetailPageState extends State { '无', style: TextStyle( fontSize: 12.sp, - color: Color(0xFF5B5B5B)), + color: const Color(0xFF5B5B5B)), ), ], ), ProgressBar( title: '客观题正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.kgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '主观题正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.zgtCorrectRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), ProgressBar( title: '总正确率:', - color: Color(0xFFB2DA93), + color: const Color(0xFFB2DA93), percent: item.correctRate / 100, padingEdg: EdgeInsets.zero, marginEdg: EdgeInsets.only(top: 8.h)), diff --git a/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart new file mode 100644 index 0000000..588dbda --- /dev/null +++ b/making_school_asignment_app/lib/page/home_page/children/student_work_detail/widget/line_chart.dart @@ -0,0 +1,237 @@ +import 'dart:math'; + +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class LineChartCon extends StatefulWidget { + final bool isShowingMainData; + final int lineNum; + final List? line1; + final List? line2; + final List? line3; + + LineChartCon( + {required this.isShowingMainData, + required this.lineNum, + this.line1, + this.line2, + this.line3}); + + @override + State createState() => _LineChartConState(); +} + +class _LineChartConState extends State { + double maxX = 0.0; + + @override + void initState() { + super.initState(); + } + + getMaxX(){ + if (widget.lineNum > 2) { + if (widget.line3!.length > widget.line2!.length && + widget.line3!.length > widget.line1!.length) { + maxX = double.parse(widget.line3!.length.toString()); + } else if (widget.line2!.length > widget.line3!.length && + widget.line2!.length > widget.line1!.length) { + maxX = double.parse(widget.line2!.length.toString()); + } else { + maxX = double.parse(widget.line1!.length.toString()); + } + } else if (widget.lineNum > 1) { + + } + print('maxx=======$maxX'); + return maxX; + } + + @override + Widget build(BuildContext context) { + + return LineChart( + LineChartData( + lineTouchData: const LineTouchData(enabled: false), + gridData: gridData, + titlesData: titlesData1, + borderData: borderData, + lineBarsData: lineBarsData1, + minX: 1, + maxX: getMaxX()>0? getMaxX():3, + maxY: 6, + minY: 0, + ), + duration: const Duration(milliseconds: 250), + ); + } + + FlTitlesData get titlesData1 => FlTitlesData( + bottomTitles: AxisTitles( + sideTitles: bottomTitles, + ), + rightTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + topTitles: const AxisTitles( + sideTitles: SideTitles(showTitles: false), + ), + leftTitles: AxisTitles( + sideTitles: leftTitles(), + ), + ); + + List get lineBarsData1 => [ + lineChartBarData1_1, + lineChartBarData1_2, + lineChartBarData1_3, + ]; + + Widget leftTitleWidgets(double value, TitleMeta meta) { + String text; + switch (value.toInt()) { + case 0: + text = '0'; + break; + case 1: + text = '20%'; + break; + case 2: + text = '40%'; + break; + case 3: + text = '60%'; + break; + case 4: + text = '80%'; + break; + case 5: + text = '100%'; + break; + default: + return Container(); + } + + return Text(text, style: TextStyle(fontSize: 12.sp, color: const Color(0xFF070707)), textAlign: TextAlign.left); + + /* return SideTitleWidget( + axisSide: meta.axisSide, + child: Text( + '${value}', + style: TextStyle(fontSize: 12.sp, color: Color(0xFF070707)), + ), + );*/ + } + + SideTitles leftTitles() => SideTitles( + getTitlesWidget: leftTitleWidgets, + showTitles: true, + interval: 1, + reservedSize: 50, + ); + + Widget bottomTitleWidgets(double value, TitleMeta meta) { + return SideTitleWidget( + axisSide: meta.axisSide, + space: 10, + child: Text( + value.toString() == '0.0' ? '' : value.toStringAsFixed(0), + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 12.sp, + color: const Color.fromRGBO(39, 39, 39, 0.5), + ), + ), + ); + } + + SideTitles get bottomTitles => SideTitles( + showTitles: true, + reservedSize: 32, + interval: 1, + getTitlesWidget: bottomTitleWidgets, + ); + + FlGridData get gridData => const FlGridData( + show: true, drawVerticalLine: false, horizontalInterval: 1.0); + + FlBorderData get borderData => FlBorderData( + show: true, + border: const Border( + bottom: BorderSide(color: Colors.transparent, width: 1), + left: BorderSide(color: Colors.transparent), + right: BorderSide(color: Colors.transparent), + top: BorderSide(color: Colors.transparent), + ), + ); + + LineChartBarData get lineChartBarData1_1 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: const Color(0xFF4DE6BF), + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: List.generate(widget.line1!.length, (index){ + var element = widget.line1![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 0), + FlSpot(3, 1.5), + FlSpot(5, 1.4), + FlSpot(7, 3.4), + FlSpot(10, 2), + FlSpot(12, 2.2), + FlSpot(13, 1.8), + ],*/ + ); + + LineChartBarData get lineChartBarData1_2 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: Theme.of(context).primaryColor, + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData( + show: false, + color: Colors.yellow, + ), + spots: List.generate(widget.line2!.length, (index){ + var element = widget.line2![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 1), + FlSpot(3, 2.8), + FlSpot(7, 1.2), + FlSpot(10, 2.8), + FlSpot(12, 2.6), + FlSpot(13, 3.9), + ],*/ + ); + + LineChartBarData get lineChartBarData1_3 => LineChartBarData( + isCurved: true, + curveSmoothness: 0, + color: const Color(0xFF1890FF), + barWidth: 2, + isStrokeCapRound: true, + dotData: const FlDotData(show: false), + belowBarData: BarAreaData(show: false), + spots: List.generate(widget.line3!.length, (index){ + var element = widget.line3![index]; + return FlSpot(double.parse(element['id'].toString()), double.parse(element['rate'].toString())); + }) + /* const [ + FlSpot(1, 2.8), + FlSpot(3, 1.9), + FlSpot(6, 3), + FlSpot(10, 1.3), + FlSpot(13, 2.5), + ],*/ + ); +}