This is a migrated thread and some comments may be shown as answers.

[Solved] Doughnut chart problem in NavigationCacheMode.Required

1 Answer 176 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bartlomiej
Top achievements
Rank 1
Bartlomiej asked on 11 Apr 2013, 06:49 AM
Hello!

It seems like there is a problem with selection or SegmentStyleSelector when a page has NavigationCacheMode set to Required or Enabled.
I have created a doughnut series as it is shown bellow.

<Chart:RadPieChart Width="400" Height="400" x:Name="chart"
                                               HorizontalContentAlignment="Stretch" VerticalContentAlignment="Top"
                                               Foreground="{Binding CurrentSkinKey, ConverterParameter=Foreground, Converter={StaticResource CvtSkin}, Source={StaticResource skinManager}}"
                                               FontSize="{StaticResource AppFontSizeLarge}">
                                <Chart:DoughnutSeries HighlightBrush="{x:Null}" InnerRadiusFactor="0.75"
                                                      RadiusFactor="0.7" AllowSelect="True" x:Name="rating" ItemsSource="{Binding Items}"
                                                      SegmentStyleSelector="{Binding ItemsStyleSelector}" SelectedPointOffset="0.00000001">
                                    <Chart:DoughnutSeries.ValueBinding>
                                        <Chart:PropertyNameDataPointBinding PropertyName="Value" />
                                    </Chart:DoughnutSeries.ValueBinding>
                                    <Chart:DoughnutSeries.LabelDefinitions>
                                        <Chart:ChartSeriesLabelDefinition Margin="-15"
                                                                          TemplateSelector="{StaticResource LabelStyleSelector}">
                                            <Chart:ChartSeriesLabelDefinition.Binding>
                                                <Chart:PropertyNameDataPointBinding PropertyName="Label" />
                                            </Chart:ChartSeriesLabelDefinition.Binding>
                                        </Chart:ChartSeriesLabelDefinition>
                                    </Chart:DoughnutSeries.LabelDefinitions>
                                    <Chart:DoughnutSeries.IsSelectedBinding>
                                        <Chart:PropertyNameDataPointBinding PropertyName="IsSelected" />
                                    </Chart:DoughnutSeries.IsSelectedBinding>
                                </Chart:DoughnutSeries>
                                <Chart:RadPieChart.Behaviors>
                                    <Chart:ChartSelectionBehavior DataPointSelectionMode="Single"
                                                                  SelectionChanged="ChartSelectionBehavior_SelectionChanged" />
                                </Chart:RadPieChart.Behaviors>
                            </Chart:RadPieChart>
Now, if i select an item on chart, get back to previous screen and then once again navigate to page with chart, the SegmentStyleSelector is not fired, even if I set it to null and once again create an instance of it.

Is there a way to update a chart?

1 Answer, 1 is accepted

Sort by
0
Ivaylo Gergov
Telerik team
answered on 12 Apr 2013, 11:30 AM
Hi Bartlomiej,

Thank you for contacting us.

It is expected that the SegmentStyleSelector will not execute again when the page is cached. However, I can confirm that currently we have an issue regarding changing this property at runtime so I have logged it as a bug. As a workaround I can suggest you to invalidate the UI after changing the value of the DoughnutSeries.SegmentStyleSelector:

this.chart.InvalidateUI();

I have updated your Telerik points as a token of gratitude. Let me know if you need further assistance.

 

Kind regards,
Ivaylo Gergov
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Chart for XAML
Asked by
Bartlomiej
Top achievements
Rank 1
Answers by
Ivaylo Gergov
Telerik team
Share this question
or