How can I dynamically update vertical striplines in chart (numerical axis)?

Hi I am updating a line chart dynamically and would like to do the same with a collection of striplines. Is there any way to achieve this? Thank you

1 Reply 1 reply marked as answer

SJ Suyamburaja Jayakumar Syncfusion Team November 20, 2020 11:54 AM UTC

Hi Yannick, 
 
Greetings from Syncfusion.  
 
We would like to let you know that your requirement has been achieved by using the NumericalStripLineCollection and add to the axis  StripLine. Please refer the below code snippet, 
 
XAML: 
<chart:SfChart x:Name="Chart" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"> 
. . . . . 
        </chart:SfChart> 
 
C#: 
NumericalStripLineCollection numericalStripLines = new NumericalStripLineCollection(); 
 
            numericalStripLines.Add(new NumericalStripLine 
            { 
                Start = 10, 
                Width = 3, 
                Text = "Loss", 
                FillColor = Color.Green 
            }); 
  . . . .  
            secondaryAxis.StripLines = numericalStripLines; 
 
 
More Information please refer the below UG link, 
 
Regards, 
Suyamburaja J. 


Marked as answer
Loader.
Up arrow icon