RadarDataSet
Namespace: Wisej.Web.Ext.ChartJS4.Models
Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)
Data set for radar charts.
- C#
- VB.NET
public class RadarDataSet : ChartDataSet
Public Class RadarDataSet
Inherits ChartDataSet
Sets Type to "radar". The data values are matched by index to the chart Labels, which become the spokes of the radar.
Example:
var chart = new ChartJS4 { ChartType = ChartType.Radar };
chart.Labels = new[] { "Speed", "Power", "Range", "Comfort", "Price" };
chart.DataSets.Add(new RadarDataSet
{
Label = "Model A",
Data = new object[] { 8, 6, 7, 5, 4 },
Fill = true,
BackgroundColor = "rgba(54, 162, 235, 0.2)"
});
Constructors
RadarDataSet()
Initializes a new instance of the RadarDataSet class.
Sets Type to "radar".
Example:
var radar = new RadarDataSet { Label = "Skills" };
radar.Data = new object[] { 3, 5, 4 };
chart.DataSets.Add(radar);
Properties
Fill
Object: Returns or sets how the area of the radar is filled. Accepts bool, int (dataset index), or string.
Value: A Boolean, an Int32 (absolute dataset index), or a String such as "-1", "+1", "origin", "start" or "end". The default is null (no fill). Maps to the Chart.js fill option.
The fill color is taken from BackgroundColor.
Example:
var radar = new RadarDataSet { Label = "Team" };
radar.Fill = true;
radar.BackgroundColor = "rgba(255, 99, 132, 0.2)";
Tension
Double: Returns or sets the Bezier curve tension of the radar lines (0 for straight lines). (Default: 0)
Value: A Double, typically between 0 and 1. The default is 0.0 (straight lines). Maps to the Chart.js tension option.
Example:
var radar = new RadarDataSet { Label = "Team" };
radar.Tension = 0.3;
Methods
ResetFill()
Resets the Fill property to its default value of null.
Used by the Visual Studio designer when the user resets the property.
Example:
radar.ResetFill();
ResetTension()
Resets the Tension property to its default value of 0.0.
Used by the Visual Studio designer when the user resets the property.
Example:
radar.ResetTension();
ShouldSerializeFill()
Determines whether the Fill property should be serialized by the designer.
Returns: Boolean. true if Fill is not null; otherwise false.
Used by the Visual Studio designer to decide whether to generate code for the property.
Example:
if (radar.ShouldSerializeFill())
radar.ResetFill();
ShouldSerializeTension()
Determines whether the Tension property should be serialized by the designer.
Returns: Boolean. true if Tension is not 0.0 (its default value); otherwise false.
Used by the Visual Studio designer to decide whether to generate code for the property.
Example:
if (radar.ShouldSerializeTension())
radar.ResetTension();