Create Adornment for only one Axis

Hello! Ineed to print Adornment for only one Axis, like this -> Sample

Try this :

   <chart:SplineSeries Name="MaxStroke" Opacity="1"  StrokeThickness="3.6" Interior="Red"
                ItemsSource="{Binding ChartPlpanMax}" XBindingPath="Name" YBindingPath="Value">
                <chart:SplineSeries.AdornmentsInfo>
                    <chart:ChartAdornmentInfo Symbol="Ellipse" SymbolInterior="Red" SymbolStroke="Wheat" SymbolHeight="12" SymbolWidth="12">
                    </chart:ChartAdornmentInfo>
                </chart:SplineSeries.AdornmentsInfo>
            </chart:SplineSeries>

Result -> MySample

As you can see, adornments was sets on all axes. How can I set it in only One ?

3 Replies

DS Durgadevi Selvaraj Syncfusion Team December 26, 2017 10:54 AM UTC

Hi Sergei, 
 
Thanks for contacting Syncfusion Support. 
 
We have analyzed your requirement(displaying adornment for only one data point) and this can be possible with the help of SymbolTemplate of chart adornment. Using converter to the symbol template, we can collapse the other adornments visibility and can display only required index adornment. Please refer the below codes, 
Code Snippet[XAML] 
<Grid.Resources> 
       <local:AdonrnmentConverter x:Key="adorn"/> 
</Grid.Resources> 
 
<chart:SplineSeries Opacity="1"  StrokeThickness="3.6" Interior="Red" ItemsSource="{Binding Collection}" XBindingPath="XValue" YBindingPath="YValue3"> 
                 
    <chart:SplineSeries.AdornmentsInfo> 
         <chart:ChartAdornmentInfo  > 
                        <chart:ChartAdornmentInfo.SymbolTemplate> 
                            <DataTemplate> 
                                <Ellipse Visibility="{Binding Converter={StaticResource adorn}}" Height="12" Width="12" Stroke="White" Fill="{Binding Interior}"/> 
                            </DataTemplate> 
                        </chart:ChartAdornmentInfo.SymbolTemplate> 
          </chart:ChartAdornmentInfo> 
    </chart:SplineSeries.AdornmentsInfo> 
</chart:SplineSeries> 
 
Code Snippet[C#] 
public class AdonrnmentConverter : IValueConverter 
{ 
   public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 
   { 
            var adonr = value as ChartAdornment; 
            if (adonr.XData == 4) 
                return Visibility.Visible; 
            else 
                return Visibility.Collapsed; 
   } 
 
} 
 
 
Please find the output screenshot, 
 
We have prepared a sample based on this requirement and it can be downloaded from below link, 
 
You can refer our UG documentation link to know more about chart Adornments, 
 
Please let us know if you have any concern. 
 
 
Regards,  
Durgadevi S 



SE Sergei December 27, 2017 09:40 AM UTC

That is exactly what I need! Thanks!


DS Durgadevi Selvaraj Syncfusion Team January 2, 2018 03:46 AM UTC

Hi Sergei, 
 
Thanks for the update. 
 
Please let us know if you required any further assistance on this. 
 
Thanks, 
Durgadevi S 


Loader.
Up arrow icon