Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
convertToData: function(values) {
let util = JUI.include('util.base');
let data = [];
for(let i = 0; i < values.length; i++) {
let val = values[i];
if(util.typeCheck('array', val)) {
data.push({
'0': val[0],
'1': val[1]
});
}
}
return data;
},
initGraphAxes: function() {
beforeMount: function() {
const _ = JUI.include('util.base')
let colors = !this.colors ? [ 0, 1 ] : this.colors;
let options = {
type: 'area',
clip: this.clip,
symbol: this.shape,
opacity: this.opacity,
line: this.borderLine,
display: this.display
}
this.brushes = [
_.extend({ target: '0', axis: 0, colors: [ colors[0] ] }, options),
_.extend({ target: '1', axis: 1, colors: [ colors[1] ] }, options)
]
beforeMount: function() {
const _ = JUI.include('util.base')
let colors = !this.colors ? [ 1, 2 ] : this.colors;
let options = {
type: 'bar',
clip: this.clip,
active: this.activeIndex,
activeEvent: this.activeEvent,
display: this.display,
size: this.fixedSize,
minSize: this.minValue,
outerPadding: this.barMargin,
innerPadding: this.barPadding
}
this.brushes = [
beforeMount: function(e) {
const time = jui.include('util.time');
const format = this.$parent.axisFormat;
let formatFunc = function(value) {
if(typeof(value) == 'object' && typeof(format) == 'string') {
return time.format(value, format);
} else if(typeof(value) == 'number') {
return Math.round(value);
}
return value;
}
let opts = { type: 'cross' };
if(this.tooltipX) opts.xFormat = formatFunc;
if(this.tooltipY) opts.yFormat = formatFunc;
convertToData: function(values) {
let util = JUI.include('util.base');
let data = [];
for(let i = 0; i < values.length; i++) {
let val = values[i];
if(util.typeCheck('array', val)) {
for(let j = 0; j < val.length; j++) {
if(i == 0) {
data.push({});
}
let row = data[j];
row[''+i] = val[j]
}
} else if(util.typeCheck('number', val)) {
data.push({ '0' : val });