Add rickshawGraph proerty to the Graph object. (#2438)

Add rickshawGraph property to the Graph object.

This allows further changes to be made to the graph, for example,
annotations.
This commit is contained in:
Derek Marcotte 2017-02-18 05:03:32 -05:00 committed by Brian Brazil
parent 089dc1076b
commit 74a3b1051a
1 changed files with 6 additions and 0 deletions

View File

@ -332,6 +332,9 @@ PromConsole.Graph = function(params) {
this.params = params;
this.rendered_data = null;
// Keep a reference so that further updates (e.g. annotations) can be made
// by the user in their templates.
this.rickshawGraph = null;
PromConsole._graph_registry.push(this);
/*
@ -504,6 +507,8 @@ PromConsole.Graph.prototype._render = function(data) {
xAxis.render();
yAxis.render();
graph.render();
this.rickshawGraph = graph;
};
PromConsole.Graph.prototype._clearGraph = function() {
@ -513,6 +518,7 @@ PromConsole.Graph.prototype._clearGraph = function() {
while (this.legendDiv.lastChild) {
this.legendDiv.removeChild(this.legendDiv.lastChild);
}
this.rickshawGraph = null;
};
PromConsole.Graph.prototype._xhrs = [];