Skip to content

Commit 95615f6

Browse files
committed
apply suggested changes and polish example
1 parent bdf6567 commit 95615f6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

knowledge-base/chart-display-empty.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: How to Show Empty Chart Instead the Default No Data Template
2+
title: How to Show Empty Chart Instead of the Default No Data Template
33
description: Learn how to show an empty Chart component when there is no data, instead of displaying the default No Data template.
44
type: how-to
5-
page_title: How to Show Empty Chart Instead the Default No Data Template
5+
page_title: How to Show Empty Chart Instead of the Default No Data Template
66
slug: chart-kb-display-empty-chart
77
tags: charts, blazor, no data template, empty chart
88
res_type: kb
@@ -21,23 +21,22 @@ ticketid: 1675313
2121

2222
## Description
2323

24-
As of version 7.1.0, the [No Data Template](slug://chart-no-data-template) was introduced for Charts in Blazor. In some scenarios, displaying an empty Chart, rather than the No Data template, is preferred when there is no data. This knowledge base article also answers the following questions:
24+
As of version 7.1.0 of Telerik UI for Blazor, the [No Data Template](slug://chart-no-data-template) was introduced for Charts in Blazor. In some scenarios, displaying an empty Chart, rather than the No Data template, is preferred when there is no data. This knowledge base article also answers the following questions:
2525

2626
- How can I hide the No Data Template in Blazor Charts?
2727
- Is it possible to display an empty Chart in Blazor when there's no data?
2828
- Can I override the No Data Template in Blazor Charts?
2929

3030
## Solution
3131

32-
To display an empty Chart when there is no data, [override the default theme styles](slug://themes-override) by applying custom CSS. The following example demonstrates how to achieve an empty Chart display by hiding the No Data Template overlay through CSS.
32+
To display an empty Chart when there is no data, [override the default theme styles](slug://themes-override) with custom CSS. The following example demonstrates how to achieve an empty Chart display by hiding the No Data Template overlay through CSS.
3333

3434

3535

3636
````RAZOR
3737
<TelerikButton OnClick="@UpdateData">@ButtonContent</TelerikButton>
3838
<br />
3939
<TelerikChart @ref="ChartRef" Width="800px" Height="400px">
40-
<ChartTitle Text="Product Sales Over the Years" Position="@ChartTitlePosition.Bottom"></ChartTitle>
4140
<ChartSeriesItems>
4241
<ChartSeries Type="ChartSeriesType.Column"
4342
Data="@ChartData"
@@ -59,7 +58,7 @@ To display an empty Chart when there is no data, [override the default theme sty
5958
private const string Remove = "Remove Data";
6059
6160
private TelerikChart ChartRef { get; set; }
62-
private List<ChartSeriesData> ChartData { get; set; } = new List<ChartSeriesData>();
61+
private List<ChartSeriesData> ChartData { get; set; } = new ();
6362
private string ButtonContent { get; set; } = Add;
6463
6564
private void UpdateData()

0 commit comments

Comments
 (0)