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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Question about ChartAdornmentInfo SymbolTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

126188 Sep 29,2016 12:03 PM UTC Sep 30,2016 01:21 PM UTC UWP 1
loading
Tags: SfChart
Geoffrey
Asked On September 29, 2016 12:03 PM UTC

Hello,

I try to migrate my Telerik chart to Syncfusion in order to just use Syncfusion as library and I have some problems

I attached two files :
- Current.png - Syncfusion actual rendering
- Wanted.png - Telerik actual rendering

My problems :
- How to set the SymbolTemplate Width the same with as the ColumnSegment
- How to bind SymbolTemplate to ColumSegment DataContext
- How to add centered label to the colum segment ?



My code is :

<charts:SfChart Width="{x:Bind ViewModel.ChartWidth, Mode=OneWay}" AreaBorderThickness="0">
                        <charts:SfChart.SecondaryAxis>
                            <charts:NumericalAxis Visibility="Collapsed" ShowGridLines="False" />
                        </charts:SfChart.SecondaryAxis>
                        <charts:SfChart.PrimaryAxis>
                            <charts:CategoryAxis Visibility="Collapsed" ShowGridLines="False" />
                        </charts:SfChart.PrimaryAxis>
                        <charts:SfChart.Series>
                            <charts:ColumnSeries EnableAnimation="True" XBindingPath="Name" YBindingPath="Difference" ItemsSource="{x:Bind ViewModel.ChartParticipants, Mode=OneWay}">
                                <charts:ColumnSeries.CustomTemplate>
                                    <DataTemplate x:DataType="charts:ColumnSegment">
                                        <Canvas>
                                            <Rectangle Canvas.Left="{x:Bind RectX, Mode=OneWay}" Canvas.Top="{x:Bind RectY, Mode=OneWay}" Height="{x:Bind Height, Mode=OneWay}" Width="{x:Bind Width, Mode=OneWay}" Stretch="Fill" Fill="{x:Bind Item, Converter={StaticResource ParticipantToBrushConverter}}" />
                                        </Canvas>
                                    </DataTemplate>
                                </charts:ColumnSeries.CustomTemplate>
                                <charts:ColumnSeries.AdornmentsInfo>
                                    <charts:ChartAdornmentInfo AdornmentsPosition="Top" ShowLabel="True" ShowMarker="True" LabelPosition="Center" SegmentLabelContent="YValue">
                                        <charts:ChartAdornmentInfo.SymbolTemplate>
                                            <DataTemplate x:DataType="charts:ChartAdornmentInfo">
                                                <controls:ParticipantImage HasImage="False" Initial="GT" Height="{x:Bind  SymbolWidth, Mode=OneWay}" Width="{x:Bind SymbolWidth, Mode=OneWay}" />
                                            </DataTemplate>
                                        </charts:ChartAdornmentInfo.SymbolTemplate>
                                    </charts:ChartAdornmentInfo>
                                </charts:ColumnSeries.AdornmentsInfo>
                            </charts:ColumnSeries>
                        </charts:SfChart.Series>
                       
                    </charts:SfChart>

Thanks in advance,
Geoffrey

Attachment: Desktop_3be4e67f.zip

Devi Aruna Maharasi Murugan [Syncfusion]
Replied On September 30, 2016 01:21 PM UTC

Hi Geoffery, 
  
Thanks for contacting Syncfusion Support. 
  
By default, the chart adornment symbol will render within the segment area. However, we have achieved your requirement by using the scatter series. 
  
We have prepared a demo sample for your reference and it can be downloaded from below link, 
  
  
Regards, 
Devi 




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.

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

;