Class AccumulationChartLegendInfo
Represents information about a legend item in an accumulation chart.
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class AccumulationChartLegendInfo
Remarks
This class provides context data for legend item templates, allowing customization of legend appearance and content based on the associated data point.
Properties
Data
Gets or sets the data from DataSource bound to the current legend item template.
Declaration
public Dictionary<string, object> Data { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, object> | A Dictionary<TKey, TValue> of |
Remarks
This property is used to retrieve the current legend item data when LegendItemTemplate is used in the SfAccumulationChart. If you need to display custom content such as images or user-defined text that is not directly bound to the chart, you can include those fields in the DataSource and access them within the LegendItemTemplate.
Examples
<SfAccumulationChart>
<AccumulationChartSeriesCollection>
<AccumulationChartSeries>
<LegendItemTemplate>
@{ var data = context as AccumulationChartLegendIInfo; }
<div>
<div style="border-radius:5px;background:green;width:10px;height:10px"></div>
<div>Profit: @data.Data["Image"]</div>
</div>
</LegendItemTemplate>
</AccumulationChartSeries>
</AccumulationChartSeriesCollection>
<AccumulationChartLegendSettings Visible="true" ShowShapes="false" />
</SfAccumulationChart>
Text
Gets or sets the text to be rendered in the corresponding legend item template.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| string | A |
Remarks
This property is used to retrieve the current legend item text when a LegendItemTemplate is used in the SfAccumulationChart.
Examples
<SfAccumulationChart>
<AccumulationChartSeriesCollection>
<AccumulationChartSeries>
<LegendItemTemplate>
@{ var data = context as AccumulationChartLegendIInfo; }
<div>
<div style="border-radius:5px;background:green;width:10px;height:10px"></div>
<div>Profit: @data.Text</div>
</div>
</LegendItemTemplate>
</AccumulationChartSeries>
</AccumulationChartSeriesCollection>
<AccumulationChartLegendSettings Visible="true" ShowShapes="false" />
</SfAccumulationChart>