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
Hi Jesse,
We have checked your query and we will update the further details in one business day on 08 June 2023.
Regards,
Lokesh.
Hello you guys never got back to me????
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.
I cant just wrap in like that. It wont accept it. Please provide a sample code. thank you
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.
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
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.
Regards,
Lokesh.