Class

Monitoring

Monitoring()

Helper Monitoring

This plugin only can represent three states. Those states can be configurated by parameters that adjust the color, the icon and the values. All params are required

Params:

  • element: HTML element where the graph will be included
  • orig: object with two required vars: keys and dataMatrix. keys is an array of objects with the names of values of dataMatrix inthe same order. dataMatrix is an array of elements with the values to count and show.
  • options: is an object with the params to configure the graph.

Settings object:

  • colors: Array with three elements. The first element represent success val, the second element represent a middle value and the third element represente the fail case. Each one of colors has to be in hexadecimal representation. Default values: 'green', 'orange', 'red'

  • icons: Array with three elements. The first element represent success val, the second element represent a middle value and the third element represente the fail case. Each one of icons has to be a css class representation of the image. Default values: 'icon-ok-sign', 'icon-minus-sign', 'icon-remove-sign'

  • heightdefault: Integer that represents the height of the indicators. Default value: 200

  • itemsbyrow: Number of items to show by row. Default value: 4

  • rules: is an array with two objects. The first object define the roule for success state and the second object define the roule for the fail state. Each object must contain a operator and value. The operator can be any logical operator (>,<, ==, <=, =>, !=). The value must be the value to compare. Default: [{operator: '>=', value: 66.66},{operator: '<', value: 33.33}]

  • keyToShow (REQUIRED): column name to count

  • valToShow (REQUIRED): val to show

  • is_percent: Indicate if the comparation of rules must be with percent. Default true

Constructor

# new Monitoring()

View Source widgets/helpers/monitoring.js, line 44

Methods

# getDataFormated(data) → {Array}

returns an array by summing the values (valToShow) and the total elements grouped by keyToShow

Parameters:
Name Type Description
data Array

received from malote

View Source widgets/helpers/monitoring.js, line 103

Array

# getHTML(data) → {string}

return the html

Parameters:
Name Type Description
data Array

View Source widgets/helpers/monitoring.js, line 130

string

# getKeyFromName(arr, value) → {integer|null}

return the element key value with the name atributte equal to value

Parameters:
Name Type Description
arr Array
value string

View Source widgets/helpers/monitoring.js, line 91

item key match

integer | null