corelibraries-devexpress-dot-xtracharts-dot-chartelement.md
Deserializing layout settings from untrusted resources may create security issues. Serializable System.Object properties that contain custom type values are not (de)serialized automatically. Review the following help topic for information on how to (de)serialize custom type values: Safe Deserialization.
Gets or sets the object that contains data related to the chart element.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
[XtraChartsLocalizableCategory(XtraChartsCategory.Misc)]
public object Tag { get; set; }
<XtraChartsLocalizableCategory(XtraChartsCategory.Misc)>
Public Property Tag As Object
| Type | Description |
|---|---|
| Object |
A Object that contains data about the chart element.
|
Any type derived from the Object class can be assigned to this property. Use it to store data associated with a particular chart element (e.g., an annotaton, an axis, an axis title, a diagram).
Note
If a chart is bound to data, the Tag property is automatically assigned to the underlying object used to create this chart element (e.g. to the corresponding DataRowView object, if a chart is bound to a DataTable ).
Important
When the chart is serialized, only string Tag values are saved.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Tag property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-charts-apply-the-best-fit-function-to-a-series/CS/LineOfBestFit/Form1.cs#L78
BestFit.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False;
BestFit.Tag = tag;
this.chartControl1.Series.Add(BestFit);
how-to-display-the-total-value-above-each-pie-chart/CS/TotalsInChartsExample/Form1.cs#L26
foreach (Series series in chart.Series) {
var axisPoint = series.Tag as AxisPoint;
if (axisPoint != null) {
winforms-charts-apply-the-best-fit-function-to-a-series/VB/LineOfBestFit/Form1.vb#L86
BestFit.LabelsVisibility = DevExpress.Utils.DefaultBoolean.False
BestFit.Tag = tag
chartControl1.Series.Add(BestFit)
how-to-display-the-total-value-above-each-pie-chart/VB/TotalsInChartsExample/Form1.vb#L26
For Each series As Series In chart.Series
Dim axisPoint = TryCast(series.Tag, AxisPoint)
If axisPoint IsNot Nothing Then
See Also