@alicloud/cloud-charts
Version:

79 lines (78 loc) • 1.81 kB
JavaScript
"use strict";
exports.__esModule = true;
exports.ellipsisCustomText = ellipsisCustomText;
var _core = require("@antv/g2/esm/core");
// 更新legendValue的省略文本显示
(0, _core.registerInteraction)('ellipsis-custom-text', {
start: [{
trigger: 'legend-item-name:mousemove',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}, {
trigger: 'legend-item-name:touchstart',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}, {
trigger: 'legend-item-value:mousemove',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}, {
trigger: 'legend-item-value:touchstart',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}, {
trigger: 'axis-label:mousemove',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}, {
trigger: 'axis-label:touchstart',
action: 'ellipsis-text:show',
throttle: {
wait: 50,
leading: true,
trailing: false
}
}],
end: [{
trigger: 'legend-item-name:mouseleave',
action: 'ellipsis-text:hide'
}, {
trigger: 'legend-item-name:touchend',
action: 'ellipsis-text:hide'
}, {
trigger: 'legend-item-value:mouseleave',
action: 'ellipsis-text:hide'
}, {
trigger: 'legend-item-value:touchend',
action: 'ellipsis-text:hide'
}, {
trigger: 'axis-label:mouseleave',
action: 'ellipsis-text:hide'
}, {
trigger: 'axis-label:touchend',
action: 'ellipsis-text:hide'
}]
});
function ellipsisCustomText(view) {
view.interaction('ellipsis-custom-text');
}