function registerAction(actionInfo, eventName, action) {
    if (typeof eventName === 'function') {
        action = eventName;
        eventName = '';
    }
    var actionType = isObject(actionInfo)
        ? actionInfo.type
        : ([actionInfo, actionInfo = {
            event: eventName
        }][0]);

    // Event name is all lowercase
    actionInfo.event = (actionInfo.event || actionType).toLowerCase();
    eventName = actionInfo.event;

    // Validate action type and event name.
    assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName));

    if (!actions[actionType]) {
        actions[actionType] = {action: action, actionInfo: actionInfo};
    }
    eventActionMap[eventName] = actionType;
}
ZRender need a canvas context to do measureText.
But in node environment canvas may be created by node-canvas.
So we need to specify how to create a canvas instead of using document.createElement('canvas')

Be careful of using it in the browser.

@param {Function} creator
@example
    var Canvas = require('canvas');
    var echarts = require('echarts');
    echarts.setCanvasCreator(function () {
        // Small size is enough.
        return new Canvas(32, 32);
    });