This topic discusses some advanced settings of radar charts.
Multiple Radar Series
Radar series tolerate other series from type Radar; that is, Xceed Chart for WinForms can display multiple radar series simultaneously. When the user creates multiple instances of the RadarSeries class in the Series collection, they are all displayed together and are scaled on the one and only Radar Axis. The Radar axis is a standard chart axis accessible from the Axis method of the Chart class. The following code example generates a multi series radar chart.
VB.NET |
|
' there is one chart created by default Dim chart As Chart = CType(chartControl1.Charts(0), Chart) Dim radar1 As RadarSeries = CType(chart.Series.Add(SeriesType.Radar), RadarSeries) Dim radar2 As RadarSeries = CType(chart.Series.Add(SeriesType.Radar), RadarSeries) ' first radar series is a red line radar1.RadarLine.Color = Color.Red 'second radar series is a green line radar2.RadarLine.Color = Color.Green ' add values to the first series radar1.Add(10) radar1.Add(20) radar1.Add(15) radar1.Add(10) radar1.Add(20) ' add values to the second series radar2.Add(14) radar2.Add(24) radar2.Add(19) radar2.Add(14) radar2.Add(24) ' get a reference of the radar axis Dim axis As RadarAxis = (CType(chart.Axis(StandardAxis.Radar), RadarAxis)) ' and force the scale to begin from 0 axis.AutoMin = False axis.Min = 0
|
C# |
|
// there is one chart created by default Chart chart = (Chart)chartControl1.Charts[0]; RadarSeries radar1 = (RadarSeries)chart.Series.Add(SeriesType.Radar); RadarSeries radar2 = (RadarSeries)chart.Series.Add(SeriesType.Radar); // first radar series is a red line radar1.RadarLine.Color = Color.Red; //second radar series is a green line radar2.RadarLine.Color = Color.Green; // add values to the first series radar1.Add(10); radar1.Add(20); radar1.Add(15); radar1.Add(10); radar1.Add(20); // add values to the second series radar2.Add(14); radar2.Add(24); radar2.Add(19); radar2.Add(14); radar2.Add(24); // get a reference of the radar axis RadarAxis axis = ((RadarAxis)chart.Axis(StandardAxis.Radar)); // and force the scale to begin from 0 axis.AutoMin = false; axis.Min = 0;
|
Custom Radar Category Labels
Radar charts frequently need to display user-defined texts at the end of each category radian line. This can easily be achieved with the help of the AutoRadarLabels and RadarLabels properties of the radar axis. The following code will label the radar chart generated by the previous example:
VB.NET |
|
Dim axis As RadarAxis = (CType(Chart.Axis(StandardAxis.Radar), RadarAxis)) axis.AutoRadarLabels = False axis.RadarLabels.Add("Vitamin A") axis.RadarLabels.Add("Vitamin B1") axis.RadarLabels.Add("Vitamin B2") axis.RadarLabels.Add("Vitamin C") axis.RadarLabels.Add("Vitamin E")
|
C# |
|
RadarAxis axis = ((RadarAxis)Chart.Axis(StandardAxis.Radar)); axis.AutoRadarLabels = false; axis.RadarLabels.Add("Vitamin A"); axis.RadarLabels.Add("Vitamin B1"); axis.RadarLabels.Add("Vitamin B2"); axis.RadarLabels.Add("Vitamin C"); axis.RadarLabels.Add("Vitamin E");
|
Related Examples
Windows Forms: Series\Radar\Standard Radar
Windows Forms: Series\Radar\Filled Area Radar
See Also
RadarSeries | RadarAxis