We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Render annotation

Hi,

I would like to render the annotation's position.

Is it possible to wrap only the CartesianChartAnnotation with stream builder/ Storeconnector(Flutter redux/ bloc builder (Bloc) ?


Thanks.



6 Replies

YG Yuvaraj Gajaraj Syncfusion Team March 29, 2023 05:20 PM UTC

Hi Bar,


We suspect that you have tried to update the annotation with the help of StreamBuilder, for this you can set the StreamBuilder to the widget property in CartesianChartAnnotation and then get the value from stream and return the value to the Text widget. We have shared the sample below for your reference.


If this is not your query then please share more details regarding your requirement along with the screenshot or screen recordings this will be more helpful to us to assist you in a better way.


Regards,

Yuvaraj.


Attachment: f181442_4710bdf4.zip


BI Bar Ilan March 30, 2023 08:07 AM UTC

Thanks for your response,

I need to set position also from the stream builder how can i do it?



YG Yuvaraj Gajaraj Syncfusion Team March 31, 2023 10:51 AM UTC

Hi Bar,


For updating the annotation position from the StreamBuilder value, you need to wrap the whole chart into the StreamBuilder and give the position to the annotation directly.  Otherwise, you can't be able to update the annotation position or wrap the CartesianChartAnnotation inside the StreamBuilder are not a possible way to achieve your requirement.


If you have any further queries please get back to us.


Regards,

Yuvaraj.



BI Bar Ilan April 2, 2023 01:42 PM UTC

The problem is that i don't want to rebuild all the chart



YG Yuvaraj Gajaraj Syncfusion Team April 3, 2023 02:07 PM UTC

Hi Bar,


We are validating your query at our end and we will update further details tomorrow. We appreciate your patience until then.


Regards,

Yuvaraj.



YG Yuvaraj Gajaraj Syncfusion Team April 4, 2023 03:03 PM UTC

Hi Bar,


We have prepared the sample to update a custom annotation with the value get from the stream builder by wrapping the chart and custom annotation widget inside the chart. Then use the pointToPixel method and get the pixel position and positioned the customer annotation with the help of Positioned widget. We have prepared the sample and shared it below for your reference.


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


Regards,

Yuvaraj.


Attachment: f181442_3db92662.zip

Loader.
Live Chat Icon For mobile
Up arrow icon