Skip to content

Gantt chart#756

Open
hannesa2 wants to merge 3 commits intomasterfrom
GanttChart
Open

Gantt chart#756
hannesa2 wants to merge 3 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 hannesa2 added don't merge Demo Just for demonstration labels Apr 3, 2026
@hannesa2
Copy link
Copy Markdown
Collaborator Author

hannesa2 commented Apr 3, 2026

@copilot

…rlay

- 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

Agent-Logs-Url: https://github.com/AppDevNext/AndroidChart/sessions/a790c59a-5a33-46f0-9ff9-81024453c605

Co-authored-by: hannesa2 <3314607+hannesa2@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

@copilot

Fixed in commit dbd1edf. 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.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.google.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED -Xmx4092M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@hannesa2
Copy link
Copy Markdown
Collaborator Author

hannesa2 commented Apr 3, 2026

Screenshot differs: emulatorApi=9 with 2 screenshot(s)

setpoint (old) | diff | actual screenshot (new)

StartTest_smokeTestStart-46-TimeIntervalChartActivity-Error.pngscreenshot

StartTest_smokeTestStart-46-TimeIntervalChartActivity-Timeinterval-1SampleClick.pngscreenshot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Demo Just for demonstration don't merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants