Skip to content

Commit b0d95bc

Browse files
Merge branch 'development' into 998702-TreeDocs
2 parents 8e2f5d4 + 6e75eed commit b0d95bc

File tree

64 files changed

+4967
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+4967
-12
lines changed

blazor-toc.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,9 @@
765765
<li>
766766
<a href="/blazor/accumulation-chart/title-and-sub-title">Title and Subtitle</a>
767767
</li>
768+
<li>
769+
<a href="/blazor/accumulation-chart/gradient">Gradient</a>
770+
</li>
768771
<li>
769772
<a href="/blazor/accumulation-chart/chart-print">Print and Export</a>
770773
</li>
@@ -967,6 +970,28 @@
967970
</li>
968971
</ul>
969972
</li>
973+
<li><a href="/blazor/blockeditor/built-in-blocks/built-in-blocks">Built-in Blocks</a>
974+
<ul>
975+
<li><a href="/blazor/blockeditor/built-in-blocks/typography">Typography</a></li>
976+
<li><a href="/blazor/blockeditor/built-in-blocks/table-block">Table Blocks</a></li>
977+
<li><a href="/blazor/blockeditor/built-in-blocks/list-types">List-Types</a></li>
978+
<li><a href="/blazor/blockeditor/built-in-blocks/inline-content">Inline Content</a></li>
979+
<li><a href="/blazor/blockeditor/built-in-blocks/embed">Embeds</a></li>
980+
</ul>
981+
</li>
982+
<li><a href="/blazor/blockeditor/editor-menus">Editor Menus</a></li>
983+
<li><a href="/blazor/blockeditor/paste-cleanup">Paste Cleanup</a></li>
984+
<li><a href="/blazor/blockeditor/undo-redo">Undo and redo</a></li>
985+
<li><a href="/blazor/blockeditor/globalization">Globalization</a></li>
986+
<li><a href="/blazor/blockeditor/keyboard-shortcuts">Keyboard Shortcuts</a></li>
987+
<li><a href="/blazor/blockeditor/appearance">Appearance</a></li>
988+
<li><a href="/blazor/blockeditor/events">Events</a></li>
989+
<li>Validation and Security
990+
<ul>
991+
<li><a href="/blazor/blockeditor/validation-security/cross-site-script">Cross-Site Scripting</a></li>
992+
<li><a href="/blazor/blockeditor/validation-security/read-only-mode">Controlling Editor Access</a></li>
993+
</ul>
994+
</li>
970995
</ul>
971996
</li>
972997
<li>Breadcrumb
@@ -1476,6 +1501,9 @@
14761501
<li>
14771502
<a href="/blazor/chart/trend-lines">Trendlines</a>
14781503
</li>
1504+
<li>
1505+
<a href="/blazor/chart/gradient">Gradient</a>
1506+
</li>
14791507
<li>
14801508
<a href="/blazor/chart/internationalization">Internationalization</a>
14811509
</li>
@@ -4563,6 +4591,7 @@
45634591
<li> <a href="/blazor/stock-chart/panning">Panning</a></li>
45644592
<li> <a href="/blazor/stock-chart/range-selector">Range Selector</a></li>
45654593
<li> <a href="/blazor/stock-chart/appearance">Appearance</a></li>
4594+
<li> <a href="/blazor/stock-chart/gradient">Gradient</a></li>
45664595
<li> <a href="/blazor/stock-chart/export-print">Print and Export</a></li>
45674596
<li> <a href="/blazor/stock-chart/accessibility">Accessibility</a></li>
45684597
<li> <a href="/blazor/stock-chart/events">Events</a></li>

blazor/accumulation-chart/gradient.md

Lines changed: 324 additions & 0 deletions
Large diffs are not rendered by default.
72.3 KB
Loading
53.7 KB
Loading
56.7 KB
Loading
60.9 KB
Loading
46.8 KB
Loading

blazor/accumulation-chart/legend.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,70 @@ When the legend text exceeds the container, the text can be wrapped by using [Te
389389

390390
{% previewsample "https://blazorplayground.syncfusion.com/embed/htLqsrMJWRuPUEHB?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" backgroundimage "[Blazor Accumulation Chart Legend with Wrap](images/legend/blazor-accumulation-chart-legend-wrap.png)" %}
391391

392+
## Legend Template
393+
394+
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.
395+
396+
To use, add a `LegendItemTemplate` inside any [AccumulationChartSeries](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.AccumulationChartSeries.html) 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](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.AccumulationChartLegendSettings.html#Syncfusion_Blazor_Charts_AccumulationChartLegendSettings_ToggleVisibility) is set to false. Templates work with all legend positions, alignments, and paging.
397+
398+
**Text** : Gets or sets the text to render for the current legend item in the template. Defaults to the value from the field mapped by AccumulationChartSeries.XName.
399+
400+
**Data** : Gets the data item from AccumulationChartSeries.DataSource bound to the current legend item. Use this to access additional fields (for example, images, badges, or localized text) inside the template.
401+
402+
```
403+
@using Syncfusion.Blazor.Charts
404+
405+
@* Initialize the accumulation chart component and configure its essential features *@
406+
<SfAccumulationChart Title="Mobile Browser Statistics">
407+
408+
@* Display the legend and allow toggling visibility on interaction *@
409+
<AccumulationChartLegendSettings Visible="true" >
410+
</AccumulationChartLegendSettings>
411+
412+
<AccumulationChartSeriesCollection>
413+
@* Define a pie series with X and Y mappings and color mapping *@
414+
<AccumulationChartSeries DataSource="@StatisticsDetails" XName="Browser" YName="Users" Name="Browser" PointColorMapping="Color">
415+
@* Render a custom legend item using the template context *@
416+
<LegendItemTemplate>
417+
@{
418+
var info = context as AccumulationChartLegendInfo;
419+
var browser = info?.Data?["Browser"]?.ToString() ?? "";
420+
var users = info?.Data?["Users"] is null ? 0 : Convert.ToDouble(info.Data["Users"]);
421+
}
422+
<div style="display:flex; align-items:center; gap:8px; padding:4px 0;">
423+
<div style="display:flex; flex-direction:column; line-height:1.1;">
424+
<span style="font-weight:800; font-size:14px; color: @info.Data["Color"]">@browser</span>
425+
<span style="font-size:12px; opacity:0.8;"><b>@users million</b> people use @browser</span>
426+
</div>
427+
</div>
428+
</LegendItemTemplate>
429+
</AccumulationChartSeries>
430+
</AccumulationChartSeriesCollection>
431+
432+
</SfAccumulationChart>
433+
434+
@code {
435+
public class Statistics
436+
{
437+
public string Browser { get; set; }
438+
public double Users { get; set; }
439+
public string Color { get; set; }
440+
}
441+
442+
public List<Statistics> StatisticsDetails = new()
443+
{
444+
new Statistics { Browser = "Chrome", Users = 37, Color = "#a16ee5" },
445+
new Statistics { Browser = "UC Browser", Users = 17, Color = "#f7ce69" },
446+
new Statistics { Browser = "iPhone", Users = 19, Color = "#55a5c2" },
447+
new Statistics { Browser = "Others", Users = 4, Color = "#7ddf1e" },
448+
new Statistics { Browser = "Opera", Users = 11, Color = "#ff6ea6" },
449+
new Statistics { Browser = "Android", Users = 12, Color = "#7953ac" },
450+
};
451+
452+
}
453+
```
454+
![Legend Template in Blazor Accumulation Chart](images/legend/blazor-accumulation-chart-legend-template.png)
455+
392456
N> Refer to the [Blazor Charts](https://www.syncfusion.com/blazor-components/blazor-charts) feature tour page for its groundbreaking feature representations and also explore the [Blazor Accumulation Chart Example](https://blazor.syncfusion.com/demos/chart/pie?theme=bootstrap5) to know about the various features of accumulation charts and how it is used to represent numeric proportional data.
393457

394458
* [Grouping](./grouping)

0 commit comments

Comments
 (0)