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

Add Line with label on y Axis

hello
I have read docs and samples about Cartesian charts I need to add a line to the chart with a label, the label should always be visible even if I scroll, you can check the attached file to understa


Attachment: chart_354f15e.rar

1 Reply

HK Hariharasudhan Kanagaraj Syncfusion Team March 17, 2023 02:28 PM UTC

Hi Mohammad ghawanmeh,


The requirement can be achieved by using the plotBands property in the primaryYAxis, its always visible in chart. We have used the plotBands property and set the start and end properties value to 28 as per the below code snippet. 


Code snippet:

primaryYAxis: NumericAxis(

......

            plotBands: [

              PlotBand(

                start: 28,

                end: 28,

                borderWidth: 2,

                borderColor: Colors.blue,

                dashArray: const [5, 5],

              ),

            ],

          ),


Kindly refer to the attached UG document regarding PlotBand for further information.

UG, https://help.syncfusion.com/flutter/cartesian-charts/axis-customization#plot-bands

Screenshot:


And we have attached a sample below for your reference. 


Thanks,

Hari Hara Sudhan. K


Attachment: 181189_5fc696e6.zip

Loader.
Up arrow icon