r3-legacy/src/r3-graph-metric.js

62 lines
1.2 KiB
JavaScript

/**
* R3.Graph.Metric
* @param apiComponent
* @constructor
*/
R3.Graph.Metric = function(
apiComponent
) {
__RUNTIME_COMPONENT__;
this.linkedComponents.domElements = [R3.DomElement];
R3.Graph.call(
this,
true
);
};
R3.Graph.Metric.prototype = Object.create(R3.Graph.prototype);
R3.Graph.Metric.prototype.constructor = R3.Graph.Metric;
/**
* Updates the instance with the current state
*/
R3.Graph.Metric.prototype.createInstance = function() {
this.instance = true;
__CREATE_INSTANCE__;
};
/**
* Updates the instance with the current state
*/
R3.Graph.Metric.prototype.updateInstance = function(property) {
if (property === 'query') {
this.domElements.map(
function(domElement, index) {
if (this.query instanceof R3.Query.Alerts.Summary) {
if (R3.Utils.UndefinedOrNull(this.query.priorities[index])) {
domElement.instance.innerHTML = 0;
} else {
domElement.instance.innerHTML = this.query.priorities[index];
}
}
}.bind(this)
)
}
R3.Graph.prototype.updateInstance.call(this, property);
};