Index | OAT homepage | OpenLink Software

# OATDOCsparqline

- OATDOCsparqline
- _ _ sparkline.js
- _ _ _ _ Objects
- _ _ _ _ _ _ OAT.Sparkline(div, options)
- _ _ _ _ Methods
- _ _ _ _ _ _ OAT.Sparkline::attachData(dataArray)
- _ _ _ _ _ _ OAT.Sparkline::draw()
- _ _ _ _ Example

## sparkline.js

Library for drawing Sparklines using SVG.

### Objects

#### OAT.Sparkline(div, options)

Creates a `Sparkline` inside `div` ; `options` describes its properties. Its values are the same as in OAT.LineChart. Options can be following:

- `axes` - display axes? (bool, default `false` )
- `grid` - display grid? (bool, default `false` )
- `legend` - display legend? (bool, default `false` )
- `gridDesc` - display grid description? (bool, default `false` )
- `desc` - display description? (bool, default `false` )
- `paddingLeft` - (default `2` )
- `paddingTop` - (default `2` )
- `paddingRight` - (default `1` )
- `paddingBottom` - (default `2` )
- `colors` - array of colors (default `["#888"]` )
- `markers` - array of markers (default `[OAT.LineChartMarker.MARKER_NONE]` ) (see OAT.LineChart constants)

### Methods

#### OAT.Sparkline::attachData(dataArray)

Adds `dataArray` to the Sparkline.

#### OAT.Sparkline::draw()

Draws the Sparkline.

### Example

    var s = new OAT.Sparkline("myDiv",{});
    s.attachData([1,2,3,-5,2,3.7,5,4]);
    s.draw();

Copyright (C) 2005-2008 OpenLink Software