Changing Bubble Styles

Introduction

 

Section 3 - Bubble Charts


 

The bubble chart is a representation of data where the position of the bubble is based on a column assigned to the x-axis, a column assigned to the y1-axis, and a column assigned to the y2-axis. The x-axis and y1-axis determine the position on the graph. The column assigned to y2-axis is the radius of the bubble.

 

To create a bubble chart the GraphType must be set to 4, columns must be assigned to the y1-axis and y2-axis, and they must have their ColumnType properties set to bubble (type 8). The ColumnStyle property controls the fill style of the bubbles.

 

All bubbles are scaled to the largest bubble. The size of the largest bubble is set by the ColumnMarkSize property. The default ColumnMarkSize is 3. When applied to the bubble chart, this means the largest bubble is 30% of the y2-axis frame distance. This default can be changed by manually scaling the y2-axis.

 

The easiest way to see how the bubble chart works is to create one. Let's create the necessary three columns of data.

FlpGrf.DataInit = 3

' The x-axis bubble positions
FlpGrf.DataValue(1, 0) = 4
FlpGrf.DataValue(2, 0) = 12
FlpGrf.DataValue(3, 0) = 15
FlpGrf.DataValue(4, 0) = 25
FlpGrf.DataValue(5, 0) = 34
FlpGrf.DataValue(6, 0) = 46
FlpGrf.DataValue(7, 0) = 52
FlpGrf.DataValue(8, 0) = 68
FlpGrf.DataValue(9, 0) = 72
 
' The y-axis bubble positions
FlpGrf.DataValue(1, 1) = 23
FlpGrf.DataValue(2, 1) = 78
FlpGrf.DataValue(3, 1) = 23
FlpGrf.DataValue(4, 1) = 12
FlpGrf.DataValue(5, 1) = 45
FlpGrf.DataValue(6, 1) = 64
FlpGrf.DataValue(7, 1) = 12
FlpGrf.DataValue(8, 1) = 42
FlpGrf.DataValue(9, 1) = 39
 
' The bubble radius
FlpGrf.DataValue(1, 2) = 13
FlpGrf.DataValue(2, 2) = 15
FlpGrf.DataValue(3, 2) = 23
FlpGrf.DataValue(4, 2) = 45
FlpGrf.DataValue(5, 2) = 23
FlpGrf.DataValue(6, 2) = 17
FlpGrf.DataValue(7, 2) = 8
FlpGrf.DataValue(8, 2) = 17
FlpGrf.DataValue(9, 2) = 24

 

Now we'll set the graph type to bubble, and assign the columns their proper types and axes. The bubble type is column type 8.

FlpGrf.GraphType = 4
FlpGrf.Column = 0
FlpGrf.ColumnAxis = 0
 
FlpGrf.Column = 1
FlpGrf.ColumnAxis = 1
FlpGrf.ColumnType = 8
 
FlpGrf.Column = 2
FlpGrf.ColumnAxis = 2
FlpGrf.ColumnType = 8

 

Each row in the buffer is a different color. The colors are cycled through the color table from color 21 through 8, then again. The styles are cycled through each style 1 to 7. The color and style of each bubble can be set with the DataColor and DataStyle methods.

 

images/tut30.png



Changing Bubble Styles

 

 

Last modified on: Friday, August 16, 2002