@spalger/kibana
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
29 lines (23 loc) • 601 B
JavaScript
define(function () {
return function ZeroFilledArrayUtilService() {
var _ = require('lodash');
/*
* Accepts an array of x axis values (strings or numbers).
* Returns a zero filled array.
*/
return function (arr) {
if (!_.isArray(arr)) {
throw new Error('ZeroFilledArrayUtilService expects an array of strings or numbers');
}
var zeroFilledArray = [];
arr.forEach(function (val) {
zeroFilledArray.push({
x: val,
xi: Infinity,
y: 0
});
});
return zeroFilledArray;
};
};
});