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
@natrayansf
Copy link

Hi ilham89,

Thank you so much for your interest in enhancing the Syncfusion Flutter Charts and for taking the time to submit a pull request. We genuinely value and appreciate your enthusiasm and efforts to contribute to our Flutter chart. Your willingness to improve our components is truly commendable.

However, I must clarify that, at this time, Syncfusion does not encourage external contributions to our source code for certain components, including our Flutter Charts. We truly appreciate the effort you’ve put into this contribution. While we’re unable to merge the changes directly, your suggestions are valuable so if we plan to introduce similar functionality in the future, your input will help guide our implementation process.

In the meantime, we’d like to share a helpful resource that allows you to achieve similar functionality through customization. Please refer to the following Knowledge Base article:

How to customize the trackball in Flutter CartesianChart?

This article demonstrates how to implement a custom TrackballBehavior, which can be tailored to meet specific UI requirements such as centering tooltips on the track line.

Thank you again for your contribution and understanding.

Regards,

Natrayan

@VijayakumarMariappan VijayakumarMariappan added waiting for customer response Cannot make further progress until the customer responds. uncertain Uncertain feature feature New feature and removed open Open labels Oct 16, 2025
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 uncertain Uncertain feature waiting for customer response Cannot make further progress until the customer responds.

3 participants