|
|
|
@ -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<int> 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<LineBarSpot> 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,
|
|
|
|
|
),
|
|
|
|
|