Skip to main content

BubbleDataSet

Namespace: Wisej.Web.Ext.ChartJS4.Models

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

Data set for bubble charts.

public class BubbleDataSet : ChartDataSet

Sets Type to "bubble". Each data item is an object with x, y and r (bubble radius in pixels) properties.

Example:

var chart = new ChartJS4 { ChartType = ChartType.Bubble };
chart.DataSets.Add(new BubbleDataSet
{
Label = "Cities",
Data = new object[] { new { x = 10, y = 20, r = 15 }, new { x = 25, y = 8, r = 6 } },
BackgroundColor = "rgba(255, 99, 132, 0.5)"
});

Constructors​

Instance member BubbleDataSet()​

Initializes a new instance of the BubbleDataSet class.

Sets Type to "bubble".

Example:

var bubbles = new BubbleDataSet { Label = "Samples" };
bubbles.Data = new object[] { new { x = 5, y = 5, r = 10 } };
chart.DataSets.Add(bubbles);

Properties​

Instance member BoxStrokeStyle​

String: Returns or sets the stroke style for box elements (custom chart type extension).

Value: A CSS color or stroke style string. The default is null. Serialized as the boxStrokeStyle dataset option.

This is not a standard Chart.js option; it is read by custom chart types (e.g. a custom bubble controller registered on the client and selected through Type) and ignored by the built-in bubble chart.

Example:

var bubbles = new BubbleDataSet { Label = "Custom" };
bubbles.BoxStrokeStyle = "red";
chart.ChartOptions.Type = "customBubble";