Home > Sample Charts > BubbleChart > A Simple Weighted Scatter

A Simple Weighted Scatter

This chart is a variant of the standard ScatterPlot with the size of the markers used to show an extra dimension in the data. The third argument gives the required marker area (typically the number of incidents recorded at a certain location) and all the markers are automatically scaled to cover the range of areas given.

This is the most obvious use of the bubblechart. Three vectors of data are provided, giving the x,y co-ordinates of each value and a count of the number of items at that point.

Note that this chart adds Value tags to the markers to give an exact value for the count at that point.


SharpPlot sp = new SharpPlot;

sp.Heading = "Incident count";

sp.SetXTickMarks(5);
sp.SetYTickMarks(50);

sp.SetMarkers(Marker.Bullet);
sp.BubbleChartStyle = BubbleChartStyles.GridLines|BubbleChartStyles.ValueTags;
sp.SetValueTags(count);
sp.SetValueFont("Arial",10);
sp.DrawBubbleChart(ydata,xdata,count);
sp.SetKeyText("Number of Incidents");

Worked Examples

bubblechart1 bubblechart2 bubblechart3 bubblechart4

Send comments on this topic
© Dyalog Ltd 2013