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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding Labels

Thread ID:

Created:

Updated:

Platform:

Replies:

148508 Oct 23,2019 05:48 AM UTC Oct 23,2019 09:52 AM UTC Flutter 1
loading
Tags: SfCartesianChart
Mayur B
Asked On October 23, 2019 05:48 AM UTC

How to add labels for the graph. Refer to the screenshot attached.



Thank you.

Dharanidharan Dharmasivam [Syncfusion]
Replied On October 23, 2019 09:52 AM UTC

Hi Mayur, 
 
Thanks for using Syncfusion Flutter chart widget. Your requirement can be achieved using the annotation feature. Using the annotation feature you can add the widgets on the chart. In the below code, we have added a text, and this can be modified based on your scenario. 
 
 
SfCartesianChart( 
                  annotations: <CartesianChartAnnotation>[ 
                    CartesianChartAnnotation( 
                        widget: Container( 
                            child: const Text('Annotation', 
                                style: TextStyle(fontSize: 18))), 
                        coordinateUnit: CoordinateUnit.point, 
                        region: AnnotationRegion.plotArea, 
                        // Here if your x-axis is rendered as category axis and coordinateUnit is point, then in the                           
                            x attribute you can either specify the index value of the point else directly specify the   
                             x value as below. 
                        x: 'Fri', 
                        y: 28), 
                  ], 
), 
 
 
 
For your convenience, we have prepared a sample and more information on the annotation feature find the user guide. 
 
Thanks, 
Dharani. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon