Namespace: lineChart

db.libs.lineChart

Draw simple line chart.

Source:

Methods

(static) init(idopt, optionsopt) → {array}

Initialize the component

Parameters:
Name Type Attributes Description
id external:jQuery | string <optional>
Selector or jQuery element
options object <optional>
Options can be passed to init or read from the data-options attribute on the element
Properties
Name Type Attributes Default Description
series array <optional>
Values used to create the chart
max number <optional>
null Highest y-axis value for the chart
pointRadius number <optional>
5 Radius for each point gives as px
smooth boolean <optional>
false Smoothe curves
gridXSteps number <optional>
null
gridXStepEvery number <optional>
null
gridYSteps number <optional>
null
Source:
Returns:
Returns array of all targeted elements
Type
array

(private, static) line(options, s) → {object}

Calculates path and points for a line

Parameters:
Name Type Description
options object
s number Index of line to calculate
Source:
Returns:
Type
object

(private, static) render(idopt) → {external:jQuery}

Render the chart

Parameters:
Name Type Attributes Description
id external:jQuery | string <optional>
Selector or jQuery element
Source:
Fires:
  • event:rendered
Returns:
jQuery element
Type
external:jQuery

(static) series(idopt, data) → {external:jQuery}

Updates data for the chart

Parameters:
Name Type Attributes Description
id external:jQuery | string <optional>
Selector or jQuery element
data array Series data. Accepts array or string that can be parsed to array using JSON.parse
Source:
Returns:
jQuery element
Type
external:jQuery

(static) stream(id, data, duration) → {external:jQuery}

Animates chart to values to in series.

Parameters:
Name Type Description
id external:jQuery | string Selector or jQuery element
data array Series data to add
duration string Duration for animation
Source:
Returns:
jQuery element
Type
external:jQuery

(static) update(id) → {external:jQuery}

Animates chart to values to in series.

Parameters:
Name Type Description
id external:jQuery | string Selector or jQuery element
Source:
Returns:
jQuery element
Type
external:jQuery