获取方式:
const Util = F2.Util;

方法

upperFirst

upperFirst(s)

lowerFirst

lowerFirst(s)

isString

isString(value)

isNumber

isNumber(value)

isBoolean

isBoolean(value)

isFunction

isFunction(fn)

isArray

isArray(value)

isDate

isDate(value)

isNil

isNil(o)

isObject

isObject(value)

deepMix

deepMix(target, source1, source2 source3)

mix

mix(target, source1, source2 source3)

indexOf

indexOf(arr, element)

each

each(elements, func)
Util.each([ 1, 2, 3 ], (val, index) => {
  console.log('每项的值', val);
  console.log('索引', index);
});

Util.each([ 1, 2, 3, 4, 5 ], (val, index) => {
 if (val === 4) {
   return false; // 跳出循环
 }
});

getPixelRatio

getPixelRatio()

getRelativePosition

getRelativePosition(point, canvas)
const chart = new Chart({});

const mousePoint = {
  x: 10,
  y:39
};

const canvasPoint = F2.Util.getRelativePosition(mousePoint, chart.get('canvas'));