From 147c53e1aef37e5053d85d7c863f5de9b367afe4 Mon Sep 17 00:00:00 2001 From: otbenjello Date: Thu, 21 Dec 2023 16:17:59 +0100 Subject: [PATCH] regle affichage --- .../mobile/mobile_bpm_and_speed_by_time.dart | 73 +------------------ .../graph/web/web_bpm_and_speed_by_time.dart | 70 +----------------- 2 files changed, 4 insertions(+), 139 deletions(-) diff --git a/lib/common_widget/graph/mobile/mobile_bpm_and_speed_by_time.dart b/lib/common_widget/graph/mobile/mobile_bpm_and_speed_by_time.dart index 60516e5..0181a86 100644 --- a/lib/common_widget/graph/mobile/mobile_bpm_and_speed_by_time.dart +++ b/lib/common_widget/graph/mobile/mobile_bpm_and_speed_by_time.dart @@ -36,75 +36,8 @@ class _MobileGraphBpmAndSpeedByTime width: double.maxFinite, child: LineChart( LineChartData( - showingTooltipIndicators: - widget.func.showingTooltipOnSpots.map((index) { - return ShowingTooltipIndicators([ - LineBarSpot( - widget.func.tooltipsOnBar, - widget.func.lineBarsData.indexOf(widget.func.tooltipsOnBar), - widget.func.tooltipsOnBar.spots[index], - ), - ]); - }).toList(), - lineTouchData: LineTouchData( - enabled: true, - handleBuiltInTouches: false, - touchCallback: (FlTouchEvent event, LineTouchResponse? response) { - if (response == null || response.lineBarSpots == null) { - return; - } - if (event is FlTapUpEvent) { - final spotIndex = response.lineBarSpots!.first.spotIndex; - widget.func.showingTooltipOnSpots.clear(); - setState(() { - widget.func.showingTooltipOnSpots.add(spotIndex); - }); - } - }, - mouseCursorResolver: - (FlTouchEvent event, LineTouchResponse? response) { - if (response == null || response.lineBarSpots == null) { - return SystemMouseCursors.basic; - } - return SystemMouseCursors.click; - }, - getTouchedSpotIndicator: - (LineChartBarData barData, List spotIndexes) { - return spotIndexes.map((index) { - return TouchedSpotIndicatorData( - const FlLine( - color: Colors.transparent, - ), - FlDotData( - show: true, - getDotPainter: (spot, percent, barData, index) => - FlDotCirclePainter( - radius: 3, - color: Colors.white, - strokeWidth: 3, - strokeColor: TColor.secondaryColor1, - ), - ), - ); - }).toList(); - }, - touchTooltipData: LineTouchTooltipData( - tooltipBgColor: TColor.secondaryColor1, - tooltipRoundedRadius: 20, - getTooltipItems: (List lineBarsSpot) { - return lineBarsSpot.map((lineBarSpot) { - return LineTooltipItem( - "Seconde ${lineBarSpot.x.toInt() / 10} ", - const TextStyle( - color: Colors.white, - fontSize: 10, - fontWeight: FontWeight.bold, - ), - ); - }).toList(); - }, - ), - ), + + lineBarsData: widget.func.lineBarsData1, minY: 0, maxY: 110, @@ -113,7 +46,7 @@ class _MobileGraphBpmAndSpeedByTime leftTitles: AxisTitles( sideTitles: widget.func.leftTitles, ), - topTitles: const AxisTitles(), + topTitles: const AxisTitles(), bottomTitles: AxisTitles( sideTitles: widget.func.bottomTitles, ), diff --git a/lib/common_widget/graph/web/web_bpm_and_speed_by_time.dart b/lib/common_widget/graph/web/web_bpm_and_speed_by_time.dart index ec8ad66..00d0ada 100644 --- a/lib/common_widget/graph/web/web_bpm_and_speed_by_time.dart +++ b/lib/common_widget/graph/web/web_bpm_and_speed_by_time.dart @@ -33,75 +33,7 @@ class _WebGraphBpmAndSpeedByTime extends State { width: widget.media.width * 0.35, child: LineChart( LineChartData( - showingTooltipIndicators: - widget.func.showingTooltipOnSpots.map((index) { - return ShowingTooltipIndicators([ - LineBarSpot( - widget.func.tooltipsOnBar, - widget.func.lineBarsData.indexOf(widget.func.tooltipsOnBar), - widget.func.tooltipsOnBar.spots[index], - ), - ]); - }).toList(), - lineTouchData: LineTouchData( - enabled: true, - handleBuiltInTouches: false, - touchCallback: (FlTouchEvent event, LineTouchResponse? response) { - if (response == null || response.lineBarSpots == null) { - return; - } - if (event is FlTapUpEvent) { - final spotIndex = response.lineBarSpots!.first.spotIndex; - widget.func.showingTooltipOnSpots.clear(); - setState(() { - widget.func.showingTooltipOnSpots.add(spotIndex); - }); - } - }, - mouseCursorResolver: - (FlTouchEvent event, LineTouchResponse? response) { - if (response == null || response.lineBarSpots == null) { - return SystemMouseCursors.basic; - } - return SystemMouseCursors.click; - }, - getTouchedSpotIndicator: - (LineChartBarData barData, List spotIndexes) { - return spotIndexes.map((index) { - return TouchedSpotIndicatorData( - const FlLine( - color: Colors.transparent, - ), - FlDotData( - show: true, - getDotPainter: (spot, percent, barData, index) => - FlDotCirclePainter( - radius: 3, - color: Colors.white, - strokeWidth: 3, - strokeColor: TColor.secondaryColor1, - ), - ), - ); - }).toList(); - }, - touchTooltipData: LineTouchTooltipData( - tooltipBgColor: TColor.secondaryColor1, - tooltipRoundedRadius: 20, - getTooltipItems: (List lineBarsSpot) { - return lineBarsSpot.map((lineBarSpot) { - return LineTooltipItem( - "Seconde ${lineBarSpot.x.toInt() / 10} ", - const TextStyle( - color: Colors.white, - fontSize: 10, - fontWeight: FontWeight.bold, - ), - ); - }).toList(); - }, - ), - ), + lineBarsData: widget.func.lineBarsData1, minY: -10, maxY: 110,