Hello,
I am currently using SfChart in a UWP application that display data, using a ColumnSerie for each day of the month.
I use ChartAdornmentInfo , to display the current value into the center of the corresponding column, rotated by 90 degrees.
When running on a mobile, it takes about 3 to 5 seconds to refresh the 30 columns, on desktop it runs really fast.
When I remove the AdornmentInfo, it runs faster on Mobile (the delay is acceptable).
So my question is : How can I speed up things? Or is there a way to hide the AdornmentInfo when on mobile (code behind or xaml) ? I tried to set the ShowLabel to false using an adaptive trigger but although the label does not display, it still tales time to render the chart.
Thank you a lot !
Here's the xaml :
<charts:SfChart Grid.Row="1"
Margin="0,10,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<charts:SfChart.PrimaryAxis>
<charts:DateTimeCategoryAxis x:Uid="Day"
LabelFormat="dd"
LabelsPosition="Outside"
Interval="2">
</charts:DateTimeCategoryAxis>
</charts:SfChart.PrimaryAxis>
<charts:SfChart.SecondaryAxis>
<charts:NumericalAxis Minimum="0"
Header="KW"
TickLineSize="10"/>
</charts:SfChart.SecondaryAxis>
<charts:ColumnSeries ItemsSource="{Binding DayPoints}"
Interior="{StaticResource SystemControlBackgroundAccentBrush}"
XBindingPath="Label"
YBindingPath="Value">
<charts:ColumnSeries.AdornmentsInfo>
<charts:ChartAdornmentInfo SegmentLabelContent="YValue"
ShowLabel="True"
HighlightOnSelection="True"
AdornmentsPosition="TopAndBottom" >
<charts:ChartAdornmentInfo.LabelTemplate>
<DataTemplate>
<!--LabelTemplate for Segments.A TextBlock inside each Segments-->
<TextBlock Foreground="White" FontSize="15" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" Text="{Binding}" RenderTransformOrigin="0.5,0.5">
<TextBlock.RenderTransform>
<RotateTransform Angle="-90"/>
</TextBlock.RenderTransform>
</TextBlock>
</DataTemplate>
</charts:ChartAdornmentInfo.LabelTemplate>
</charts:ChartAdornmentInfo>
</charts:ColumnSeries.AdornmentsInfo>
</charts:ColumnSeries>
</charts:SfChart>