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