Skip to content

Conversation

ilham89
Copy link

@ilham89 ilham89 commented Oct 6, 2025

This pull request introduces a new feature to the Syncfusion Flutter Charts trackball behavior, allowing tooltips to be centered on the track line for improved UI flexibility. It also refines tooltip placement logic and ensures correct rendering of tooltip shapes and pointers when this new mode is enabled.

New Feature: Centered Tooltip on Track Line

  • Added a centerTooltipOnTrackLine boolean property to the TrackballBehavior class, allowing tooltips to be horizontally centered on the vertical track line (or vertically centered on the horizontal track line for transposed charts). When enabled, the tooltip is dynamically positioned above or below (or left/right for transposed charts) the selected point based on available space. [1] [2]

Tooltip Placement and Rendering Improvements

  • Updated tooltip positioning logic to support the new centering option, including fallback placement when there is not enough space to center the tooltip. This logic is applied both in normal and transposed chart orientations. [1] [2]
  • Enhanced the logic for drawing tooltip shapes: the tooltip's pointer ("nose") is now only drawn if both arrowLength and arrowWidth are greater than zero, ensuring correct rendering in all cases. [1] [2]
  • Modified the tooltip pointer ("nose") direction calculation so that, when the centering mode is enabled, the pointer is drawn on the side of the tooltip closest to the selected data point, improving visual clarity. [1] [2]
  • Minor code organization: closed a class definition that was previously left open.

@VijayakumarMariappan VijayakumarMariappan added charts Charts component open Open labels Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
charts Charts component open Open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants