OnTap method or add inkwell to DateTimeMultiLevelLabel

I want to be able to click the a DateTimeMultiLevelLabel i have to be able to zoom into that section of data. Please see the image i provided. Is it possible to add an inkwell to this label since there is no direct support for ontap callback?


You can see the dates on the bottom there on the x axis '6/2   6/3' etc. I want to click on one of those to zoom into the data for that section. Thanks


Attachment: example_2dab3b4b.zip

7 Replies

LP Lokesh Palani Syncfusion Team June 7, 2023 05:24 PM UTC

Hi Jesse,


We have checked your query and we will update the further details in one business day on 08 June 2023.


Regards,

Lokesh.



JE Jesse replied to Lokesh Palani June 12, 2023 05:25 PM UTC

Hello you guys never got back to me????



LP Lokesh Palani Syncfusion Team June 12, 2023 07:38 PM UTC

Hi Jesse,


To achieve your requirement, you can use the GestureDetector widget and the zoomPosition property in the SfCartesianChart. Here's a step-by-step breakdown of the process:


  • Use the GestureDetector widget to detect taps on the multiLevelLabels of the chart. You can do this by using the onTapUp property of the GestureDetector.

  • Once a tap is detected, retrieve the tapped position in terms of the multiLevelLabels. You can convert this value to the corresponding point on the chart using the PixelToPoint function.

  • Extract the x and y positions from the converted value. You can use the x position to determine the range on the axis.

  • Next, check if the tapped value falls within the range of the AxisLabels. If it does, retrieve the start and end values of that range.

  • Assign the start and end range values to the zoomPosition property in the Axis. This will display the chart with the selected start and end range.


By following these steps, you can achieve the desired functionality of displaying the chart based on the tapped start and end range values. If you need further clarification or assistance, please let us know, and we can provide you with a sample implementation.


Regards,

Lokesh.






JE Jesse June 13, 2023 05:29 PM UTC

I cant just wrap in like that. It wont accept it. Please provide a sample code. thank you


Attachment: sample_2d07027d.zip


LP Lokesh Palani Syncfusion Team June 16, 2023 06:33 PM UTC

Hi Jesse,


You can achieve your requirement by using the GestureDetector widget. In the GestureDetector widget, we have used the onTapUp property to obtain the Axis size. Next, we converted it into PointToPixel to check if the tapped position is within the NumericMultiLevelLabel. Then, we have set the tapped position in the VisibleMinimum and VisibleMaximum to zoom the tapped position. We have provided a sample and user guide documentation for your reference which you can modify based on your use case. Please let us know if you require any further assistance.


UG,

https://help.syncfusion.com/flutter/cartesian-charts/methods#pixeltopoint

https://help.syncfusion.com/flutter/cartesian-charts/methods#pointtopixel


Regards,

Lokesh.


Attachment: chart_182778_e5ec4c64.zip


JE Jesse June 21, 2023 03:43 PM UTC

This is an absolutely awful way of doing this. Id like to request an offical ontap event for the  NumericMultiLevelLabel . I dont want to warp my entire widget and point it towards the areas of the labels. With screen resizing and such its going to be a mess and buggy. Please feature request this. THank y



LP Lokesh Palani Syncfusion Team June 22, 2023 12:19 PM UTC

Hi Jesse,


We would like to inform you that we currently do not have support for touch interaction for axis multi-level labels. However, we have considered your request as a new feature and have logged it in our feedback portal.


We will prioritize the features of every release based on demand and priority. So, this feature will be available in any of our upcoming releases. You can also track the status of the feature with the feedback below.


FR, https://www.syncfusion.com/feedback/44691/provide-touch-interaction-support-for-axis-multi-level-labels


Regards,

Lokesh.


Loader.
Up arrow icon