PointOptions.PointView Property
Gets or sets a value that specifies which information should be displayed within series labels and legend items.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v17.2.dll
Declaration
Property Value
Type | Description |
---|---|
PointView | A PointView enumeration value. |
Available values:
Name | Description |
---|---|
Argument | Specifies that series labels identify series points by their argument values (which can be taken from the SeriesPoint.Argument property). |
Values | Specifies that series labels identify data points by their values (which can be taken from the SeriesPoint.Values property). |
ArgumentAndValues | Specifies that series labels reflect both arguments and values for the corresponding series points. In this case, the resulting label content is composed of the SeriesPoint.Argument and SeriesPoint.Values property values, based on the specified PointOptions.Pattern. |
SeriesName | Specifies that series labels identify series points by the name of their series (which can be taken from the Series.Name property). |
Undefined | This means the PointOptions.PointView property value is ignored, and the text of series labels is determined by the PointOptions.Pattern property value. |
Remarks
To have greater control over what text should be displayed within series labels and legend items, use the PointOptions.Pattern property.
Example
The following example demonstrates how to specify the appearance of series labels in the Pie chart using its text pattern.
To accomplish this at runtime, it is necessary to handle the Form.Load event and then transform series labels of the Series object to the corresponding labels of the PieSeriesLabel object.
And finally, specify the pattern for series labels using the SeriesLabelBase.TextPattern property.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/obsolete-how-to-adjust-point-options-of-the-pie-series-view-type-at-runtime-e3801
using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;
namespace XtraChart_PointOptions {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
// Create an empty chart.
ChartControl pieChart = new ChartControl();
// Create a pie series.
Series series1 = new Series("A Pie Series", ViewType.Pie);
// Populate the series with points.
series1.Points.Add(new SeriesPoint("Russia", 17.0752));
series1.Points.Add(new SeriesPoint("Canada", 9.98467));
series1.Points.Add(new SeriesPoint("USA", 9.63142));
series1.Points.Add(new SeriesPoint("China", 9.59696));
series1.Points.Add(new SeriesPoint("Brazil", 8.511965));
series1.Points.Add(new SeriesPoint("Australia", 7.68685));
series1.Points.Add(new SeriesPoint("India", 3.28759));
series1.Points.Add(new SeriesPoint("Others", 81.2));
// Add the series to the chart.
pieChart.Series.Add(series1);
// Adjust the text pattern of the series label.
PieSeriesLabel label = (PieSeriesLabel)series1.Label;
label.TextPattern = "{A}: {VP:P0}";
// Detect overlapping of series labels.
label.ResolveOverlappingMode = ResolveOverlappingMode.Default;
// Add the chart to the form.
pieChart.Dock = DockStyle.Fill;
this.Controls.Add(pieChart);
}
}
}