UNPKG

1.15 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var base_1 = require("../base");
5var get_style_1 = require("../util/get-style");
6var util_1 = require("./util");
7/** 漏斗图 */
8(0, base_1.registerShape)('interval', 'funnel', {
9 getPoints: function (shapePoint) {
10 shapePoint.size = shapePoint.size * 2; // 漏斗图的 size 是柱状图的两倍
11 return (0, util_1.getRectPoints)(shapePoint);
12 },
13 draw: function (cfg, container) {
14 var style = (0, get_style_1.getStyle)(cfg, false, true);
15 var path = this.parsePath((0, util_1.getFunnelPath)(cfg.points, cfg.nextPoints, false));
16 var shape = container.addShape('path', {
17 attrs: tslib_1.__assign(tslib_1.__assign({}, style), { path: path }),
18 name: 'interval',
19 });
20 return shape;
21 },
22 getMarker: function (markerCfg) {
23 var color = markerCfg.color;
24 return {
25 symbol: 'square',
26 style: {
27 r: 4,
28 fill: color,
29 },
30 };
31 },
32});
33//# sourceMappingURL=funnel.js.map
\No newline at end of file