UNPKG

1.95 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var base_1 = require("../base");
5var constant_1 = require("../constant");
6var get_style_1 = require("../util/get-style");
7var util_1 = require("./util");
8/** 描边柱状图 */
9(0, base_1.registerShape)('interval', 'hollow-rect', {
10 draw: function (cfg, container) {
11 var style = (0, get_style_1.getStyle)(cfg, true, false);
12 var group = container;
13 var backgroundCfg = cfg === null || cfg === void 0 ? void 0 : cfg.background;
14 if (backgroundCfg) {
15 group = container.addGroup();
16 var backgroundStyle = (0, get_style_1.getBackgroundRectStyle)(cfg);
17 var backgroundPath = (0, util_1.getBackgroundRectPath)(cfg, this.parsePoints(cfg.points), this.coordinate);
18 group.addShape('path', {
19 attrs: tslib_1.__assign(tslib_1.__assign({}, backgroundStyle), { path: backgroundPath }),
20 zIndex: -1,
21 name: constant_1.BACKGROUND_SHAPE,
22 });
23 }
24 var path = this.parsePath((0, util_1.getRectPath)(cfg.points));
25 var shape = group.addShape('path', {
26 attrs: tslib_1.__assign(tslib_1.__assign({}, style), { path: path }),
27 name: 'interval',
28 });
29 return backgroundCfg ? group : shape;
30 },
31 getMarker: function (markerCfg) {
32 var color = markerCfg.color, isInPolar = markerCfg.isInPolar;
33 if (isInPolar) {
34 return {
35 symbol: 'circle',
36 style: {
37 r: 4.5,
38 stroke: color,
39 fill: null,
40 },
41 };
42 }
43 return {
44 symbol: 'square',
45 style: {
46 r: 4,
47 stroke: color,
48 fill: null,
49 },
50 };
51 },
52});
53//# sourceMappingURL=hollow-rect.js.map
\No newline at end of file