Odometer charts documentation

Important note!
The options green.solid, yellow.solid and red.solid have all been retired. By default the
green/yellow/red colors are all solid. Gradients can still be applied but by using the new easy gradient syntax:
obj.set('green.color', 'Gradient(white:green)');

title.xTo give the exact X coordinate for the title - use thisDefault: null

title.yTo give the exact Y coordinate for the title - use thisDefault: null

Shadow

shadow.innerWhether a drop shadow is applied to the inner circle of the OdometerDefault: false

shadow.inner.colorThe color for the inner shadow.Default: black

shadow.inner.offsetxThe X offset for the inner shadow.Default: 3

shadow.inner.offsetyThe Y offset for the inner shadow.Default: 3

shadow.inner.blurThe extent of the blurring effect on the shadow.Default: 6

shadow.outerWhether a drop shadow is applied to the whole Odometer.Default: false

shadow.outer.colorThe color for the outer shadow.Default: black

shadow.outer.offsetxThe X offset for the outer shadow.Default: 3

shadow.outer.offsetyThe Y offset for the outer shadow.Default: 3

shadow.outer.blurThe extent of the blurring effect on the shadow.Default: 6

Interactive features

contextmenuAn array of context menu items. More information on context menus is here.Default: An empty array

annotatableWhether annotations are enabled for the chart (ie you can draw on the chart interactively.Default: false

annotate.colorIf you do not allow the use of the palette, then this will be the only colour allowed for annotations.Default: black

annotate.linewidthThis is the line width of the annotations.Default: 1

resizableDefaulting to false, this determines whether your chart 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

resize.handle.backgroundWith this you can specify the background color for the resize handle. If you're adjusting the position of the handle then you may need this to make the handle stand out more.Default: null

adjustableYou can make the Odometer interactively adjustable by setting this to true.Default: false

Zoom

zoom.factorThis is the factor that the chart will be zoomed by (bigger values means more zoom)Default: 1.5

zoom.fade.inWhether 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

zoom.fade.outWhether 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

zoom.shadowWhether or not the zoomed canvas has a shadow or not.Default: true

Scale

units.preThe units that the value is measured in. This string is displayed BEFORE the actual number, allowing you to specify values such as "$50" and is only used if value.text is true.Default: none

units.postThe units that the value is measured in. This string is displayed AFTER the actual number, allowing you to specify values such as "50ms" and is only used if value.text is true.Default: none

scale.decimalsThe number of decimal places to display for the labels.Default: 0

scale.pointThe character used as the decimal point.Default: .

scale.thousandThe character used as the thousand separatorDefault: ,

Miscellaneous

cleartoThis is used in animations and effects as the default color to use when the canvas.Default: null

Methods

obj.get(name)
An accessor that you can use to retrieve the value of properties.

obj.set(name, value)
An accessor that you can use to set the value of properties.

obj.getAngle(value)
This method will return you an appropriate angle for the given value.

obj.on(event, func)

This method can be used to set an event listener on an object. It operates in a similar way to the jQuery .on() function -
the first argument is the event you wish to attach to and the second is the handler function. For example:

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

The function is useful if you use method chaining when creating your charts: