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

Pie Chart NoDataMessage Issue

3 Answers 42 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Simon Chan
Top achievements
Rank 1
Simon Chan asked on 23 Nov 2009, 05:16 PM
I'm using RadControls for Silverlight Q3 2009 release and create a pie chart with data binding to ChartData. When the chart is shown while loaded, the NoDataMessage is shown properly if the ChartData is null. However, if the pie chart once shows when there is data in ChartData, the NoDataMessage is not shown any more even though I assign null to the ChartData.

<telerikChart:RadChart x:Name="mainChart" ItemsSource="{Binding ChartData}" >

    <telerikChart:RadChart.SeriesMappings>
        <telerikCharting:SeriesMapping >
            <telerikCharting:SeriesMapping.SeriesDefinition>
                <telerikCharting:PieSeriesDefinition ShowItemLabels="False">
                </telerikCharting:PieSeriesDefinition>
            </telerikCharting:SeriesMapping.SeriesDefinition>

            <telerikCharting:SeriesMapping.ItemMappings >
                <telerikCharting:ItemMapping FieldName="Reading" DataPointMember="YValue" />
                <telerikCharting:ItemMapping FieldName="Description" DataPointMember="LegendLabel" />
            </telerikCharting:SeriesMapping.ItemMappings>
        </telerikCharting:SeriesMapping>
    </telerikChart:RadChart.SeriesMappings>
...
</telerikChart:RadChart>


Regards,
Simon

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 26 Nov 2009, 09:10 AM
Hello Simon,

Please, find attached a small example, based on the code you provided. It works as expected for me, tested against the latest official release of RadControls for Silverlight. Give it a try and let me know if I have missed anything.

Best regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Simon Chan
Top achievements
Rank 1
answered on 26 Nov 2009, 02:27 PM
In your example, you're not using Data Binding to clear the data. You are using code behind to set the DataContext to null.

Please try using the data binding syntax (MVVM approach) to set ItemsSource to "{Binding ChartData}" and then set ChartData to null instead of setting the DataContext to null directly.

Rgds,
Simon
0
Ves
Telerik team
answered on 01 Dec 2009, 12:26 PM
Hello Simon,

Please, find attached an updated version of the page. Note, that in this case, the class holding ChartData should implement INotifyPropertyChanged interface.

Best regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Chart
Asked by
Simon Chan
Top achievements
Rank 1
Answers by
Ves
Telerik team
Simon Chan
Top achievements
Rank 1
Share this question
or