getDetailsData method

LineChartData getDetailsData(
  1. ScienceAnalysis analysis,
  2. Color color
)

The package:fl_chart helper class for the details charts.

Implementation

LineChartData getDetailsData(ScienceAnalysis analysis, Color color) => LineChartData(
	lineBarsData: [
		LineChartBarData(
			spots: [
				for (final reading in analysis.data.readings)
					FlSpot(reading.time, reading.value),
			],
			color: color,
			preventCurveOverShooting: true,
			isCurved: true,
		),
	],
	titlesData: FlTitlesData(
		topTitles: const AxisTitles(),
		bottomTitles: AxisTitles(
			sideTitles: SideTitles(
				showTitles: true,
				getTitlesWidget: (double value, TitleMeta meta) => SideTitleWidget(
					axisSide: AxisSide.bottom,
					space: 3,
					child: Text(value.toStringAsFixed(0)),
				),
			),
		),
	),
	extraLinesData: ExtraLinesData(horizontalLines: [HorizontalLine(y: 0)], verticalLines: [VerticalLine(x: 0)]),
	minX: 0, minY: 0,
	clipData: const FlClipData.all(),
	lineTouchData: const LineTouchData(touchTooltipData: LineTouchTooltipData(fitInsideVertically: true, fitInsideHorizontally: true)),
);