UNPKG

@antv/g2plot

Version:

G2 Plot, a market of plots built with the Grammar of Graphics'

22 lines 890 B
import { __extends } from "tslib"; import { registerElementLabels } from '@antv/g2'; import { BarLabels } from '../../../bar/component/label/bar-label'; var StackBarLabels = /** @class */ (function (_super) { __extends(StackBarLabels, _super); function StackBarLabels() { return _super !== null && _super.apply(this, arguments) || this; } StackBarLabels.prototype.adjustPosition = function (label, shape) { var labelRange = label.getBBox(); var shapeRange = shape.getBBox(); if (shapeRange.width <= labelRange.width) { label.attr('opacity', 0); label.attr('fillOpacity', 0); label.attr('strokeOpacity', 0); label.set('capture', false); } }; return StackBarLabels; }(BarLabels)); registerElementLabels('stackBarLabel', StackBarLabels); //# sourceMappingURL=stack-bar-label.js.map