The drawing API Poly object

The drawing API Poly object which be added to your charts to give them extra clickable hotspots. You give the poly object a set of points and it forms a polygon that you can click on.

[No canvas support]

The Poly object (which is short for polygon) is a drawing API object which you can use to add regular or irregular shapes to your charts.

Usage example

    var bar = new RGraph.Bar({
        id: 'cvs',
        data: [4,8,6,5,6,9,9,4],
        options: {
            axes: false,
            marginBottom: 45
    var poly = new RGraph.Drawing.Poly({
        id: 'cvs',
        coords: [[50,150],[75,25],[100,150]],
        options: {
            shadow: true,
            shadowColor: 'rgba(225,225,225,0.2)',
            tooltips: ['<b>The Drawing API Poly object</b>']


Color properties

colorsStrokeThe stroke color used to draw the shape'black'
colorsFillThe fill color used to draw the shape'red'

Interactive features properties

tooltipsThis can be array of tooltips (only the first element is used) that are shown when the axis is clicked on.null
tooltipsEventThis is the event that triggers the tooltips. It can be either onclick or onmousemove.onclick
tooltipsEffectThe effect used for showing tooltips. Can be either fade or none.fade
tooltipsCssClassThis is the name of the CSS class the chart uses.RGraph_tooltip
tooltipsOverrideIf 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 pagenull
tooltipsNohideonclearNot an option that you'll need particularly often if at all. Setting this to true means that when you call the RGraph.clear() API function tooltip DO NOT get hidden.false

Event properties

eventsClickIf you want to add your own onclick function you can do so by assigning it to this property. See here for details.null
eventsMousemoveIf you want to add your own onmousemove function you can do so by assigning it to this property. See here for details.null

Shadow properties

shadowThis controls whether the shadow is enabled or not.false
shadowColorThe color of the shadow.rgba(0,0,0,0.2)
shadowOffsetxThe X offset that the shadow is drawn at.3
shadowOffsetyThe Y offset that the shadow is drawn at.3
shadowBlurThe severity of the shadow blur.5

Miscellaneous properties

highlightStyleBy default this is null but you can set it to a function if you wish so that function is called to do the chart highlighting. Its passed the shape object as an argument.null