Class: Graph

Graph(labels, values, colours, title, opts)

Graph is a wrapper-class for a Dygraph element (see https://dygraphs.com/). It is attached to the DOM-windows, and stores all values to be plotted, colours, title, axis names, etc.

Constructor

new Graph(labels, values, colours, title, opts)

The constructor function for a @Canvas object.
Parameters:
Name Type Description
labels Array array of strings containing the labels for datapoints (e.g. for the legend)
values Array Array of floats to plot (here plotted over time)
colours Array Array of colours to use for plotting
title String Title of the plot
opts Object dictionary-style list of opts to pass onto dygraphs
Source:

Methods

push_data(array)

Push data to your graph-element
Parameters:
Name Type Description
array array of floats to be added to the dygraph object (stored in 'data')
Source:

update()

Update the graph axes
Source: