Semi-circular Progress bar

Example

View example on CodePen
<script>
    scp = new RGraph.SVG.SemiCircularProgress({
        id: 'chart-container',
        min: 0,
        max: 200,
        value: [50,30,60],
        options: {
            colors: ['rgba(0,255,0,0.25)',
                'rgba(255,0,0,0.25)',
                'rgba(255,255,0,0.25)'
            ],
            marginRight: 75,
            marginLeft: 75,
            marginTop: 50,
            scale: true,
            backgroundColor: '#E8FAE8',
            backgroundColorOpacity: 1,
            backgroundGrid: true,
            scaleLabelsSize: 10,
            scaleLabelsCount: 20,
            scaleUnitsPost: '%',
            backgroundGridRadialsCount: 20,
            labelsCenterUnitsPost: '%',
            labelsCenterDecimals: 1,
            tooltips: 'Amount: %{value_formatted} boxes',
            tooltipsCss: {
                fontSize: '20pt',
                fontWeight: 'bold'
            }
        }
    }).draw();
</script>

The obj.coords property

The obj.coords array is new for version 6.05 and provides an alternative to the obj.nodes properties - being more like the canvas way of storing coordinates to shapes. The object is an array of objects which each contain the details of the segments that are drawn on the chart. If you want to, you can replay these coordinates by using the RGraph api method RGraph.SVG.TRIG.getArcPath3 and then using the resulting path as the argument when you create a path node, like this:

// Create the outer arc path
var arcPath1 = RGraph.SVG.TRIG.getArcPath3({
    cx:     scp.coords[0].cx,
    cy:     scp.coords[0].cy,
    radius: scp.coords[0].radiusOuter,
    start:  scp.coords[0].start,
    end:    scp.coords[0].end,
    anticlockwise: false,
    lineto:false
});

// Crete the inner arc path
var arcPath2 = RGraph.SVG.TRIG.getArcPath3({
    cx:     scp.coords[0].cx,
    cy:     scp.coords[0].cy,
    radius: scp.coords[0].radiusInner,
    start:  scp.coords[0].end,
    end:    scp.coords[0].start,
    anticlockwise: true,
    lineto: true
});

// Now create an SVG path object out of the two paths created above
var path = scp.create('path', null, {
    d: '{1} {2} z'.format(arcPath1, arcPath2),
    stroke: 'black',
    fill: 'transparent'
});

The obj.nodes property

As well as coordinates, the Semi-circular Progress mmeter aintains references to the nodes that are created - such as the bar, the background and text nodes. For example:

You could, for example, add your own event listeners like this:

<script>
    obj.nodes.labelsCenter.onclick = function (e)
    {
        alert('The value is: ' + scp.value);
    }

    obj.nodes.labelsCenter.onmousemove = function (e)
    {
        e.target.style.cursor = 'pointer';
    }
</script>

Properties

You can use these properties to control how the chart appears. You can set them by including them in the options section of the configuration as shown above.

Chart configuration properties

PropertyDescriptionDefault
centerxIf required, you can position the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the x-axis coordinate.null
centeryIf required, you can position the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the y-axis coordinate.null
radiusIf required, you can size the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the radius.null
widthThe width of the progress bar (ie the outer radius minus the inner radius).60
centerx
If required, you can position the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the x-axis coordinate.
Default: null

centery
If required, you can position the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the y-axis coordinate.
Default: null

radius
If required, you can size the progress bar using this instead of the margins. As well as a number this can be a string like this: +25 -25 And in that case that number is used to adjust the radius.
Default: null

width
The width of the progress bar (ie the outer radius minus the inner radius).
Default: 60

Margin properties

PropertyDescriptionDefault
marginLeftThe left margin of the chart, (the margin is where the labels and title are)).35
marginRightThe right margin of the chart, (the margin is where the labels and title are).35
marginTopThe top margin of the chart, (the margin is where the labels and title are).35
marginBottomThe bottom margin of the chart, (the margin is where the labels and title are).35
marginLeft
The left margin of the chart, (the margin is where the labels and title are)).
Default: 35

marginRight
The right margin of the chart, (the margin is where the labels and title are).
Default: 35

marginTop
The top margin of the chart, (the margin is where the labels and title are).
Default: 35

marginBottom
The bottom margin of the chart, (the margin is where the labels and title are).
Default: 35

Background properties

PropertyDescriptionDefault
backgroundFillThe color of the background fill.Gradient(white:#aaa)
backgroundFillOpacityThe opacity of the background fill color.0.25
backgroundGridWhether the background grid is drawn or not.true
backgroundGridLinewidthThe linewidth of the background grid.1
backgroundGridColorThe color of the background grid.#ddd
backgroundGridRadialsWhether the radial lines (the lines that emanate from the center coordinates) are drawn or not.true
backgroundGridRadialsCountThe number of radial lines that are drawn.10
backgroundGridCirclesWhether the semi-circular border bar lines are drawn on the background grid.true
backgroundGridMarginThis is the distance that the background grid extends to.20
backgroundFill
The color of the background fill.
Default: Gradient(white:#aaa)

backgroundFillOpacity
The opacity of the background fill color.
Default: 0.25

backgroundGrid
Whether the background grid is drawn or not.
Default: true

backgroundGridLinewidth
The linewidth of the background grid.
Default: 1

backgroundGridColor
The color of the background grid.
Default: #ddd

backgroundGridRadials
Whether the radial lines (the lines that emanate from the center coordinates) are drawn or not.
Default: true

backgroundGridRadialsCount
The number of radial lines that are drawn.
Default: 10

backgroundGridCircles
Whether the semi-circular border bar lines are drawn on the background grid.
Default: true

backgroundGridMargin
This is the distance that the background grid extends to.
Default: 20

Color properties

PropertyDescriptionDefault
colorsThe color to be used for the progress bar.[#6d6, #FFA5A5, #A0A2F8, yellow, gray, pink, orange, cyan, green]
colorsStrokeThe color of the outline of the progress bar.transparent
colors
The color to be used for the progress bar.
Default: [#6d6, #FFA5A5, #A0A2F8, yellow, gray, pink, orange, cyan, green]

colorsStroke
The color of the outline of the progress bar.
Default: transparent

Labels and text properties

PropertyDescriptionDefault
textFontThe font used to render the text.Arial, Verdana, sans-serif
textSizeThe size of the text.12
textColorThe color of the labels.black
textItalicWhether the labels are italic or not.false
textBoldWhether the labels are bold or not.false
textThis allows you to add custom text to your chart if you want to. There's a dedicated page that describes this option here.null
labelsMinWhether to show the minimum label.true
labelsMinFontThe font used to render the minimum label.null
labelsMinSizeThe size of the minimum label.null
labelsMinColorThe color of the minimum label.null
labelsMinItalicWhether the minimum label is italic or not.null
labelsMinBoldWhether the minimum label is bold or not.null
labelsMinUnitsPreUnits that are pre-pended to the minimum label.null
labelsMinUnitsPostUnits that are appended to the minimum label.null
labelsMinPointThe character that's used as the decimal point for the minimum label.null
labelsMinThousandThe character that's used as the thousand separator for the minimum label.null
labelsMinDecimalsThe number of decimals to apply to the minimum label.null
labelsMinSpecificThe specific text to use as the minimum label.null
labelsMinFormatterA function that's used as the formatter for the minimum label. This function should look like this:
labelsMinFormatter: function (obj, num)
{
}
null
labelsMaxWhether to show the maximum label.true
labelsMaxFontThe font used to render the maximum label.null
labelsMaxSizeThe size of the maximum label.null
labelsMaxColorThe color of the maximum label.null
labelsMaxItalicWhether the maximum label is italic or not.null
labelsMaxBoldWhether the maximum label is bold or not.null
labelsMaxUnitsPreUnits that are pre-pended to the maximum label.null
labelsMaxUnitsPostUnits that are appended to the maximum label.null
labelsMaxPointThe character that's used as the decimal point for the maximum label.null
labelsMaxThousandThe character that's used as the thousand separator for the maximum label.null
labelsMaxDecimalsThe number of decimals to apply to the maximum label.null
labelsMaxSpecificThe specific text to use as the maximum label.null
labelsMaxFormatterA function that's used as the formatter for the maximum label. This function should look like this:
labelsMaxFormatter: function (obj, num)
{
}
null
labelsCenterWhether to show the center label.true
labelsCenterIndexIf you're showing multiple values on your chart this is the index of the value in the data array that is used as the center label. 0
labelsCenterFontThe font used to render the center label.null
labelsCenterSizeThe size of the center label.40
labelsCenterColorThe color of the center label.null
labelsCenterItalicWhether the center label is italic or not.null
labelsCenterBoldWhether the center label is bold or not.null
labelsCenterUnitsPreUnits that are pre-pended to the center label.null
labelsCenterUnitsPostUnits that are appended to the center label.null
labelsCenterPointThe character that's used as the decimal point for the center label.null
labelsCenterThousandThe character that's used as the thousand separator for the center label.null
labelsCenterDecimalsThe number of decimals to apply to the center label.null
labelsCenterSpecificThe specific text to use as the center label.null
labelsCenterFormatterA function that's used as the formatter for the center label. This function should look like this:
labelsCenterFormatter: function (obj, num)
{
}
null
textFont
The font used to render the text.
Default: Arial, Verdana, sans-serif

textSize
The size of the text.
Default: 12

textColor
The color of the labels.
Default: black

textItalic
Whether the labels are italic or not.
Default: false

textBold
Whether the labels are bold or not.
Default: false

text
This allows you to add custom text to your chart if you want to. There's a dedicated page that describes this option here.
Default: null

labelsMin
Whether to show the minimum label.
Default: true

labelsMinFont
The font used to render the minimum label.
Default: null

labelsMinSize
The size of the minimum label.
Default: null

labelsMinColor
The color of the minimum label.
Default: null

labelsMinItalic
Whether the minimum label is italic or not.
Default: null

labelsMinBold
Whether the minimum label is bold or not.
Default: null

labelsMinUnitsPre
Units that are pre-pended to the minimum label.
Default: null

labelsMinUnitsPost
Units that are appended to the minimum label.
Default: null

labelsMinPoint
The character that's used as the decimal point for the minimum label.
Default: null

labelsMinThousand
The character that's used as the thousand separator for the minimum label.
Default: null

labelsMinDecimals
The number of decimals to apply to the minimum label.
Default: null

labelsMinSpecific
The specific text to use as the minimum label.
Default: null

labelsMinFormatter
A function that's used as the formatter for the minimum label. This function should look like this:
labelsMinFormatter: function (obj, num)
{
}

Default: null

labelsMax
Whether to show the maximum label.
Default: true

labelsMaxFont
The font used to render the maximum label.
Default: null

labelsMaxSize
The size of the maximum label.
Default: null

labelsMaxColor
The color of the maximum label.
Default: null

labelsMaxItalic
Whether the maximum label is italic or not.
Default: null

labelsMaxBold
Whether the maximum label is bold or not.
Default: null

labelsMaxUnitsPre
Units that are pre-pended to the maximum label.
Default: null

labelsMaxUnitsPost
Units that are appended to the maximum label.
Default: null

labelsMaxPoint
The character that's used as the decimal point for the maximum label.
Default: null

labelsMaxThousand
The character that's used as the thousand separator for the maximum label.
Default: null

labelsMaxDecimals
The number of decimals to apply to the maximum label.
Default: null

labelsMaxSpecific
The specific text to use as the maximum label.
Default: null

labelsMaxFormatter
A function that's used as the formatter for the maximum label. This function should look like this:
labelsMaxFormatter: function (obj, num)
{
}

Default: null

labelsCenter
Whether to show the center label.
Default: true

labelsCenterIndex
If you're showing multiple values on your chart this is the index of the value in the data array that is used as the center label.
Default: 0

labelsCenterFont
The font used to render the center label.
Default: null

labelsCenterSize
The size of the center label.
Default: 40

labelsCenterColor
The color of the center label.
Default: null

labelsCenterItalic
Whether the center label is italic or not.
Default: null

labelsCenterBold
Whether the center label is bold or not.
Default: null

labelsCenterUnitsPre
Units that are pre-pended to the center label.
Default: null

labelsCenterUnitsPost
Units that are appended to the center label.
Default: null

labelsCenterPoint
The character that's used as the decimal point for the center label.
Default: null

labelsCenterThousand
The character that's used as the thousand separator for the center label.
Default: null

labelsCenterDecimals
The number of decimals to apply to the center label.
Default: null

labelsCenterSpecific
The specific text to use as the center label.
Default: null

labelsCenterFormatter
A function that's used as the formatter for the center label. This function should look like this:
labelsCenterFormatter: function (obj, num)
{
}

Default: null

Scale properties

PropertyDescriptionDefault
scaleWhether a scale is shown on the chart. If yes the minimum and maximum value that you give to the constructor will be used by default.false
scaleMinThis is the minimum value for the scale. This just affects the scale on the chart - not the bar itself. 0
scaleMaxThis is the maximum value for the scale. You don't have to give it and if you don't it will be the same as the max value that you give when you create the chart. This just affects the scale on the chart - not the bar that represents the value.null
scaleLabelsCountThis property allows you to stipulate how many labels there are on the scale.10
scaleLabelsColorThe color of the labels (defaults to the textColor property).null
scaleLabelsFontThe font of the labels (defaults to the textFont property)null
scaleLabelsSizeThe size of the labels (defaults to the textSize property)null
scaleLabelsBoldWhether the scale labels are bold or not (defaults to the textBold property)null
scaleLabelsItalicWhether the scale labels are italic or not (defaults to the textItalic property)null
scaleLabelsOffsetrIf you want to offset the scale labels (radially) you can do that with this property. 0
scaleLabelsOffsetxIf you want to offset the scale labels (in the horizontal direction) you can do that with this property. 0
scaleLabelsOffsetyIf you want to offset the scale labels (in the vertical direction) you can do that with this property. 0
scaleUnitsPreThese units are prepended to the scale numbers on the chart.A blank string
scaleUnitsPostThese units are appended to the scale numbers on the chart.A blank string
scaleDecimalsThis stipulates how many decimal places are shown on the scale numbers on the chart. 0
scalePointThe character that's used as the decimal point for the scale..
scaleThousandThe character that's used as the thousand separator for the scale.,
scaleFormatterIf you want to handle the formatting of the scale yourself you can do so with this property. It should be a function that returns the formatted number.null
scale
Whether a scale is shown on the chart. If yes the minimum and maximum value that you give to the constructor will be used by default.
Default: false

scaleMin
This is the minimum value for the scale. This just affects the scale on the chart - not the bar itself.
Default: 0

scaleMax
This is the maximum value for the scale. You don't have to give it and if you don't it will be the same as the max value that you give when you create the chart. This just affects the scale on the chart - not the bar that represents the value.
Default: null

scaleLabelsCount
This property allows you to stipulate how many labels there are on the scale.
Default: 10

scaleLabelsColor
The color of the labels (defaults to the textColor property).
Default: null

scaleLabelsFont
The font of the labels (defaults to the textFont property)
Default: null

scaleLabelsSize
The size of the labels (defaults to the textSize property)
Default: null

scaleLabelsBold
Whether the scale labels are bold or not (defaults to the textBold property)
Default: null

scaleLabelsItalic
Whether the scale labels are italic or not (defaults to the textItalic property)
Default: null

scaleLabelsOffsetr
If you want to offset the scale labels (radially) you can do that with this property.
Default: 0

scaleLabelsOffsetx
If you want to offset the scale labels (in the horizontal direction) you can do that with this property.
Default: 0

scaleLabelsOffsety
If you want to offset the scale labels (in the vertical direction) you can do that with this property.
Default: 0

scaleUnitsPre
These units are prepended to the scale numbers on the chart.
Default: A blank string

scaleUnitsPost
These units are appended to the scale numbers on the chart.
Default: A blank string

scaleDecimals
This stipulates how many decimal places are shown on the scale numbers on the chart.
Default: 0

scalePoint
The character that's used as the decimal point for the scale.
Default: .

scaleThousand
The character that's used as the thousand separator for the scale.
Default: ,

scaleFormatter
If you want to handle the formatting of the scale yourself you can do so with this property. It should be a function that returns the formatted number.
Default: null

Title properties

PropertyDescriptionDefault
titleThe title of the chart.(An empty string)
titleXThe specific x-axis coordinate of the title. This can also be a string that looks like this: "+10" or "-10" in which case it's added to the calculated position.null
titleYThe specific y-axis coordinate of the title. This can also be a string that looks like this: "+10" or "-10" in which case it's added to the calculated position.null
titleOffsetxAn offset value that is added to the calculated x-axis coordinate. 0
titleOffsetyAn offset value that is added to the calculated y-axis coordinate. 0
titleHalignThe horizontal alignment of the title.center
titleColorThe color of the title. It defaults to be the same as the textColor property.null
titleFontThe font used to render the title.null
titleSizeThe size of the font used to render the title. It defaults to be a little larger than the textSize property.null
titleBoldWhether the title is bold or not.null
titleItalicWhether the title is italic or not.null
titleSubtitleThe subtitle of the chart. If a subtitle is specified the title is moved up to accommodate it. As such you might need to give a larger marginTop value.(An empty string)
titleSubtitleColorThe color of the subtitle.#aaa
titleSubtitleFontThe font used to render the subtitle.null
titleSubtitleSizeThe size of the font used to render the subtitle.null
titleSubtitleBoldWhether the subtitle is bold or not.null
titleSubtitleItalicWhether the subtitle is italic or not.null
title
The title of the chart.
Default: (An empty string)

titleX
The specific x-axis coordinate of the title. This can also be a string that looks like this: "+10" or "-10" in which case it's added to the calculated position.
Default: null

titleY
The specific y-axis coordinate of the title. This can also be a string that looks like this: "+10" or "-10" in which case it's added to the calculated position.
Default: null

titleOffsetx
An offset value that is added to the calculated x-axis coordinate.
Default: 0

titleOffsety
An offset value that is added to the calculated y-axis coordinate.
Default: 0

titleHalign
The horizontal alignment of the title.
Default: center

titleColor
The color of the title. It defaults to be the same as the textColor property.
Default: null

titleFont
The font used to render the title.
Default: null

titleSize
The size of the font used to render the title. It defaults to be a little larger than the textSize property.
Default: null

titleBold
Whether the title is bold or not.
Default: null

titleItalic
Whether the title is italic or not.
Default: null

titleSubtitle
The subtitle of the chart. If a subtitle is specified the title is moved up to accommodate it. As such you might need to give a larger marginTop value.
Default: (An empty string)

titleSubtitleColor
The color of the subtitle.
Default: #aaa

titleSubtitleFont
The font used to render the subtitle.
Default: null

titleSubtitleSize
The size of the font used to render the subtitle.
Default: null

titleSubtitleBold
Whether the subtitle is bold or not.
Default: null

titleSubtitleItalic
Whether the subtitle is italic or not.
Default: null

Tooltip properties

PropertyDescriptionDefault
tooltipsAn array containing the single tooltip that the chart shows. You can also check the canvas tooltips documentation for more information.null
tooltipsOverrideThis can be a function that handles the tooltip showing instead of the default RGraph tooltips. It should look like this:
tooltipsOverride: function (obj, opt)
{
    // Show tooltip
}
The opt is an argument that contains these items:
  • object The chart object.
  • index The index of the element (that triggered the tooltip).
  • sequentialIndex The sequential index of the element that was clicked.
  • text The text to be used as the tooltip. Remember that this may contain html (or whatever else you may have specified).
  • event The event object (either a click or mousemove event).
null
tooltipsEventThe event used for tooltips (either click or mousemove.click
tooltipsFormattedPointWhen using formatted tooltip strings this is used as the point when using the %{value_formatted} option..
tooltipsFormattedThousandWhen using formatted tooltip strings this is used as the thousand separator when using the %{value_formatted} option.,
tooltipsFormattedDecimalsWhen using formatted tooltip strings this specifies the number of decimals when using the %{value_formatted} option. 0
tooltipsFormattedUnitsPreWhen using formatted tooltip strings these units are prepended to the number when using the %{value_formatted} option.(an empty string)
tooltipsFormattedUnitsPostWhen using formatted tooltip strings these units are appended to the number when using the %{value_formatted} option.(an empty string)
tooltipsFormattedKeyLabelsThe labels that are used in the formatted tooltip key.[] (an empty array)
tooltipsFormattedKeyColorsThe colors that are used in the formatted tooltip key. Normally these are automatically taken from the colors on the chart but can be specified differently using this property.null
tooltipsFormattedKeyColorsShapeThis is the shape that's used in the tooltip key. It can be square or circlesquare
tooltipsFormattedKeyColorsCss By using this property you can add css values to the key color shape that appears in the tooltip key. Note the property name is "color" and not "colors" like previous properties. It should be an object of css properties like this:
tooltipsFormattedKeyColorsCss : {
    border: "1px solid #ddd";
}
null
tooltipsFormattedListTypeWith this property you can switch between an unordered list (the default) and an ordered list. Possible values are ul and ol.ul
tooltipsFormattedListItemsThis should be a two-dimension array of the list items that are to be shown for all of the tooltips. An example of this property is:
tooltipsFormattedListItems: [
    ['Bill','Jerry','Berty'], // First tooltip
    ['Gill','Carrie','Lucy'], // Second tooltip
    ['Pob','Nobby','Hilda']   // Third tooltip
]
You can use css to style this list - for example:
.RGraph_tooltip ul#rgraph_formatted_tooltips_list li {
    text-align: left;
    color: yellow;
}
null
tooltipsFormattedTableHeadersWhen showing a table in the tooltips this can be an array of headers for the table. These are added to the tooltip using th tags.null
tooltipsFormattedTableDataThis is the data that is added to the table. This is a 3-dimensional array so it's easy to make a mistake. See the example in the canvas documentation, copy the code from it and then modify it suit. You'll create fewer bugs this way.null)
tooltipsPointerBy default the tooltips have a small triangular pointer that points to the shape that was clicked on. You can turn this off with this property.true
tooltipsPointerCssIf you want any css values applied to the tooltips pointer (a css border, for example) then specify an object containing those values to this property. For example:
tooltipsPointerCss: {
    borderLeft: 'gray 2px solid',
    borderBottom: 'gray 2px solid'
}
null
tooltipsPointerOffsetxThis allows you to adjust the horizontal position of the tooltips pointer. 0
tooltipsPointerOffsetyThis allows you to adjust the vertical position of the tooltips pointer. 0
tooltipsPositionStaticThe new default (as of August 2020) is for tooltips to be positioned statically and not be dependent on the mouse position. If you don't want this for whatever reason, you can disable it with this setting. When you set it to false tooltips are positioned next to the mouse pointer.true
tooltipsCssIf you want to specify some css that gets applied to all of the tooltips, but don't want to use the RGraph.SVG.tooltips.style object (which gets applied to all of the tooltips on the page for every chart) you can use this property to give some per-object css for the tooltips. These are css styles that get applied to all of the tooltips for the specific object only. It should look like this:
tooltipsCss: {
    fontFamily: 'Verdana',
    fontSize: '20pt'
}
null
tooltipsCssClassThe css class that's applied to the tooltip div.RGraph_tooltip
tooltipsOffsetxThis property allows you to shift the tooltips left or right. 0
tooltipsOffsetyThis property allows you to shift the tooltips up or down. 0
tooltips
An array containing the single tooltip that the chart shows. You can also check the canvas tooltips documentation for more information.
Default: null

tooltipsOverride
This can be a function that handles the tooltip showing instead of the default RGraph tooltips. It should look like this:
tooltipsOverride: function (obj, opt)
{
    // Show tooltip
}
The opt is an argument that contains these items:
Default: null

tooltipsEvent
The event used for tooltips (either click or mousemove.
Default: click

tooltipsFormattedPoint
When using formatted tooltip strings this is used as the point when using the %{value_formatted} option.
Default: .

tooltipsFormattedThousand
When using formatted tooltip strings this is used as the thousand separator when using the %{value_formatted} option.
Default: ,

tooltipsFormattedDecimals
When using formatted tooltip strings this specifies the number of decimals when using the %{value_formatted} option.
Default: 0

tooltipsFormattedUnitsPre
When using formatted tooltip strings these units are prepended to the number when using the %{value_formatted} option.
Default: (an empty string)

tooltipsFormattedUnitsPost
When using formatted tooltip strings these units are appended to the number when using the %{value_formatted} option.
Default: (an empty string)

tooltipsFormattedKeyLabels
The labels that are used in the formatted tooltip key.
Default: [] (an empty array)

tooltipsFormattedKeyColors
The colors that are used in the formatted tooltip key. Normally these are automatically taken from the colors on the chart but can be specified differently using this property.
Default: null

tooltipsFormattedKeyColorsShape
This is the shape that's used in the tooltip key. It can be square or circle
Default: square

tooltipsFormattedKeyColorsCss
By using this property you can add css values to the key color shape that appears in the tooltip key. Note the property name is "color" and not "colors" like previous properties. It should be an object of css properties like this:
tooltipsFormattedKeyColorsCss : {
    border: "1px solid #ddd";
}

Default: null

tooltipsFormattedListType
With this property you can switch between an unordered list (the default) and an ordered list. Possible values are ul and ol.
Default: ul

tooltipsFormattedListItems
This should be a two-dimension array of the list items that are to be shown for all of the tooltips. An example of this property is:
tooltipsFormattedListItems: [
    ['Bill','Jerry','Berty'], // First tooltip
    ['Gill','Carrie','Lucy'], // Second tooltip
    ['Pob','Nobby','Hilda']   // Third tooltip
]
You can use css to style this list - for example:
.RGraph_tooltip ul#rgraph_formatted_tooltips_list li {
    text-align: left;
    color: yellow;
}

Default: null

tooltipsFormattedTableHeaders
When showing a table in the tooltips this can be an array of headers for the table. These are added to the tooltip using th tags.
Default: null

tooltipsFormattedTableData
This is the data that is added to the table. This is a 3-dimensional array so it's easy to make a mistake. See the example in the canvas documentation, copy the code from it and then modify it suit. You'll create fewer bugs this way.
Default: null)

tooltipsPointer
By default the tooltips have a small triangular pointer that points to the shape that was clicked on. You can turn this off with this property.
Default: true

tooltipsPointerCss
If you want any css values applied to the tooltips pointer (a css border, for example) then specify an object containing those values to this property. For example:
tooltipsPointerCss: {
    borderLeft: 'gray 2px solid',
    borderBottom: 'gray 2px solid'
}

Default: null

tooltipsPointerOffsetx
This allows you to adjust the horizontal position of the tooltips pointer.
Default: 0

tooltipsPointerOffsety
This allows you to adjust the vertical position of the tooltips pointer.
Default: 0

tooltipsPositionStatic
The new default (as of August 2020) is for tooltips to be positioned statically and not be dependent on the mouse position. If you don't want this for whatever reason, you can disable it with this setting. When you set it to false tooltips are positioned next to the mouse pointer.
Default: true

tooltipsCss
If you want to specify some css that gets applied to all of the tooltips, but don't want to use the RGraph.SVG.tooltips.style object (which gets applied to all of the tooltips on the page for every chart) you can use this property to give some per-object css for the tooltips. These are css styles that get applied to all of the tooltips for the specific object only. It should look like this:
tooltipsCss: {
    fontFamily: 'Verdana',
    fontSize: '20pt'
}

Default: null

tooltipsCssClass
The css class that's applied to the tooltip div.
Default: RGraph_tooltip

tooltipsOffsetx
This property allows you to shift the tooltips left or right.
Default: 0

tooltipsOffsety
This property allows you to shift the tooltips up or down.
Default: 0

Highlight properties

PropertyDescriptionDefault
highlightStrokeThe color of the stroke of the highlight.rgba(0,0,0,0)
highlightFillThe color of the fill of the highlight.rgba(255,255,255,0.7)
highlightLinewidthThe linewidth of the stroke of the highlight.1
highlightStroke
The color of the stroke of the highlight.
Default: rgba(0,0,0,0)

highlightFill
The color of the fill of the highlight.
Default: rgba(255,255,255,0.7)

highlightLinewidth
The linewidth of the stroke of the highlight.
Default: 1

Other properties

PropertyDescriptionDefault
linewidthThe linewidth of the separating lines.1
adjustableThis property, when set to true, allows the Semi-circular Progress bar to be dynamically adjusted. There are three events which are asscociated with adjusting:
  • adjustbegin
  • adjust
  • adjustend
The adjustbegin event fires when you first click on the indicator bar - much like the mousedown event. The adjust event fires during adjusting - much like the mousemove event. And the adjustend event fires when you finish adjusting - much like the mouseup event. There's a demo of an adjustable chart in the download archive called demos/svg-scp-adjustable.html
false
responsiveThis option is new to the July 2023 release (v6.13) and allows you to inline the responsive configuration instead of appending it on to the end of the object it as a function. The documentation and demo pages have been updated to use this new option. You can read more about the responsive feature by reading the responsive configuration page.null
linewidth
The linewidth of the separating lines.
Default: 1

adjustable
This property, when set to true, allows the Semi-circular Progress bar to be dynamically adjusted. There are three events which are asscociated with adjusting:The adjustbegin event fires when you first click on the indicator bar - much like the mousedown event. The adjust event fires during adjusting - much like the mousemove event. And the adjustend event fires when you finish adjusting - much like the mouseup event. There's a demo of an adjustable chart in the download archive called demos/svg-scp-adjustable.html
Default: false

responsive
This option is new to the July 2023 release (v6.13) and allows you to inline the responsive configuration instead of appending it on to the end of the object it as a function. The documentation and demo pages have been updated to use this new option. You can read more about the responsive feature by reading the responsive configuration page.
Default: null

Methods

obj.get(name)

This can be used to get properties if necessary. It's normally used after the chart is drawn if you need to get parameters (if you're doing custom coding for example).

obj.set(name, value)

This can be used to set properties if necessary. It's normally used after the chart is drawn if you need to set additional parameters or change them.

obj.on(event, handler)

This function adds an event listener (such as beforedraw or draw) to the chart object. For example:

obj.on('draw', function (obj)
{
    // Put your code here
});
obj.exec(func)

This function can be used to execute a function (immediately). It's not event-based (ie it doesn't run when something happens) - it just runs immediately - and only once. You might use it when you need to get something from the chart when it's drawn and then call the RGraph.SVG.redraw function. Because this function only runs once the RGraph.SVG.redraw function would not cause a loop - which would happen if you used the draw event.

obj.exec(function (obj)
{
    // Put your code here
});
obj.responsive(configuration)

The responsive function helps your charts respond to different browser window sizes and screen resolutions. For example, for smaller screens, you might want to have angled labels or show shorter versions of them completely.

Update: There is now the responsive configuration option available to you and this is now the preferred method of configuration.

The responsive function and configuration option are documented on their own page here.

Events

RGraph supports custom events that allow you to easily add interactivity to your charts if required. The following events are available:

For example:
new RGraph.SVG.SemiCircularProgress({
    id: 'chart-container',
    min: 0,
    max: 100,
    value:50,
    options: {
    }
}).on('tooltip', function (obj)
{
    console.log('The draw event has fired');
    
}).draw();

Effects

These effects are available and can be used instead of the draw function.
<script>
    //
    // Optional callback function that's called when the effect is complete
    //
    function myCallback (obj)
    {
        // ...
    }

    new RGraph.SVG.SemiCircularProgress({
        id: 'chart-container',
        min: 0,
        max: 100,
        value: 84.99,
        options: {
            colors: ['Gradient(#faa:pink)'],
            labelsCenterUnitsPre: '$',
            labelsCenterDecimals: 2
        }
    }).grow({frames: 60, callback: myCallback});
</script>