Tweet about RGraph
Follow for HTML5 news
Bookmark and share:

# RGraph: HTML5 canvas graph library - Radial scatter chart documentation

The Radial scatter graph is, as the name suggests, a circular variant of the scatter graph.

The example file is here.

    <script>
        window.onload = function ()
        {
            var data = [
                        [15,53,'red'],
                        [45,63,null, 'The tooltip'],
                        [48,45,'green'],
                        [52,38],
                        [51,61]
                       ];

            var rscatter= new RGraph.Rscatter('myCanvas', data);
            rscatter.Set('chart.labels', ['NE','E','SE','S','SW','W','NW','N']);
            rscatter.Set('chart.gutter', 35);
            rscatter.Draw();
        }
    </script>

## Properties

You can use these properties to control how the chart appears. You can set them by using the Set() method. Eg:

myRscatter.Set('name', 'value');

- Margins
- Labels and text
- Titles
- Key
- Scale
- Interactive features
- Zoom

### Margins

chart.gutter
The gutter of the graph. This is the area outside of the X and Y axis - where the labels go. If you're short on space for your labels, try increasing this.
Default: 25

### Labels and text

chart.text.color
The color of the labels.
Default: black
chart.text.size
The size (in points) of the labels.
Default: 10
chart.text.font
The font used to render the text.
Default: Verdana
chart.labels
The labels, if any, for the graph.
Default: none
chart.labels.axes
This controls the axes that show the scale labels. Each letter stands for the appropriate axis (North, South, East and West)
Default: nsew
chart.labels.position
This can be either center or edge and determines the position of the labels.
Default: center

### Titles

chart.title
The title of the graph, if any.
Default: null
chart.title.color
The color of the title.
Default: black
chart.title.hpos
This allows you to completely override the horizontal positioning of the title. It should be a number between 0 and 1, and is multiplied with the whole width of the canvas and then used as the horizontal position.
Default: null
chart.title.vpos
This allows you to completely override the vertical positioning of the title. It should be a number between 0 and 1, and is multiplied with the gutter and then used as the vertical position. It can be useful if you need to have a large gutter.
Default: null

### Key

chart.key
An array of key information.
Default: [] (An empty array)
chart.key.background
The colour of the key background. Typically white, you could set this to something like rgba(255,255,255,0.7) to allow people to see things behind it.
Default: white
chart.key.position
Determines the position of the key.Either graph (default), or gutter.
Default: graph
chart.key.shadow
Whether a small drop shadow is applied to the key.
Default: false
chart.key.shadow.color
The color of the shadow.
Default: #666
chart.key.shadow.blur
The extent of the blurring effect used on the shadow.
Default: 3
chart.key.shadow.offsetx
The X offset of the shadow.
Default: 2
chart.key.shadow.offsety
The Y offset of the shadow.
Default: 2
chart.key.rounded
This controls whether the corners of the key (in graph mode) are curved. If the key is gutter mode, this has no effect.
Default: false

### Scale

chart.scale.round
Whether to round the maximum scale value up or not. This will produce slightly better scales in some instances.
Default: null

### Interactive features

chart.contextmenu
An array of context menu items. More information on context menus is here.
Default: [] (An empty array)
chart.tooltips.effect
The animated effect used for showing tooltips. Can be either fade or expand.
Default: fade
chart.tooltips.event
This is the event that triggers the tooltips. It can be either onclick or onmousemove.
Default: onclick
chart.tooltips.css.class
This is the name of the CSS class the graph uses.
Default: RGraph_tooltip
chart.tooltips.override
If you wish to handle showing tooltips yourself, this should be a function object which does just that. There's more information on the tooltips documentation page
Default: null
chart.annotatable
Whether annotations are enabled for the chart (ie you can draw on the chart interactively.
Default: false
chart.annotate.color
If you do not allow the use of the palette, then this will be the only colour allowed for annotations.
Default: black
chart.resizable
Defaulting to false, this determines whether your graph will be resizable. Because of the numerous event handlers this has to install code on, This feature is unlikely to work with other dynamic features (the context menu is fine however).
Default: false

### Zoom

chart.zoom.mode
Can be used to control whether the zoom is in thumbnail or canvas mode. Possible values are: thumbnail and canvas.
Default: canvas
chart.zoom.factor
This is the factor that the graph will be zoomed by (bigger values means more zoom)
Default: 1.5
chart.zoom.fade.in
Whether the zoomed canvas fades in or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true
chart.zoom.fade.out
Whether the zoomed canvas fades out or not. This also can be used to control the fade in for the zoom in thumbnail mode.
Default: true
chart.zoom.hdir
The horizontal direction of the zoom. Possible values are: left, center, right
Default: right
chart.zoom.vdir
The vertical direction of the zoom. Possible values are: up, center, down
Default: down
chart.zoom.delay
The delay (in milliseconds) between frames.
Default: 50
chart.zoom.frames
The number of frames in the zoom animation.
Default: 10
chart.zoom.shadow
Whether or not the zoomed canvas has a shadow or not.
Default: true
chart.zoom.thumbnail.width
When the zoom is in thumbnail mode, this is the width (in pixels) of the thumbnail.
Default: 75
chart.zoom.thumbnail.height
When the zoom is in thumbnail mode, this is the height (in pixels) of the thumbnail.
Default: 75
chart.zoom.background
Defaulting to true, this determines whether the zoom has a dark, semi-opaque background that covers the entire web page.
Default: true