Constructor
new MonitoringGraph($adiv, data_name, since_time_in_secs, database)
Parameters:
Name | Type | Description |
---|---|---|
$adiv |
Object | where the graph should show up |
data_name |
String | Array | name or list of data names |
since_time_in_secs |
Number | grab since a time seconds from 'now' |
database |
Object | object |
- Source:
Members
(private) graph
show the particular container (if hidden)
- Source:
(private, inner) __basenedm
Synchronize with the database, called by event handler
- Source:
Methods
addDataName(aname) → {boolean}
Add a variable name (or list of names) to the data to be shown
Parameters:
Name | Type | Description |
---|---|---|
aname |
string | Array | string or array of strings with variables to be added |
- Source:
Returns:
true if all could be added, otherwise false.
- Type
- boolean
changeTimeRange(prev_time, until_t, callback()) → {Object}
change the displayed time range. This reloads all the data, assuming
that none of it is 'good'.
Parameters:
Name | Type | Description |
---|---|---|
prev_time |
Object | previous time |
until_t |
Object | go until time. |
callback() |
function | called once everything is completed The function will be called without an argument if something went wrong. Otherwise it will be called with the object : { loaded : # entries, done : true/false, variable : variable name } |
- Source:
Returns:
returns an object with the
- Type
- Object
destroy()
Destroy the plot (like destructor). Stops listening, removes event handlers
- Source:
groupLevel() → {Number}
Get group level
1 = Year
2 = Month
3 = Day
4 = Hour
5 = Minute
6 = Second
> 6, no averaging
- Source:
Returns:
group level
- Type
- Number
name() → {Array}
Return name (variables)
- Source:
Returns:
list of names
- Type
- Array
removeBeforeDate(adate)
Remove all data before given date
Parameters:
Name | Type | Description |
---|---|---|
adate |
Object | particular date. |
- Source:
removeDataName(aname, callback)
Remove a variable name (or list of names) from the data to be shown
Parameters:
Name | Type | Description |
---|---|---|
aname |
string | Array | string or array of strings with variables to be removed |
callback |
function | function called after function is complete. |
- Source:
setGroupLevel(gl)
Set group level, or grouping used to average the data
1 = Year
2 = Month
3 = Day
4 = Hour
5 = Minute
6 = Second
> 6, no averaging
Parameters:
Name | Type | Description |
---|---|---|
gl |
Number | set group level |
- Source:
update()
Update the graph with current data, settings, etc.
- Source:
(private, inner) AppendData(r)
Append to the 'data' variable
Parameters:
Name | Type | Description |
---|---|---|
r |
Array | data to append |
- Source:
(private, inner) BeginListening()
Begin listening for changes
- Source:
(private, inner) DateFromKeyVal(obj) → {Object}
Get Date object from Key
Parameters:
Name | Type | Description |
---|---|---|
obj |
Array | key like accepted by nedm.dateFromKey |
- Source:
Returns:
- Type
- Object
(private, inner) EndListening()
Stop listening for changes
- Source:
(private, inner) HideContainer(ev, ui)
hide the particular container (if shown)
Parameters:
Name | Type | Description |
---|---|---|
ev |
Object | |
ui |
Object |
- Source:
(private, inner) MergeData(new_data)
Merge data in to data variable. This will ensure that data is in
chronological order.
Parameters:
Name | Type | Description |
---|---|---|
new_data |
Array | data to be merged in |
- Source:
(private, inner) PrependData(r)
Prepend to the 'data' variable
Parameters:
Name | Type | Description |
---|---|---|
r |
Array | data to prepend |
- Source:
(private, inner) RecalcAxisLabels()
Recalculate what the axis labels should be.
- Source:
(private, inner) ShowContainer(ev, ui)
show the particular container (if hidden)
Parameters:
Name | Type | Description |
---|---|---|
ev |
Object | |
ui |
Object |
- Source: