GraphView overlapping titles #1

Open
opened 2025-01-28 22:42:11 +01:00 by marco · 0 comments
Owner

In the FloodStation Graph the timestamps are overlapping for small screens.
image.png

This can be fixed by setting a dynamic interval in ReadingGraph.getBottomTitles

AxisTitles getBottomTitles(List<FlSpot> spots) {
    return AxisTitles(
      sideTitles: SideTitles(
        interval: 90, // change this to a dynamic value
        reservedSize: 40,
        showTitles: true,
        maxIncluded: false,
        minIncluded: false,
        getTitlesWidget: (value, meta) => SideTitleWidget(
          meta: meta,
          child: Text(getDate(value)),
        ),
      ),
    );
  }
In the FloodStation Graph the timestamps are overlapping for small screens. ![image.png](/attachments/27aa37b4-2c4b-45d9-a898-9342fd3e43ba) This can be fixed by setting a dynamic interval in ReadingGraph.getBottomTitles ```dart AxisTitles getBottomTitles(List<FlSpot> spots) { return AxisTitles( sideTitles: SideTitles( interval: 90, // change this to a dynamic value reservedSize: 40, showTitles: true, maxIncluded: false, minIncluded: false, getTitlesWidget: (value, meta) => SideTitleWidget( meta: meta, child: Text(getDate(value)), ), ), ); } ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marco/floodwatch#1