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

Vertical line annotation text issue and move issue

Thread ID:

Created:

Updated:

Platform:

Replies:

144808 May 23,2019 03:56 PM UTC May 31,2019 12:18 PM UTC WPF 3
loading
Tags: Chart
Akshay Joglekar
Asked On May 23, 2019 03:56 PM UTC

Hi, 

I am using vertical line annotation in chart. But If I click on the line drawn and drag the mouse then line moves along with mouse on graph. Is there any way to stop this line moving from its original place?

Also I am assigning some text to vertical line annotation with text allignment set to 'Right'. I am using 5 different vertical line annotations with different text but same settings else where. But the distance between line and text is different for different text. How can I control that distance between text and Line.

Muneesh Kumar G [Syncfusion]
Replied On May 27, 2019 11:10 AM UTC

Hi Akshay, 
 
Thanks for using Syncfusion products. Please find the details below.  

 
Query 1: Is there any way to stop this line moving from its original place? 
 
You can achieve this by setting CanDrag as false in annotation as per the below code snippet.  
 
Code snippet 
<chart:SfChart.Annotations> 
                <chart:VerticalLineAnnotation X1="1" Text="Annotation " CanDrag="False" 
                                              HorizontalTextAlignment="Right" /> 
.. 
 
 
 
Query 2: Also, I am assigning some text to vertical line annotation with text allignment set to 'Right'. I am using 5 different vertical line annotations with different text but same settings else where. But the distance between line and text is different for different text. How can I control that distance between text and Line. 
 
We have checked the reported scenario with our sample, it works fine. Please check the sample from the following location.  
 
 
Screenshot:  
 
 
If you still face any problem, can you revert us by modifying the attached sample based on your application scenario, this will help us to provide you a better solution at the earliest.  

Regards,
Muneesh Kumar G.
 


Akshay Joglekar
Replied On May 30, 2019 02:10 PM UTC

Thank you so much for your help!!

I will try your given solution and get back to you with the results. Just One question 

"Is there any way to set position of the text of Vertical annotation at the bottom of graph?"

Muneesh Kumar G [Syncfusion]
Replied On May 31, 2019 12:18 PM UTC

Hi Akshay, 
 
Thanks for your update, we have analyzed your requirement and you can achieve this by setting ContentTemplate for annotation and setting Margin for text element as per the below code snippet.  
 
Code snippet 
 
  <chart:SfChart.Annotations> 
                <chart:VerticalLineAnnotation X1="1" CanDrag="False" > 
                    <chart:VerticalLineAnnotation.ContentTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="Annotation" Margin="-200,0,0,0"/> 
                        </DataTemplate> 
                    </chart:VerticalLineAnnotation.ContentTemplate> 
                </chart:VerticalLineAnnotation> 
                <chart:VerticalLineAnnotation X1="2" CanDrag="False"   > 
                    <chart:VerticalLineAnnotation.ContentTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="Annotation Text" Margin="-200,0,0,0"/> 
                        </DataTemplate> 
                    </chart:VerticalLineAnnotation.ContentTemplate> 
                </chart:VerticalLineAnnotation> 
                <chart:VerticalLineAnnotation X1="3" CanDrag="False" > 
                    <chart:VerticalLineAnnotation.ContentTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="Annotation Text Text" Margin="-200,0,0,0"/> 
                        </DataTemplate> 
                    </chart:VerticalLineAnnotation.ContentTemplate> 
                </chart:VerticalLineAnnotation> 
                <chart:VerticalLineAnnotation X1="4" CanDrag="False"   > 
                    <chart:VerticalLineAnnotation.ContentTemplate> 
                        <DataTemplate> 
                            <TextBlock Text="Text" Margin="-200,0,0,0"/> 
                        </DataTemplate> 
                    </chart:VerticalLineAnnotation.ContentTemplate> 
                </chart:VerticalLineAnnotation> 
            </chart:SfChart.Annotations> 
 
Screenshot:  
 
 
 
Regards, 
Muneesh Kumar G. 


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