Skip to main content

ScatterDataSet

Namespace: Wisej.Web.Ext.ChartJS4.Models

Assembly: Wisej.Web.Ext.ChartJS4 (4.1.0.0)

Data set for scatter charts.

public class ScatterDataSet : ChartDataSet

Sets Type to "scatter". Each data item is an object with x and y properties.

Example:

var chart = new ChartJS4 { ChartType = ChartType.Scatter };
chart.DataSets.Add(new ScatterDataSet
{
Label = "Measurements",
Data = new object[] { new { x = -10, y = 0 }, new { x = 0, y = 10 }, new { x = 10, y = 5 } },
BackgroundColor = Color.Crimson
});

Constructors​

Instance member ScatterDataSet()​

Initializes a new instance of the ScatterDataSet class.

Sets Type to "scatter".

Example:

var points = new ScatterDataSet { Label = "Points" };
points.Data = new object[] { new { x = 1, y = 2 }, new { x = 2, y = 3 } };
chart.DataSets.Add(points);

Properties​

Instance member Fill​

Object: Returns or sets whether to fill the area under the scatter points. Accepts true, false, an index, or a string like '+1' or '-1'. (Default: null)

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.

Filling only has a visible effect when the points are connected by a line (e.g. with showLine set via ExtensionData).

Example:

var points = new ScatterDataSet { Label = "Range" };
points.ExtensionData = new Dictionary<string, object> { ["showLine"] = true };
points.Fill = "origin";