Bubble Chart Examples
A bubble chart is used to display three dimensions of data at the same time. The location of the bubble is determined by the first two dimensions and the corresponding horizontal and vertical axes. The third dimension is represented by the size of the individual bubbles. These options are common to all datasets. The line fill color. The line color. The line width (in pixels). How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea. Is clip enabled? Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0} Configure the visibility of the dataset. Using hidden: true will hide the dataset from being rendered in the Chart. Background color when hovered. Border color when hovered. The line width (in pixels) when hovered. The label for the dataset which appears in the legend and tooltips. Bubble chart specific dataset options. Draw the active bubbles of a dataset over the other bubbles of the dataset. Default bubble additional radius when hovered (in pixels). Default bubble additional radius for hit detection (in pixels). Default The drawing order of dataset. Also affects order for tooltip and legend. Default Is style of the point enabled? Default Style of the point. bubble rotation (in degrees). Default bubble radius (in pixels). Default <RzChart Configure=@(c => c
.Data(d => d
.Datasets(ds => ds
.Bubble()
.Label("Bubble Dataset")
.Data(new object[] {
new { x = 20, y = 30, r = 15 },
new { x = 40, y = 10, r = 10 }
})
.BackgroundColor("var(--chart-1)")
)
)
.Options(o => o
.Responsive(true)
.MaintainAspectRatio(false)
.Plugins(p => p.Title(t => t.Display(true).Text("Chart.js Bubble Chart")))
)) />Common Dataset Options
BackgroundColor
.BackgroundColor("green").BackgroundColors("rgba(255, 99, 132, 0.2)", "rgba(255, 159, 64, 0.2)")BorderColor
.BorderColor("grey").BorderColors("yellow", "blue")BorderWidth
.BorderWidth(1)Clip
.Clip(3).Clip(false).Clip(c => c.Left(5).Top(false).Right(-2).Bottom(0))Hidden
.Hidden(true)HoverBackgroundColor
.HoverBackgroundColor("blue").HoverBackgroundColors("blue", "green")HoverBorderColor
.HoverBorderColor("grey").HoverBorderColors("grey", "blue")HoverBorderWidth
.HoverBorderWidth(3)Label
.Label("First Bar Dataset")Bubble Dataset Options
DrawActiveElementsOnTop
true.DrawActiveElementsOnTop(false)HoverRadius
4.HoverRadius(3)HitRadius
1.HitRadius(2)Order
0.Order(1)PointStyle
'circle' External Link.PointStyle(true).PointStyle(PointStyle.Cross)Rotation
0.Rotation(1)Radius
3.Radius(1)