Empty Content Message
The chart control displays empty content messages in few situations - no chart series defined, no data points added and no axes defined.
The content of those messages can be customized using the EmptyContent
and EmptyContentTemplate
properties of the chart.
The chart sets the empty content automatically based on the missing setting (no data, no series, no axis) and the corresponding string is passed as the data context of the EmptyContentTemplate
. In case you set the EmptyContent
property, the chart no longer sets the value automatically and the one you set is used to display the message.
The following example shows how to set the EmptyContent
to a fixed value which is displayed for all of the beforementioned errors.
Setting EmptyContent
<telerikChart:RadCartesianChart EmptyContent="Something is missing. Please check your chart setup."/>
To keep using the default messages, but modify the visual styles, set only the EmptyContentTemplate
.
Setting EmptyContentTemplate
<telerikChart:RadCartesianChart>
<telerikChart:RadCartesianChart.EmptyContentTemplate>
<DataTemplate>
<Border Background="#F5CC84" Padding="20">
<TextBlock Text="{Binding}" Foreground="#3B4F81"/>
</Border>
</DataTemplate>
</telerikChart:RadCartesianChart.EmptyContentTemplate>
</telerikChart:RadCartesianChart>