2021-06-21 23:47:23 +08:00

75 lines
2.3 KiB
JavaScript

(window.webpackJsonp = window.webpackJsonp || []).push([
[29],
{
'92Sg': function(a, n, t) {
a.exports = { chartWrap: 'chartWrap___30-Sf', chartTitle: 'chartTitle___2mS0O' };
},
gLoU: function(a, n, t) {
'use strict';
t.r(n);
var m = t('k1fw'),
E = t('4ASp'),
T = t.n(E),
o = t('q1tI'),
i = t.n(o),
c = t('qgaN'),
P = t.n(c),
v = t('92Sg'),
d = t.n(v),
O = e => {
var l = e.isTpl,
u = e.data,
h = e.color,
R = e.size,
U = e.paddingTop,
D = e.title,
f = Object(o.useRef)(null);
return (
Object(o.useEffect)(() => {
if (!l) {
var _ = new E.Chart({
el: f.current || void 0,
pixelRatio: window.devicePixelRatio,
}),
M = u.map(r => Object(m.a)(Object(m.a)({}, r), {}, { value: Number(r.value) }));
_.source(M, { value: { tickCount: 5, min: 0 } }),
_.tooltip({ showCrosshairs: !0, showItemMarker: !1 }),
_.axis('name', {
label: function(x, p, g) {
var s = {};
return (
p === 0 ? (s.textAlign = 'left') : p === g - 1 && (s.textAlign = 'right'), s
);
},
}),
_.line().position('name*value'),
_.point()
.position('name*value')
.style({ stroke: '#fff', lineWidth: 1 }),
_.render();
}
}, [u, l]),
i.a.createElement(
'div',
{ className: d.a.chartWrap },
i.a.createElement(
'div',
{ className: d.a.chartTitle, style: { color: h, fontSize: R, paddingTop: U } },
D,
),
l
? i.a.createElement('img', { src: P.a, alt: 'dooring chart' })
: i.a.createElement('canvas', { ref: f }),
)
);
};
n.default = Object(o.memo)(O);
},
qgaN: function(a, n, t) {
a.exports = t.p + 'static/line.95d1bfba.png';
},
},
]);
//# sourceMappingURL=29.js.map