Skip to content

Gantt chart#756

Merged
hannesa2 merged 5 commits intomasterfrom
GanttChart
Apr 13, 2026
Merged

Gantt chart#756
hannesa2 merged 5 commits intomasterfrom
GanttChart

Conversation

@hannesa2
Copy link
Copy Markdown
Collaborator

@hannesa2 hannesa2 commented Apr 3, 2026

It doesn't respect given space, even the labels are not good

Fixes

  • Label clipping: chartLeft is now computed dynamically by measuring the widest task label, so long names like "Development" are never clipped by the view edge
  • Cramped x-axis labels: Grid-line count is derived from available width divided by label width (clamped between 2 and 10) instead of a hardcoded 10, preventing overlap at any screen size
  • Seekbar overlay: Removed unused SeekBar and TextView widgets from the layout that were rendering on top of the chart (visible as stray dots in the screenshot)

@hannesa2
Copy link
Copy Markdown
Collaborator Author

hannesa2 commented Apr 3, 2026

@copilot

Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

Three issues were addressed:

  1. Labels cut offchartLeft is now computed dynamically by measuring the widest task label with the same Paint settings used for drawing, so "Development" and other long names always fit.
  2. Cramped x-axis labels — grid-line count is now derived from availableWidth / labelWidth (clamped between 2 and 10) instead of a hardcoded 10, preventing overlap at any screen width.
  3. Seekbar dots overlapping the chart — removed the unused SeekBar and TextView widgets from the layout (they weren't connected to any chart behaviour) and dropped the OnSeekBarChangeListener from the activity.

@hannesa2 hannesa2 force-pushed the GanttChart branch 6 times, most recently from b3f7c5e to ad3cadc Compare April 12, 2026 17:08
Inspired by PhilJay/MPAndroidChart#5519

Fix Gantt chart label clipping, x-axis label overlap, and seekbar overlay

- GanttChart.kt: dynamically compute chartLeft from max label width so
  long names like 'Development' are never clipped by the view edge
- GanttChart.kt: compute grid-line count from available width / label
  width so x-axis time labels never overlap each other
- GanttChart.kt: extract labelTextSize, gridLinesMin/Max as constants so
  measurement paint and drawing paint are always in sync
- activity_time_interval_chart.xml: remove unused SeekBar widgets and
  TextViews that were rendering on top of the chart
- TimeIntervalChartActivity.kt: remove OnSeekBarChangeListener interface
  and its unused override methods
@hannesa2 hannesa2 force-pushed the GanttChart branch 3 times, most recently from afa4355 to a83de5d Compare April 13, 2026 05:33
@hannesa2 hannesa2 merged commit a2e2652 into master Apr 13, 2026
4 checks passed
@hannesa2 hannesa2 deleted the GanttChart branch April 13, 2026 08:03
@hannesa2 hannesa2 added the enhancement New feature or request label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Demo Just for demonstration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants