Skip to content

Flag to position labels at the beginning of each interval #2369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DrNiels
Copy link

@DrNiels DrNiels commented Jun 4, 2025

As an alternative to the dynamic placing of labels for DateTimeIntervalType.months and DateTimeIntervalType.years, the flag labelsAtBeginning can be set to true for DateTimeAxis to force the label position to the beginning of each month or year, respectively. Lower interval types already place the labels at the beginning of the corresponding intervals, so they are not affected by the flag. Similarly, auto is not based on any interval, so there's no effect as well.

See the difference in the video:

labelsAtBeginning.mp4

The upper charts show the updated behavior with the flag set while the lower charts show the legacy behavior without the flag set. The example is available here: https://github.com/DrNiels/flutter-widgets/blob/example/fixed-axis-ticks/packages/syncfusion_flutter_charts/example/lib/main.dart

I tried my best, but I'm still foreign to your personal coding practices, so feel free to remark anything and I will adjust the code accordingly.

In response to the feature request: https://www.syncfusion.com/feedback/36499/instead-of-recalculating-the-axis-labels-keep-them-stable-on-panning
And the issue: #2130

…ould be placed dynamically or at the beginning of each interval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants