You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: blazor/chart/legend.md
+64Lines changed: 64 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -678,6 +678,70 @@ The series [Name](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts
678
678
679
679

680
680
681
+
## Legend Template
682
+
683
+
Legend templates allow you to replace default legend icons and text with custom HTML or Blazor markup for each series. This enables branded styles, richer content (icons, multi-line text, badges), improved readability, and localization.
684
+
685
+
To use, add a `LegendItemTemplate` inside any `ChartSeries` you want to customize. The rendered content becomes the legend item and can be styled with CSS. Legend interactions (click to toggle series) remain unless `ToggleVisibility` is set to false. Templates work with all legend positions, alignments, and paging.
public List<ChartData> MedalDetails = new List<ChartData>
731
+
{
732
+
new ChartData{ Country= "USA", Gold=50, Silver=70, Bronze=45 },
733
+
new ChartData{ Country="China", Gold=40, Silver= 60, Bronze=55 },
734
+
new ChartData{ Country= "Japan", Gold=70, Silver= 60, Bronze=50 },
735
+
new ChartData{ Country= "Australia", Gold=60, Silver= 56, Bronze=40 },
736
+
new ChartData{ Country= "France", Gold=50, Silver= 45, Bronze=35 },
737
+
new ChartData{ Country= "Germany", Gold=40, Silver=30, Bronze=22 },
738
+
new ChartData{ Country= "Italy", Gold=40, Silver=35, Bronze=37 },
739
+
new ChartData{ Country= "Sweden", Gold=30, Silver=25, Bronze=27 }
740
+
};
741
+
}
742
+
```
743
+

744
+
681
745
N> Refer to our [Blazor Charts](https://www.syncfusion.com/blazor-components/blazor-charts) feature tour page for its groundbreaking feature representations and also explore our [Blazor Chart Example](https://blazor.syncfusion.com/demos/chart/line?theme=bootstrap5) to know various chart types and how to represent time-dependent data, showing trends at equal intervals.
0 commit comments