@silurus/ooxml 0.37.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{pptx-CzgfHii0.js → pptx-B4bzY-ys.js} +94 -91
- package/dist/pptx-Vh3arrVy.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/{renderer-DsT75h1z.js → renderer-DPbqSkJP.js} +173 -141
- package/dist/renderer-DidRO7K7.cjs +1 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/pptx.d.ts +6 -0
- package/dist/types/xlsx.d.ts +9 -0
- package/dist/xlsx-CZeq7mm7.cjs +11 -0
- package/dist/xlsx-DjmuUdn1.js +3196 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +2 -2
- package/dist/pptx-gWByFXpk.cjs +0 -1
- package/dist/renderer-8yNL4LpS.cjs +0 -1
- package/dist/xlsx-CU5kEVSN.cjs +0 -11
- package/dist/xlsx-DF_d5tXa.js +0 -3193
|
@@ -222,24 +222,37 @@ function p(e, t) {
|
|
|
222
222
|
function m(e, t, n, r, i, a, o, s) {
|
|
223
223
|
e.save(), e.font = `${s}px sans-serif`, e.fillStyle = "#555", o === "cat" ? (e.textAlign = "center", e.textBaseline = "bottom", e.fillText(t.slice(0, 30), n + i / 2, r + a + s + 2)) : (e.translate(n - s - 4, r + a / 2), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", e.fillText(t.slice(0, 30), 0, 0)), e.restore();
|
|
224
224
|
}
|
|
225
|
-
function h(e
|
|
225
|
+
function h(e) {
|
|
226
|
+
return e && (e === "line" || e === "stackedLine" || e === "stackedLinePct" || e === "radar" || e === "scatter") ? "line" : "fill";
|
|
227
|
+
}
|
|
228
|
+
function g(e, t, n, r, i, a, o) {
|
|
229
|
+
if (e.fillStyle = n, t === "line") {
|
|
230
|
+
e.strokeStyle = n;
|
|
231
|
+
let t = e.lineWidth;
|
|
232
|
+
e.lineWidth = Math.max(1.5, o * .15), e.beginPath();
|
|
233
|
+
let s = i + o / 2;
|
|
234
|
+
e.moveTo(r, s), e.lineTo(r + a, s), e.stroke(), e.lineWidth = t;
|
|
235
|
+
} else e.fillRect(r, i, a, o);
|
|
236
|
+
}
|
|
237
|
+
function _(e, n, r, i, a, o, s = "vertical", c) {
|
|
238
|
+
let l = h(c);
|
|
226
239
|
if (s === "horizontal") {
|
|
227
240
|
let s = Math.max(9, Math.min(12, o * .7));
|
|
228
241
|
e.font = `${s}px sans-serif`, e.textBaseline = "middle";
|
|
229
|
-
let c = n.map((e, t) => e.name || `Series ${t + 1}`),
|
|
230
|
-
for (let r = 0; r < n.length; r++) e
|
|
242
|
+
let c = n.map((e, t) => e.name || `Series ${t + 1}`), u = c.map((t) => 14 + e.measureText(t.slice(0, 30)).width), d = r + (a - (u.reduce((e, t) => e + t, 0) + 12 * Math.max(0, n.length - 1))) / 2, f = i + o / 2;
|
|
243
|
+
for (let r = 0; r < n.length; r++) g(e, l, t(r, n[r]), d, f - s / 2, 10, s), e.fillStyle = "#333", e.textAlign = "left", e.fillText(c[r].slice(0, 30), d + 10 + 4, f), d += u[r] + 12;
|
|
231
244
|
return;
|
|
232
245
|
}
|
|
233
|
-
let
|
|
234
|
-
e.font = `${
|
|
235
|
-
let
|
|
246
|
+
let u = Math.max(9, Math.min(12, o / (n.length + 1)));
|
|
247
|
+
e.font = `${u}px sans-serif`, e.textBaseline = "middle";
|
|
248
|
+
let d = u + 4, f = i + (o - d * n.length) / 2;
|
|
236
249
|
for (let i = 0; i < n.length; i++) {
|
|
237
|
-
e
|
|
250
|
+
g(e, l, t(i, n[i]), r, f, 10, u), e.fillStyle = "#333", e.textAlign = "left";
|
|
238
251
|
let a = n[i].name || `Series ${i + 1}`;
|
|
239
|
-
e.fillText(a.slice(0, 20), r + 10 + 4,
|
|
252
|
+
e.fillText(a.slice(0, 20), r + 10 + 4, f + u / 2), f += d;
|
|
240
253
|
}
|
|
241
254
|
}
|
|
242
|
-
function
|
|
255
|
+
function v(e, t, n) {
|
|
243
256
|
if (!e.showLegend) return null;
|
|
244
257
|
let r = e.legendPos ?? "r", i = r === "l" ? "l" : r === "t" ? "t" : r === "b" ? "b" : "r";
|
|
245
258
|
return i === "r" || i === "l" ? {
|
|
@@ -252,30 +265,30 @@ function g(e, t, n) {
|
|
|
252
265
|
reserveH: Math.max(18, n * .08)
|
|
253
266
|
};
|
|
254
267
|
}
|
|
255
|
-
function
|
|
268
|
+
function y(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
256
269
|
if (!n) return;
|
|
257
270
|
let f = t.legendManualLayout;
|
|
258
271
|
if (f && f.xMode === "edge" && f.yMode === "edge" && f.w > 0 && f.h > 0) {
|
|
259
272
|
let n = r + f.x * a, s = i + f.y * o, c = f.w * a, l = f.h * o, u = c >= l ? "horizontal" : "vertical";
|
|
260
|
-
|
|
273
|
+
_(e, t.series, n, s, c, l, u, t.chartType);
|
|
261
274
|
return;
|
|
262
275
|
}
|
|
263
276
|
switch (n.side) {
|
|
264
277
|
case "r":
|
|
265
|
-
|
|
278
|
+
_(e, t.series, r + a - n.reserveW + 4, c, n.reserveW - 8, u, "vertical", t.chartType);
|
|
266
279
|
break;
|
|
267
280
|
case "l":
|
|
268
|
-
|
|
281
|
+
_(e, t.series, r + 4, c, n.reserveW - 8, u, "vertical", t.chartType);
|
|
269
282
|
break;
|
|
270
283
|
case "t":
|
|
271
|
-
|
|
284
|
+
_(e, t.series, s, i + d, l, n.reserveH, "horizontal", t.chartType);
|
|
272
285
|
break;
|
|
273
286
|
case "b":
|
|
274
|
-
|
|
287
|
+
_(e, t.series, s, i + o - n.reserveH, l, n.reserveH, "horizontal", t.chartType);
|
|
275
288
|
break;
|
|
276
289
|
}
|
|
277
290
|
}
|
|
278
|
-
function
|
|
291
|
+
function b(e, t, n, r, i, a, o) {
|
|
279
292
|
if (t === "none" || !t) return;
|
|
280
293
|
let s = o ? Math.max(4, o + 2) : 4, c = e.strokeStyle, l = e.lineWidth;
|
|
281
294
|
if (e.strokeStyle = a ?? "#888", e.lineWidth = o ?? 1, e.beginPath(), n === "val") {
|
|
@@ -287,16 +300,16 @@ function v(e, t, n, r, i, a, o) {
|
|
|
287
300
|
}
|
|
288
301
|
e.stroke(), e.strokeStyle = c, e.lineWidth = l;
|
|
289
302
|
}
|
|
290
|
-
function
|
|
303
|
+
function x(e, t, n) {
|
|
291
304
|
return e.titleFontSizeHpt ? e.titleFontSizeHpt / 100 * n : Math.max(10, t * .085);
|
|
292
305
|
}
|
|
293
|
-
function
|
|
306
|
+
function S(e, t, n) {
|
|
294
307
|
return e ? e / 100 * n : Math.max(8, t * .045);
|
|
295
308
|
}
|
|
296
|
-
function
|
|
309
|
+
function C(e, t, n, r, i, a) {
|
|
297
310
|
t.title && (e.font = `bold ${a}px ${t.titleFontFace ? `"${t.titleFontFace}", Calibri, Arial, sans-serif` : "Calibri, Arial, sans-serif"}`, e.fillStyle = t.titleFontColor ? `#${t.titleFontColor}` : "#333", e.textAlign = "center", e.textBaseline = "top", e.fillText(t.title, n + i / 2, r));
|
|
298
311
|
}
|
|
299
|
-
function
|
|
312
|
+
function w(e) {
|
|
300
313
|
if (e.categories.length > 0) return e.categories;
|
|
301
314
|
let t = e.series[0];
|
|
302
315
|
if (t?.categories && t.categories.length > 0) return t.categories;
|
|
@@ -304,7 +317,7 @@ function S(e) {
|
|
|
304
317
|
for (let t of e.series) t.values.length > n && (n = t.values.length);
|
|
305
318
|
return n > 0 ? Array.from({ length: n }, (e, t) => String(t + 1)) : [];
|
|
306
319
|
}
|
|
307
|
-
function
|
|
320
|
+
function T(e, t, n, r, i, a, o, s, c) {
|
|
308
321
|
let l = s ?? "outEnd";
|
|
309
322
|
if (e.fillStyle = c ? `#${c}` : "#333", o === "vertical") {
|
|
310
323
|
let o = n + a / 2;
|
|
@@ -314,23 +327,23 @@ function C(e, t, n, r, i, a, o, s, c) {
|
|
|
314
327
|
l === "inBase" ? (e.textAlign = "left", e.textBaseline = "middle", e.fillText(t, n + 4, o)) : l === "inEnd" ? (e.textAlign = "right", e.textBaseline = "middle", e.fillText(t, n + i - 4, o)) : l === "ctr" ? (e.textAlign = "center", e.textBaseline = "middle", e.fillText(t, n + i / 2, o)) : (e.textAlign = "left", e.textBaseline = "middle", e.fillText(t, n + i + 2, o));
|
|
315
328
|
}
|
|
316
329
|
}
|
|
317
|
-
function
|
|
318
|
-
let { x: s, y: l, w: u, h: d } = r, f = n.chartType === "clusteredBarH" || n.chartType === "stackedBarH" || n.chartType === "stackedBarHPct", p = n.chartType.startsWith("stacked"), h = n.chartType === "stackedBarPct" || n.chartType === "stackedBarHPct",
|
|
319
|
-
if (
|
|
320
|
-
let E = n.title ?
|
|
330
|
+
function E(e, n, r, o) {
|
|
331
|
+
let { x: s, y: l, w: u, h: d } = r, f = n.chartType === "clusteredBarH" || n.chartType === "stackedBarH" || n.chartType === "stackedBarHPct", p = n.chartType.startsWith("stacked"), h = n.chartType === "stackedBarPct" || n.chartType === "stackedBarHPct", g = n.series.filter((e) => e.seriesType !== "line"), _ = n.series.filter((e) => e.seriesType === "line"), b = w(n), S = b.length;
|
|
332
|
+
if (S === 0) return;
|
|
333
|
+
let E = n.title ? x(n, d, o) : 0, D = n.title ? d * .02 : 0, O = n.title ? d * .025 : 0, k = n.title ? E + D + O : 0, A = v(n, u, d), j = A?.side === "r" ? A.reserveW : 0, M = A?.side === "l" ? A.reserveW : 0, N = A?.side === "t" ? A.reserveH : 0, P = A?.side === "b" ? A.reserveH : 0, F = Math.max(8, Math.min(10, d * .045)), I = n.catAxisTitle ? F + 4 : 0, L = n.valAxisTitle ? F + 4 : 0, R = {
|
|
321
334
|
t: k + N + d * .02,
|
|
322
335
|
r: j + u * .03,
|
|
323
336
|
b: d * .14 + I + P,
|
|
324
337
|
l: u * .12 + L + M
|
|
325
338
|
};
|
|
326
|
-
f && (R.l = (n.catAxisHidden ? u * .03 : u * .22) + L + M, R.b = (n.valAxisHidden ? d * .02 : d * .08) + I + P),
|
|
339
|
+
f && (R.l = (n.catAxisHidden ? u * .03 : u * .22) + L + M, R.b = (n.valAxisHidden ? d * .02 : d * .08) + I + P), C(e, n, s, l + D, u, E);
|
|
327
340
|
let z = n.plotAreaManualLayout, B, V, H, U;
|
|
328
341
|
if (z && z.w != null && z.h != null ? (B = s + z.x * u, V = l + z.y * d, H = z.w * u, U = z.h * d) : (B = s + R.l, V = l + R.t, H = u - R.l - R.r, U = d - R.t - R.b), H <= 0 || U <= 0) return;
|
|
329
342
|
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(B, V, H, U));
|
|
330
343
|
let W = 0;
|
|
331
|
-
for (let e = 0; e <
|
|
344
|
+
for (let e = 0; e < S; e++) {
|
|
332
345
|
let t = 0;
|
|
333
|
-
for (let n of
|
|
346
|
+
for (let n of g) {
|
|
334
347
|
let r = n.values[e] ?? 0;
|
|
335
348
|
p ? t += Math.abs(r) : W = Math.max(W, Math.abs(r));
|
|
336
349
|
}
|
|
@@ -348,32 +361,32 @@ function w(e, n, r, o) {
|
|
|
348
361
|
e.strokeStyle = t === 0 ? "#aaa" : q, e.lineWidth = t === 0 ? 1 : .5, e.beginPath(), e.moveTo(B, n), e.lineTo(B + H, n), e.stroke(), e.textAlign = "right", e.fillText(i, B - 4, n);
|
|
349
362
|
}
|
|
350
363
|
}
|
|
351
|
-
e.strokeStyle = "#aaa", e.lineWidth = 1, f ? (e.beginPath(), e.moveTo(B, V), e.lineTo(B, V + U), e.stroke()) : (e.beginPath(), e.moveTo(B, V + U), e.lineTo(B + H, V + U), e.stroke());
|
|
352
|
-
let Y = f ? U /
|
|
353
|
-
for (let r = 0; r <
|
|
364
|
+
e.strokeStyle = "#aaa", e.lineWidth = 1, f ? !n.valAxisHidden && !n.valAxisLineHidden && (e.beginPath(), e.moveTo(B, V), e.lineTo(B, V + U), e.stroke()) : !n.catAxisHidden && !n.catAxisLineHidden && (e.beginPath(), e.moveTo(B, V + U), e.lineTo(B + H, V + U), e.stroke());
|
|
365
|
+
let Y = f ? U / S : H / S, X = p ? 1 : Math.max(1, g.length), Z = p ? 0 : n.barOverlap ?? 0, Q = n.barGapWidth ?? 150, $ = Y / (1 + (X - 1) * (1 - Z / 100) + Q / 100), ee = p ? 0 : $ * (1 - Z / 100), te = (Y - ($ + (X - 1) * ee)) / 2;
|
|
366
|
+
for (let r = 0; r < S; r++) {
|
|
354
367
|
let i = 0, a = 0;
|
|
355
368
|
if (h) {
|
|
356
|
-
for (let e of
|
|
369
|
+
for (let e of g) a += Math.abs(e.values[r] ?? 0);
|
|
357
370
|
a === 0 && (a = 1);
|
|
358
371
|
}
|
|
359
|
-
for (let s = 0; s <
|
|
360
|
-
let l =
|
|
372
|
+
for (let s = 0; s < g.length; s++) {
|
|
373
|
+
let l = g[s], u = l.values[r] ?? 0, d = h ? Math.abs(u) / a * 100 : Math.abs(u), m = t(s, l);
|
|
361
374
|
if (f) {
|
|
362
|
-
let t = p ? s :
|
|
363
|
-
e.fillStyle = m, e.fillRect(f, a, u, $), n.showDataLabels && d > 0 && (e.font = `bold ${n.dataLabelFontSizeHpt ? n.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`,
|
|
375
|
+
let t = p ? s : g.length - 1 - s, a = p ? V + (S - 1 - r) * Y + te : V + (S - 1 - r) * Y + te + t * ee, u = d / K * H, f = p ? B + i / K * H : B;
|
|
376
|
+
e.fillStyle = m, e.fillRect(f, a, u, $), n.showDataLabels && d > 0 && (e.font = `bold ${n.dataLabelFontSizeHpt ? n.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`, T(e, h ? `${Math.round(d)}%` : c(d, n.dataLabelFormatCode ?? l.valFormatCode ?? null), f, a, u, $, "horizontal", n.dataLabelPosition ?? null, n.dataLabelFontColor ?? null));
|
|
364
377
|
} else {
|
|
365
378
|
let t = p ? B + r * Y + te : B + r * Y + te + s * ee, a = d / K * U, u = V + U - (p ? i + d : d) / K * U;
|
|
366
|
-
e.fillStyle = m, e.fillRect(t, u, $, a), n.showDataLabels && d > 0 && (e.font = `bold ${n.dataLabelFontSizeHpt ? n.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`,
|
|
379
|
+
e.fillStyle = m, e.fillRect(t, u, $, a), n.showDataLabels && d > 0 && (e.font = `bold ${n.dataLabelFontSizeHpt ? n.dataLabelFontSizeHpt / 100 * o : Math.max(7, Math.min(11, $ * .6))}px sans-serif`, T(e, h ? `${Math.round(d)}%` : c(d, n.dataLabelFormatCode ?? l.valFormatCode ?? null), t, u, a, $, "vertical", n.dataLabelPosition ?? null, n.dataLabelFontColor ?? null));
|
|
367
380
|
}
|
|
368
381
|
p && (i += d);
|
|
369
382
|
}
|
|
370
383
|
}
|
|
371
384
|
if (!n.catAxisHidden) {
|
|
372
385
|
e.fillStyle = "#555", e.font = `${Math.max(8, Math.min(11, Y * .5))}px sans-serif`;
|
|
373
|
-
for (let t = 0; t <
|
|
374
|
-
let n = (
|
|
386
|
+
for (let t = 0; t < S; t++) {
|
|
387
|
+
let n = (b[t] ?? "").toString().slice(0, 12);
|
|
375
388
|
if (f) {
|
|
376
|
-
let r = V + (
|
|
389
|
+
let r = V + (S - 1 - t) * Y + Y / 2;
|
|
377
390
|
e.textAlign = "right", e.textBaseline = "middle", e.fillText(n, B - 4, r);
|
|
378
391
|
} else {
|
|
379
392
|
let r = B + t * Y + Y / 2;
|
|
@@ -381,11 +394,11 @@ function w(e, n, r, o) {
|
|
|
381
394
|
}
|
|
382
395
|
}
|
|
383
396
|
}
|
|
384
|
-
if (
|
|
385
|
-
let r =
|
|
397
|
+
if (_.length > 0 && !f) for (let n = 0; n < _.length; n++) {
|
|
398
|
+
let r = _[n], i = t(g.length + n, r);
|
|
386
399
|
e.strokeStyle = i, e.lineWidth = 2, e.setLineDash([]), e.beginPath();
|
|
387
400
|
let a = !1;
|
|
388
|
-
for (let t = 0; t <
|
|
401
|
+
for (let t = 0; t < S; t++) {
|
|
389
402
|
let n = r.values[t];
|
|
390
403
|
if (n == null) {
|
|
391
404
|
a = !1;
|
|
@@ -394,28 +407,28 @@ function w(e, n, r, o) {
|
|
|
394
407
|
let i = B + t * Y + Y / 2, o = V + U - n / K * U;
|
|
395
408
|
a ? e.lineTo(i, o) : (e.moveTo(i, o), a = !0);
|
|
396
409
|
}
|
|
397
|
-
if (e.stroke(), r.showMarker !== !1) for (let t = 0; t <
|
|
410
|
+
if (e.stroke(), r.showMarker !== !1) for (let t = 0; t < S; t++) {
|
|
398
411
|
let n = r.values[t];
|
|
399
412
|
if (n == null) continue;
|
|
400
413
|
let a = B + t * Y + Y / 2, o = V + U - n / K * U;
|
|
401
414
|
e.fillStyle = i, e.beginPath(), e.arc(a, o, 3, 0, Math.PI * 2), e.fill();
|
|
402
415
|
}
|
|
403
416
|
}
|
|
404
|
-
|
|
417
|
+
y(e, f && !p ? {
|
|
405
418
|
...n,
|
|
406
419
|
series: [...n.series].reverse()
|
|
407
420
|
} : n, A, s, l, u, d, B, V, H, U, k + 2), n.catAxisTitle && m(e, n.catAxisTitle, B, V, H, U, "cat", F), n.valAxisTitle && m(e, n.valAxisTitle, B, V, H, U, "val", F);
|
|
408
421
|
}
|
|
409
|
-
function
|
|
410
|
-
let { x: u, y: d, w: f, h: p } = r, h =
|
|
411
|
-
if (
|
|
412
|
-
let
|
|
422
|
+
function D(e, n, r, l) {
|
|
423
|
+
let { x: u, y: d, w: f, h: p } = r, h = w(n), g = h.length;
|
|
424
|
+
if (g === 0) return;
|
|
425
|
+
let _ = n.title ? x(n, p, l) : 0, T = n.title ? p * .045 : 0, E = n.title ? p * .035 : 0, D = n.title ? _ + T + E : 0, O = v(n, f, p), k = O?.side === "r" ? O.reserveW : 0, A = O?.side === "l" ? O.reserveW : 0, j = O?.side === "t" ? O.reserveH : 0, M = O?.side === "b" ? O.reserveH : 0, N = S(n.catAxisFontSizeHpt, p, l), P = S(n.valAxisFontSizeHpt, p, l), F = Math.max(N, P), I = n.catAxisTitle ? F + 4 : 0, L = n.valAxisTitle ? F + 4 : 0, R = {
|
|
413
426
|
t: D + j + P / 2 + 2,
|
|
414
427
|
r: k + f * .05,
|
|
415
428
|
b: N + 12 + I + M,
|
|
416
429
|
l: P * 2.2 + 10 + L + A
|
|
417
430
|
};
|
|
418
|
-
|
|
431
|
+
C(e, n, u, d + T, f, _);
|
|
419
432
|
let z = u + R.l, B = d + R.t, V = f - R.l - R.r, H = p - R.t - R.b;
|
|
420
433
|
if (V <= 0 || H <= 0) return;
|
|
421
434
|
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(z, B, V, H));
|
|
@@ -424,22 +437,22 @@ function T(e, n, r, l) {
|
|
|
424
437
|
isFinite(U) || (U = 0, W = 1), n.valMin == null ? U > 0 && (U = 0) : U = n.valMin, n.valMax == null ? W < 0 && (W = 0) : W = n.valMax, W === U && (W = U + 1);
|
|
425
438
|
let G = i(W - U), K = n.valMin ?? o(U, G), q = n.valMax ?? a(W, G), J = q - K;
|
|
426
439
|
if (J === 0) return;
|
|
427
|
-
let Y = (e) => B + H - (e - K) / J * H, X = n.catAxisCrossBetween === "midCat" ? (e) => z + (
|
|
440
|
+
let Y = (e) => B + H - (e - K) / J * H, X = n.catAxisCrossBetween === "midCat" ? (e) => z + (g === 1 ? V / 2 : e / (g - 1) * V) : (e) => z + (e + .5) / g * V;
|
|
428
441
|
if (!n.valAxisHidden) {
|
|
429
442
|
let t = Math.round((q - K) / G);
|
|
430
443
|
e.font = `${P}px sans-serif`, e.textBaseline = "middle";
|
|
431
444
|
for (let r = 0; r <= t; r++) {
|
|
432
445
|
let t = K + r * G, i = Y(t);
|
|
433
|
-
e.strokeStyle = t === 0 ? "#aaa" : "#e0e0e0", e.lineWidth = t === 0 ? 1 : .5, e.beginPath(), e.moveTo(z, i), e.lineTo(z + V, i), e.stroke(),
|
|
446
|
+
e.strokeStyle = t === 0 ? "#aaa" : "#e0e0e0", e.lineWidth = t === 0 ? 1 : .5, e.beginPath(), e.moveTo(z, i), e.lineTo(z + V, i), e.stroke(), b(e, n.valAxisMajorTickMark, "val", z, i), e.fillStyle = "#555", e.textAlign = "right", e.fillText(c(t, n.valAxisFormatCode), z - 6, i);
|
|
434
447
|
}
|
|
435
448
|
}
|
|
436
|
-
e.strokeStyle = "#aaa", e.lineWidth = 1, e.beginPath(), e.moveTo(z, B + H), e.lineTo(z + V, B + H), e.stroke(), n.valAxisHidden
|
|
437
|
-
let Z = Math.max(1, 2.25 * l), Q = Math.max(2, 2.5 * l), $ =
|
|
449
|
+
e.strokeStyle = "#aaa", e.lineWidth = 1, !n.catAxisHidden && !n.catAxisLineHidden && (e.beginPath(), e.moveTo(z, B + H), e.lineTo(z + V, B + H), e.stroke()), !n.valAxisHidden && !n.valAxisLineHidden && (e.beginPath(), e.moveTo(z, B), e.lineTo(z, B + H), e.stroke());
|
|
450
|
+
let Z = Math.max(1, 2.25 * l), Q = Math.max(2, 2.5 * l), $ = S(n.dataLabelFontSizeHpt, p, l);
|
|
438
451
|
for (let r = 0; r < n.series.length; r++) {
|
|
439
452
|
let i = n.series[r], a = t(r, i);
|
|
440
453
|
e.strokeStyle = a, e.lineWidth = Z, e.setLineDash([]), e.beginPath();
|
|
441
454
|
let o = !1;
|
|
442
|
-
for (let t = 0; t <
|
|
455
|
+
for (let t = 0; t < g; t++) {
|
|
443
456
|
let n = i.values[t];
|
|
444
457
|
if (n == null) {
|
|
445
458
|
o = !1;
|
|
@@ -450,7 +463,7 @@ function T(e, n, r, l) {
|
|
|
450
463
|
}
|
|
451
464
|
e.stroke(), e.fillStyle = a;
|
|
452
465
|
let c = i.showMarker !== !1;
|
|
453
|
-
for (let t = 0; t <
|
|
466
|
+
for (let t = 0; t < g; t++) {
|
|
454
467
|
let r = i.values[t];
|
|
455
468
|
if (r != null && (c && (e.beginPath(), e.arc(X(t), Y(r), Q, 0, Math.PI * 2), e.fill()), n.showDataLabels)) {
|
|
456
469
|
e.font = `${$}px sans-serif`, e.fillStyle = "#333", e.textAlign = "center", e.textBaseline = "bottom";
|
|
@@ -460,30 +473,30 @@ function T(e, n, r, l) {
|
|
|
460
473
|
}
|
|
461
474
|
}
|
|
462
475
|
if (!n.catAxisHidden) {
|
|
463
|
-
let t = Math.max(1, Math.ceil(
|
|
476
|
+
let t = Math.max(1, Math.ceil(g / 8));
|
|
464
477
|
e.fillStyle = "#555", e.textAlign = "center", e.textBaseline = "top", e.font = `${N}px sans-serif`;
|
|
465
|
-
for (let r = 0; r <
|
|
478
|
+
for (let r = 0; r < g; r += t) {
|
|
466
479
|
let t = X(r);
|
|
467
|
-
|
|
480
|
+
b(e, n.catAxisMajorTickMark, "cat", B + H, t), e.fillStyle = "#555", e.fillText((h[r] ?? "").toString().slice(0, 10), t, B + H + 5);
|
|
468
481
|
}
|
|
469
482
|
}
|
|
470
|
-
|
|
483
|
+
y(e, n, O, u, d, f, p, z, B, V, H, D + 2), n.catAxisTitle && m(e, n.catAxisTitle, z, B, V, H, "cat", F), n.valAxisTitle && m(e, n.valAxisTitle, z, B, V, H, "val", F);
|
|
471
484
|
}
|
|
472
|
-
function
|
|
473
|
-
let { x: l, y: u, w: d, h: f } = o, p =
|
|
485
|
+
function O(e, n, o, s) {
|
|
486
|
+
let { x: l, y: u, w: d, h: f } = o, p = w(n), h = p.length;
|
|
474
487
|
if (h === 0) return;
|
|
475
|
-
let
|
|
488
|
+
let g = n.chartType === "stackedArea" || n.chartType === "stackedAreaPct", _ = n.title ? x(n, f, s) : 0, b = n.title ? f * .035 : 0, S = n.title ? f * .035 : 0, T = n.title ? _ + b + S : 0, E = v(n, d, f), D = E?.side === "r" ? E.reserveW : 0, O = E?.side === "l" ? E.reserveW : 0, k = E?.side === "t" ? E.reserveH : 0, A = E?.side === "b" ? E.reserveH : 0, j = Math.max(8, Math.min(10, f * .045)), M = n.catAxisTitle ? j + 4 : 0, N = n.valAxisTitle ? j + 4 : 0, P = {
|
|
476
489
|
t: T + k + f * .02,
|
|
477
490
|
r: D + d * .05,
|
|
478
491
|
b: f * .14 + M + A,
|
|
479
492
|
l: d * .12 + N + O
|
|
480
493
|
};
|
|
481
|
-
|
|
494
|
+
C(e, n, l, u + b, d, _);
|
|
482
495
|
let F = l + P.l, I = u + P.t, L = d - P.l - P.r, R = f - P.t - P.b;
|
|
483
496
|
if (L <= 0 || R <= 0) return;
|
|
484
497
|
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(F, I, L, R));
|
|
485
498
|
let z = 0;
|
|
486
|
-
for (let e = 0; e < h; e++) if (
|
|
499
|
+
for (let e = 0; e < h; e++) if (g) {
|
|
487
500
|
let t = 0;
|
|
488
501
|
for (let r of n.series) t += r.values[e] ?? 0;
|
|
489
502
|
z = Math.max(z, t);
|
|
@@ -498,11 +511,11 @@ function E(e, n, o, s) {
|
|
|
498
511
|
e.strokeStyle = r === 0 ? "#aaa" : "#e0e0e0", e.lineWidth = r === 0 ? 1 : .5, e.beginPath(), e.moveTo(F, i), e.lineTo(F + L, i), e.stroke(), e.fillStyle = "#555", e.textAlign = "right", e.fillText(c(t, n.valAxisFormatCode), F - 4, i);
|
|
499
512
|
}
|
|
500
513
|
}
|
|
501
|
-
e.strokeStyle = "#aaa", e.lineWidth = 1, e.beginPath(), e.moveTo(F, I + R), e.lineTo(F + L, I + R), e.stroke();
|
|
502
|
-
let W =
|
|
514
|
+
!n.catAxisHidden && !n.catAxisLineHidden && (e.strokeStyle = "#aaa", e.lineWidth = 1, e.beginPath(), e.moveTo(F, I + R), e.lineTo(F + L, I + R), e.stroke());
|
|
515
|
+
let W = g ? Array(h).fill(0) : null;
|
|
503
516
|
for (let i = n.series.length - 1; i >= 0; i--) {
|
|
504
517
|
let a = n.series[i], o = t(i, a), s = I + R;
|
|
505
|
-
if (e.beginPath(),
|
|
518
|
+
if (e.beginPath(), g && W) {
|
|
506
519
|
for (let t = 0; t < h; t++) {
|
|
507
520
|
let n = (a.values[t] ?? 0) + W[t], r = H(t), i = U(n);
|
|
508
521
|
t === 0 ? e.moveTo(r, i) : e.lineTo(r, i);
|
|
@@ -521,16 +534,16 @@ function E(e, n, o, s) {
|
|
|
521
534
|
e.fillStyle = "#555", e.textAlign = "center", e.textBaseline = "top", e.font = `${Math.max(8, Math.min(11, L / h * .8))}px sans-serif`;
|
|
522
535
|
for (let n = 0; n < h; n += t) e.fillText((p[n] ?? "").toString().slice(0, 10), H(n), I + R + 3);
|
|
523
536
|
}
|
|
524
|
-
|
|
537
|
+
y(e, n, E, l, u, d, f, F, I, L, R, T + 2), n.catAxisTitle && m(e, n.catAxisTitle, F, I, L, R, "cat", j), n.valAxisTitle && m(e, n.valAxisTitle, F, I, L, R, "val", j);
|
|
525
538
|
}
|
|
526
|
-
function
|
|
539
|
+
function k(t, r, i, a, o) {
|
|
527
540
|
let { x: s, y: c, w: l, h: u } = i, d = r.series[0];
|
|
528
541
|
if (!d) return;
|
|
529
542
|
let f = d.categories && d.categories.length > 0 ? d.categories : r.categories, p = d.values.map((e) => Math.abs(e ?? 0)), m = p.reduce((e, t) => e + t, 0);
|
|
530
543
|
if (m === 0) return;
|
|
531
|
-
let h = r.title ?
|
|
532
|
-
|
|
533
|
-
let
|
|
544
|
+
let h = r.title ? x(r, u, o) : 0, g = r.title ? u * .035 : 0, _ = r.title ? u * .035 : 0, v = r.title ? h + g + _ : 0;
|
|
545
|
+
C(t, r, s, c + g, l, h);
|
|
546
|
+
let b = r.showLegend ? (() => {
|
|
534
547
|
let e = r.legendPos ?? "r", t = e === "l" ? "l" : e === "t" ? "t" : e === "b" ? "b" : "r";
|
|
535
548
|
return t === "r" || t === "l" ? {
|
|
536
549
|
side: t,
|
|
@@ -541,7 +554,7 @@ function D(t, r, i, a, o) {
|
|
|
541
554
|
reserveW: 0,
|
|
542
555
|
reserveH: Math.max(18, u * .08)
|
|
543
556
|
};
|
|
544
|
-
})() : null,
|
|
557
|
+
})() : null, S = b?.side === "r" ? b.reserveW : 0, w = b?.side === "l" ? b.reserveW : 0, T = b?.side === "t" ? b.reserveH : 0, E = b?.side === "b" ? b.reserveH : 0, D = l - S - w, O = u - v - T - E - u * .02, k = s + w + D / 2, A = c + v + T + u * .02 + O / 2, j = Math.min(D, O) * .42, M = a ? j * .5 : 0, N = -Math.PI / 2;
|
|
545
558
|
for (let e = 0; e < p.length; e++) {
|
|
546
559
|
let i = p[e] / m * Math.PI * 2, o = n(e, d);
|
|
547
560
|
if (t.beginPath(), t.moveTo(k, A), t.arc(k, A, j, N, N + i), t.closePath(), t.fillStyle = o, t.fill(), t.strokeStyle = "#fff", t.lineWidth = 1, t.stroke(), r.showDataLabels && i > .15) {
|
|
@@ -550,24 +563,24 @@ function D(t, r, i, a, o) {
|
|
|
550
563
|
}
|
|
551
564
|
N += i;
|
|
552
565
|
}
|
|
553
|
-
if (a && (t.beginPath(), t.arc(k, A, M, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill()),
|
|
566
|
+
if (a && (t.beginPath(), t.arc(k, A, M, 0, Math.PI * 2), t.fillStyle = "#fff", t.fill()), b) {
|
|
554
567
|
let n = p.map((t, n) => ({
|
|
555
568
|
name: (f[n] ?? `Item ${n + 1}`).toString(),
|
|
556
569
|
color: d.dataPointColors?.[n] ?? d.color ?? e[n % e.length],
|
|
557
570
|
values: []
|
|
558
571
|
})), i = k - D / 2;
|
|
559
|
-
|
|
572
|
+
y(t, {
|
|
560
573
|
...r,
|
|
561
574
|
series: n
|
|
562
|
-
},
|
|
575
|
+
}, b, s, c, l, u, i, A - O / 2, D, O, v + 2);
|
|
563
576
|
}
|
|
564
577
|
}
|
|
565
|
-
function
|
|
566
|
-
let { x: l, y: u, w: d, h: f } = o, p =
|
|
578
|
+
function A(e, n, o, c) {
|
|
579
|
+
let { x: l, y: u, w: d, h: f } = o, p = w(n), m = p.length;
|
|
567
580
|
if (m < 3) return;
|
|
568
|
-
let h = n.title ?
|
|
569
|
-
|
|
570
|
-
let A = d - E - D, j = f -
|
|
581
|
+
let h = n.title ? x(n, f, c) : 0, g = n.title ? f * .035 : 0, _ = n.title ? f * .035 : 0, b = n.title ? h + g + _ : 0, T = v(n, d, f), E = T?.side === "r" ? T.reserveW : 0, D = T?.side === "l" ? T.reserveW : 0, O = T?.side === "t" ? T.reserveH : 0, k = T?.side === "b" ? T.reserveH : 0;
|
|
582
|
+
C(e, n, l, u + g, d, h);
|
|
583
|
+
let A = d - E - D, j = f - b - O - k - f * .02, M = l + D + A / 2, N = u + b + O + f * .02 + j / 2, P = Math.min(A, j) * .38, F = 0;
|
|
571
584
|
for (let e of n.series) for (let t of e.values) F = Math.max(F, t ?? 0);
|
|
572
585
|
n.valMax != null && (F = n.valMax), F === 0 && (F = 1);
|
|
573
586
|
let I = i(F), L = n.valMax ?? a(F, I), R = -Math.PI / 2, z = (e) => R + e / m * Math.PI * 2, B = Math.round(L / I);
|
|
@@ -587,7 +600,7 @@ function O(e, n, o, c) {
|
|
|
587
600
|
e.beginPath(), e.moveTo(M, N), e.lineTo(M + Math.cos(n) * P, N + Math.sin(n) * P), e.stroke();
|
|
588
601
|
}
|
|
589
602
|
if (!n.valAxisHidden) {
|
|
590
|
-
e.font = `${
|
|
603
|
+
e.font = `${S(n.valAxisFontSizeHpt, f, c)}px sans-serif`, e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle";
|
|
591
604
|
for (let t = 1; t <= B; t++) {
|
|
592
605
|
let n = t / B * L, r = t / B * P;
|
|
593
606
|
e.fillText(s(n), M - 3, N - r);
|
|
@@ -598,36 +611,54 @@ function O(e, n, o, c) {
|
|
|
598
611
|
let n = z(t), r = M + Math.cos(n) * (P + 12), i = N + Math.sin(n) * (P + 12);
|
|
599
612
|
e.textAlign = Math.cos(n) < -.1 ? "right" : Math.cos(n) > .1 ? "left" : "center", e.fillText((p[t] ?? "").toString().slice(0, 12), r, i);
|
|
600
613
|
}
|
|
614
|
+
let V = n.radarStyle === "filled", H = Math.max(2, P * .025);
|
|
601
615
|
for (let i = 0; i < n.series.length; i++) {
|
|
602
|
-
let a = n.series[i], o = t(i, a);
|
|
616
|
+
let a = n.series[i], o = t(i, a), s = [];
|
|
617
|
+
for (let e = 0; e < m; e++) {
|
|
618
|
+
let t = a.values[e];
|
|
619
|
+
if (t == null) {
|
|
620
|
+
s.push(null);
|
|
621
|
+
continue;
|
|
622
|
+
}
|
|
623
|
+
let n = t / L, r = z(e);
|
|
624
|
+
s.push([M + Math.cos(r) * P * n, N + Math.sin(r) * P * n]);
|
|
625
|
+
}
|
|
603
626
|
e.beginPath();
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
t
|
|
627
|
+
let c = !1;
|
|
628
|
+
for (let t of s) {
|
|
629
|
+
if (t == null) {
|
|
630
|
+
c = !1;
|
|
631
|
+
continue;
|
|
632
|
+
}
|
|
633
|
+
c ? e.lineTo(t[0], t[1]) : (e.moveTo(t[0], t[1]), c = !0);
|
|
634
|
+
}
|
|
635
|
+
let l = s.every((e) => e != null);
|
|
636
|
+
if (V && l ? (e.closePath(), e.fillStyle = r(o, .25), e.fill()) : l && e.closePath(), e.strokeStyle = o, e.lineWidth = 2, e.stroke(), !V && a.showMarker !== !1) {
|
|
637
|
+
e.fillStyle = o;
|
|
638
|
+
for (let t of s) t != null && (e.beginPath(), e.arc(t[0], t[1], H, 0, Math.PI * 2), e.fill());
|
|
607
639
|
}
|
|
608
|
-
e.closePath(), e.fillStyle = r(o, .25), e.fill(), e.strokeStyle = o, e.lineWidth = 2, e.stroke();
|
|
609
640
|
}
|
|
610
|
-
|
|
641
|
+
y(e, n, T, l, u, d, f, M - A / 2, N - j / 2, A, j, b + 2);
|
|
611
642
|
}
|
|
612
|
-
function
|
|
613
|
-
let { x: o, y: s, w: l, h: u } = r, d = n.title ?
|
|
643
|
+
function j(e, n, r, a) {
|
|
644
|
+
let { x: o, y: s, w: l, h: u } = r, d = n.title ? x(n, u, a) : 0, f = n.title ? u * .035 : 0, p = n.title ? u * .035 : 0, h = n.title ? d + f + p : 0, g = v(n, l, u), _ = g?.side === "r" ? g.reserveW : 0, S = g?.side === "l" ? g.reserveW : 0, w = g?.side === "t" ? g.reserveH : 0, T = g?.side === "b" ? g.reserveH : 0, E = Math.max(8, Math.min(10, u * .045)), D = n.catAxisTitle ? E + 4 : 0, O = n.valAxisTitle ? E + 4 : 0;
|
|
614
645
|
if (n.title) {
|
|
615
646
|
let t = n.titleManualLayout;
|
|
616
|
-
t && (t.x !== void 0 || t.y !== void 0) ?
|
|
647
|
+
t && (t.x !== void 0 || t.y !== void 0) ? C(e, n, o + t.x * l, s + t.y * u, (t.w ?? .5) * l, d) : C(e, n, o, s + f, l, d);
|
|
617
648
|
}
|
|
618
|
-
let k = n.plotAreaManualLayout,
|
|
619
|
-
if (k && k.w != null && k.h != null)
|
|
649
|
+
let k = n.plotAreaManualLayout, A, j, F, L;
|
|
650
|
+
if (k && k.w != null && k.h != null) A = o + k.x * l, j = s + k.y * u, F = k.w * l, L = k.h * u;
|
|
620
651
|
else {
|
|
621
652
|
let e = {
|
|
622
653
|
t: h + w + u * .02,
|
|
623
|
-
r:
|
|
654
|
+
r: _ + l * .05,
|
|
624
655
|
b: (n.catAxisHidden ? u * .04 : u * .12) + D + T,
|
|
625
|
-
l: (n.valAxisHidden ? l * .04 : l * .12) + O +
|
|
656
|
+
l: (n.valAxisHidden ? l * .04 : l * .12) + O + S
|
|
626
657
|
};
|
|
627
|
-
|
|
658
|
+
A = o + e.l, j = s + e.t, F = l - e.l - e.r, L = u - e.t - e.b;
|
|
628
659
|
}
|
|
629
|
-
if (
|
|
630
|
-
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(
|
|
660
|
+
if (F <= 0 || L <= 0) return;
|
|
661
|
+
n.plotAreaBg && (e.fillStyle = `#${n.plotAreaBg}`, e.fillRect(A, j, F, L));
|
|
631
662
|
let R = [], z = [];
|
|
632
663
|
for (let e of n.series) {
|
|
633
664
|
let t = e.categories ?? [];
|
|
@@ -647,7 +678,7 @@ function k(e, n, r, a) {
|
|
|
647
678
|
let e = i(H - V);
|
|
648
679
|
e > 0 && (n.catAxisMin ?? (V = Math.floor(V / e) * e), n.catAxisMax ?? (H = Math.ceil(H / e) * e));
|
|
649
680
|
}
|
|
650
|
-
let G = (e) =>
|
|
681
|
+
let G = (e) => A + (e - V) / (H - V) * F, K = (e) => j + L - (e - U) / (W - U) * L;
|
|
651
682
|
if (!n.valAxisHidden) {
|
|
652
683
|
let t = Math.max(8, Math.min(11, L / 20));
|
|
653
684
|
e.font = `${n.valAxisFontBold ? "bold " : ""}${t}px sans-serif`;
|
|
@@ -656,18 +687,18 @@ function k(e, n, r, a) {
|
|
|
656
687
|
let i = U + t * r;
|
|
657
688
|
if (i > W + r * .01) break;
|
|
658
689
|
let a = K(i);
|
|
659
|
-
e.strokeStyle = "#e0e0e0", e.lineWidth = .5, e.beginPath(), e.moveTo(
|
|
690
|
+
e.strokeStyle = "#e0e0e0", e.lineWidth = .5, e.beginPath(), e.moveTo(A, a), e.lineTo(A + F, a), e.stroke(), e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle", e.fillText(c(i, n.valAxisFormatCode), A - 4, a);
|
|
660
691
|
let o = n.valAxisLineColor ? `#${n.valAxisLineColor}` : void 0, s = n.valAxisLineWidthEmu ? Math.max(.5, n.valAxisLineWidthEmu / 12700) : void 0;
|
|
661
|
-
|
|
692
|
+
b(e, n.valAxisMajorTickMark, "val", A, a, o, s);
|
|
662
693
|
}
|
|
663
694
|
}
|
|
664
|
-
let q =
|
|
665
|
-
if (n.catAxisCrossesAt != null) q =
|
|
695
|
+
let q = j + L;
|
|
696
|
+
if (n.catAxisCrossesAt != null) q = I(K(n.catAxisCrossesAt), j, j + L);
|
|
666
697
|
else {
|
|
667
698
|
let e = n.catAxisCrosses ?? "autoZero";
|
|
668
|
-
e === "autoZero" && U < 0 && W > 0 ? q =
|
|
699
|
+
e === "autoZero" && U < 0 && W > 0 ? q = I(K(0), j, j + L) : e === "min" ? q = j + L : e === "max" && (q = j);
|
|
669
700
|
}
|
|
670
|
-
if (e.save(), e.strokeStyle = n.catAxisLineColor ? `#${n.catAxisLineColor}` : "#888", e.lineWidth = n.catAxisLineWidthEmu ? Math.max(.5, n.catAxisLineWidthEmu / 12700) : 1, e.lineCap = "butt", e.beginPath(), e.moveTo(
|
|
701
|
+
if (!n.catAxisHidden && !n.catAxisLineHidden && (e.save(), e.strokeStyle = n.catAxisLineColor ? `#${n.catAxisLineColor}` : "#888", e.lineWidth = n.catAxisLineWidthEmu ? Math.max(.5, n.catAxisLineWidthEmu / 12700) : 1, e.lineCap = "butt", e.beginPath(), e.moveTo(A, q), e.lineTo(A + F, q), e.stroke(), e.restore()), !n.valAxisHidden && !n.valAxisLineHidden && (e.save(), e.strokeStyle = n.valAxisLineColor ? `#${n.valAxisLineColor}` : "#888", e.lineWidth = n.valAxisLineWidthEmu ? Math.max(.5, n.valAxisLineWidthEmu / 12700) : 1, e.beginPath(), e.moveTo(A, j), e.lineTo(A, j + L), e.stroke(), e.restore()), !n.catAxisHidden) {
|
|
671
702
|
let t = Math.max(8, Math.min(11, L / 20));
|
|
672
703
|
e.font = `${n.catAxisFontBold ? "bold " : ""}${t}px sans-serif`;
|
|
673
704
|
let r = i(H - V), a = Math.round((H - V) / r) + 1;
|
|
@@ -678,13 +709,13 @@ function k(e, n, r, a) {
|
|
|
678
709
|
let a = G(i);
|
|
679
710
|
e.fillText(c(i, n.catAxisFormatCode), a, q + 4);
|
|
680
711
|
let o = n.catAxisLineColor ? `#${n.catAxisLineColor}` : void 0, s = n.catAxisLineWidthEmu ? Math.max(.5, n.catAxisLineWidthEmu / 12700) : void 0;
|
|
681
|
-
|
|
712
|
+
b(e, n.catAxisMajorTickMark, "cat", q, a, o, s);
|
|
682
713
|
}
|
|
683
714
|
}
|
|
684
715
|
let J = n.chartType === "bubble", Y = J ? "marker" : n.scatterStyle ?? "marker", X = Y === "line" || Y === "lineMarker" || Y === "lineNoMarker", Z = Y === "smooth" || Y === "smoothMarker" || Y === "smoothNoMarker", Q = Y === "lineNoMarker" || Y === "smoothNoMarker";
|
|
685
716
|
for (let r = 0; r < n.series.length; r++) {
|
|
686
717
|
let i = n.series[r], o = t(r, i), s = i.categories ?? [];
|
|
687
|
-
for (let t of i.errBars ?? [])
|
|
718
|
+
for (let t of i.errBars ?? []) N(e, i, t, s, B, G, K, o);
|
|
688
719
|
if (X || Z) {
|
|
689
720
|
let t = [];
|
|
690
721
|
for (let e = 0; e < i.values.length; e++) {
|
|
@@ -709,7 +740,7 @@ function k(e, n, r, a) {
|
|
|
709
740
|
let t = 0;
|
|
710
741
|
if (J && i.bubbleSizes && i.bubbleSizes.length > 0) {
|
|
711
742
|
let e = Math.max(0, ...i.bubbleSizes.filter((e) => e != null));
|
|
712
|
-
e > 0 && (t = Math.min(
|
|
743
|
+
e > 0 && (t = Math.min(F, L) / Math.max(8, i.values.length * 1.6) / Math.sqrt(e));
|
|
713
744
|
}
|
|
714
745
|
for (let n = 0; n < i.values.length; n++) {
|
|
715
746
|
let r = i.values[n];
|
|
@@ -722,14 +753,14 @@ function k(e, n, r, a) {
|
|
|
722
753
|
e != null && e > 0 && (d = Math.sqrt(e) * t * 2 / a);
|
|
723
754
|
}
|
|
724
755
|
let f = l?.markerFill ?? l?.color ?? i.markerFill ?? o, p = l?.markerLine ?? i.markerLine ?? null;
|
|
725
|
-
|
|
756
|
+
M(e, G(c), K(r), u, d, f, p, a);
|
|
726
757
|
}
|
|
727
758
|
}
|
|
728
|
-
|
|
759
|
+
P(e, i, s, B, G, K, L, a);
|
|
729
760
|
}
|
|
730
|
-
|
|
761
|
+
y(e, n, g, o, s, l, u, A, j, F, L, h + 2), n.catAxisTitle && m(e, n.catAxisTitle, A, j, F, L, "cat", E), n.valAxisTitle && m(e, n.valAxisTitle, A, j, F, L, "val", E);
|
|
731
762
|
}
|
|
732
|
-
function
|
|
763
|
+
function M(e, t, n, r, i, a, o, s) {
|
|
733
764
|
let c = Math.max(2, i * s), l = c / 2, u = a.startsWith("#") ? a : `#${a}`, d = o ? o.startsWith("#") ? o : `#${o}` : null;
|
|
734
765
|
switch (e.save(), e.fillStyle = u, d && (e.strokeStyle = d, e.lineWidth = 1), r) {
|
|
735
766
|
case "square":
|
|
@@ -769,8 +800,8 @@ function A(e, t, n, r, i, a, o, s) {
|
|
|
769
800
|
}
|
|
770
801
|
e.restore();
|
|
771
802
|
}
|
|
772
|
-
function
|
|
773
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / 12700) : 1, e.setLineDash(
|
|
803
|
+
function N(e, t, n, r, i, a, o, s) {
|
|
804
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / 12700) : 1, e.setLineDash(L(n.dash));
|
|
774
805
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both", u = n.dir === "x", d = e.lineWidth * 1.5;
|
|
775
806
|
for (let s = 0; s < t.values.length; s++) {
|
|
776
807
|
let f = t.values[s];
|
|
@@ -792,7 +823,7 @@ function j(e, t, n, r, i, a, o, s) {
|
|
|
792
823
|
}
|
|
793
824
|
e.restore();
|
|
794
825
|
}
|
|
795
|
-
function
|
|
826
|
+
function P(e, t, n, r, i, a, o, s) {
|
|
796
827
|
let l = t.dataLabelOverrides ?? [];
|
|
797
828
|
if (l.length === 0 && !t.seriesDataLabels) return;
|
|
798
829
|
let u = t.seriesDataLabels;
|
|
@@ -810,10 +841,10 @@ function M(e, t, n, r, i, a, o, s) {
|
|
|
810
841
|
if (u.showCatName && !r && e.push(n[d] ?? ""), u.showSerName && e.push(t.name), u.showVal && e.push(c(f, u.formatCode ?? null)), h = e.filter(Boolean).join(" "), !h) continue;
|
|
811
842
|
} else continue;
|
|
812
843
|
let g = m?.position ?? u?.position ?? "r", _ = m?.fontSizeHpt ?? u?.fontSizeHpt, v = _ ? _ / 100 * s : Math.max(9, Math.min(11, o / 25)), y = m?.fontColor ?? u?.fontColor, b = m?.fontBold ?? u?.fontBold ?? !1;
|
|
813
|
-
|
|
844
|
+
F(e, i(p), a(f), h, g, v, y, b);
|
|
814
845
|
}
|
|
815
846
|
}
|
|
816
|
-
function
|
|
847
|
+
function F(e, t, n, r, i, a, o, s) {
|
|
817
848
|
e.save(), e.font = `${s ? "bold " : ""}${a}px sans-serif`, e.fillStyle = o ? `#${o}` : "#333";
|
|
818
849
|
let c = a * .6, l = t, u = n;
|
|
819
850
|
switch (i) {
|
|
@@ -841,10 +872,10 @@ function N(e, t, n, r, i, a, o, s) {
|
|
|
841
872
|
for (let t of d) e.fillText(t, l, m), m += f;
|
|
842
873
|
e.restore();
|
|
843
874
|
}
|
|
844
|
-
function
|
|
875
|
+
function I(e, t, n) {
|
|
845
876
|
return e < t ? t : e > n ? n : e;
|
|
846
877
|
}
|
|
847
|
-
function
|
|
878
|
+
function L(e) {
|
|
848
879
|
if (!e) return [];
|
|
849
880
|
switch (e) {
|
|
850
881
|
case "solid": return [];
|
|
@@ -879,7 +910,7 @@ function F(e) {
|
|
|
879
910
|
default: return [];
|
|
880
911
|
}
|
|
881
912
|
}
|
|
882
|
-
function
|
|
913
|
+
function R(e, t, n) {
|
|
883
914
|
let { x: r, y: a, w: o, h: s } = n, c = t.valAxisHidden ? o * .01 : o * .11, l = o * .01, u = s * .12, d = s * .14, f = r + c, p = a + u, m = o - c - l, h = s - u - d, g = t.series[0]?.values ?? [], _ = t.categories, v = _.length;
|
|
884
915
|
if (v === 0) return;
|
|
885
916
|
let y = new Set(t.subtotalIndices), b = 0, x = [];
|
|
@@ -913,25 +944,26 @@ function I(e, t, n) {
|
|
|
913
944
|
e.beginPath(), e.moveTo(f, n), e.lineTo(f + m, n), e.stroke(), e.fillText(t.toLocaleString(), f - 4, n);
|
|
914
945
|
}
|
|
915
946
|
}
|
|
916
|
-
|
|
917
|
-
|
|
947
|
+
let M = !t.valAxisHidden && !t.valAxisLineHidden, N = !t.catAxisHidden && !t.catAxisLineHidden;
|
|
948
|
+
(M || N) && (e.strokeStyle = "#bbb", e.lineWidth = 1, e.beginPath(), M ? (e.moveTo(f, p), e.lineTo(f, p + h), N && e.lineTo(f + m, p + h)) : N && (e.moveTo(f, p + h), e.lineTo(f + m, p + h)), e.stroke());
|
|
949
|
+
let P = m / v, F = P / (1 + (t.barGapWidth ?? 150) / 100);
|
|
918
950
|
x.forEach((n, r) => {
|
|
919
|
-
let i = f +
|
|
920
|
-
if (n.isSub ? (e.fillStyle = "#196ECA", e.fillRect(i, a,
|
|
921
|
-
let t = f +
|
|
922
|
-
e.strokeStyle = "#ccc", e.lineWidth = .8, e.setLineDash([3, 3]), e.beginPath(), e.moveTo(i +
|
|
951
|
+
let i = f + P * r + (P - F) / 2, a = p + h * (1 - (n.end - D) / O), o = p + h * (1 - (n.start - D) / O), c = Math.max(1, o - a);
|
|
952
|
+
if (n.isSub ? (e.fillStyle = "#196ECA", e.fillRect(i, a, F, c)) : (e.strokeStyle = n.isPos ? "#5BA4E6" : "#E46970", e.lineWidth = 1.5, e.strokeRect(i + .75, a + .75, F - 1.5, c - 1.5)), r < v - 1) {
|
|
953
|
+
let t = f + P * (r + 1) + (P - F) / 2, s = n.isPos ? a : o;
|
|
954
|
+
e.strokeStyle = "#ccc", e.lineWidth = .8, e.setLineDash([3, 3]), e.beginPath(), e.moveTo(i + F, s), e.lineTo(t, s), e.stroke(), e.setLineDash([]);
|
|
923
955
|
}
|
|
924
956
|
let l = g[r] ?? 0, u = l < 0 ? `△ ${Math.abs(l).toLocaleString()}` : l.toLocaleString(), d = t.series[0]?.dataLabelColors?.[r] ?? null;
|
|
925
|
-
e.fillStyle = d ? `#${d}` : t.dataLabelFontColor ? `#${t.dataLabelFontColor}` : "#595959", e.font = `bold ${Math.round(s * .044)}px sans-serif`, e.textAlign = "center", l < 0 ? (e.textBaseline = "top", e.fillText(u, i +
|
|
957
|
+
e.fillStyle = d ? `#${d}` : t.dataLabelFontColor ? `#${t.dataLabelFontColor}` : "#595959", e.font = `bold ${Math.round(s * .044)}px sans-serif`, e.textAlign = "center", l < 0 ? (e.textBaseline = "top", e.fillText(u, i + F / 2, o + 3)) : (e.textBaseline = "bottom", e.fillText(u, i + F / 2, a - 3));
|
|
926
958
|
}), e.textAlign = "center", e.textBaseline = "top", e.fillStyle = "#666", e.font = `${Math.round(s * .038)}px sans-serif`;
|
|
927
|
-
let
|
|
959
|
+
let I = p + h + 4;
|
|
928
960
|
for (let t = 0; t < v; t++) {
|
|
929
|
-
let n = f +
|
|
930
|
-
_[t].split(/\s+/).forEach((t, r) => e.fillText(t, n,
|
|
961
|
+
let n = f + P * t + P / 2;
|
|
962
|
+
_[t].split(/\s+/).forEach((t, r) => e.fillText(t, n, I + r * (j + 2)));
|
|
931
963
|
}
|
|
932
964
|
e.restore();
|
|
933
965
|
}
|
|
934
|
-
function
|
|
966
|
+
function z(e, t, n, r = 1.333) {
|
|
935
967
|
let { x: i, y: a, w: o, h: s } = n;
|
|
936
968
|
if (t.chartBg && (e.fillStyle = `#${t.chartBg}`, e.fillRect(i, a, o, s)), t.series.length === 0) {
|
|
937
969
|
e.fillStyle = "#888", e.font = "12px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText("(no data)", i + o / 2, a + s / 2);
|
|
@@ -944,36 +976,36 @@ function L(e, t, n, r = 1.333) {
|
|
|
944
976
|
case "stackedBarH":
|
|
945
977
|
case "stackedBarPct":
|
|
946
978
|
case "stackedBarHPct":
|
|
947
|
-
|
|
979
|
+
E(e, t, n, r);
|
|
948
980
|
break;
|
|
949
981
|
case "line":
|
|
950
982
|
case "stackedLine":
|
|
951
983
|
case "stackedLinePct":
|
|
952
|
-
|
|
984
|
+
D(e, t, n, r);
|
|
953
985
|
break;
|
|
954
986
|
case "area":
|
|
955
987
|
case "stackedArea":
|
|
956
988
|
case "stackedAreaPct":
|
|
957
|
-
|
|
989
|
+
O(e, t, n, r);
|
|
958
990
|
break;
|
|
959
991
|
case "pie":
|
|
960
|
-
|
|
992
|
+
k(e, t, n, !1, r);
|
|
961
993
|
break;
|
|
962
994
|
case "doughnut":
|
|
963
|
-
|
|
995
|
+
k(e, t, n, !0, r);
|
|
964
996
|
break;
|
|
965
997
|
case "radar":
|
|
966
|
-
|
|
998
|
+
A(e, t, n, r);
|
|
967
999
|
break;
|
|
968
1000
|
case "scatter":
|
|
969
1001
|
case "bubble":
|
|
970
|
-
|
|
1002
|
+
j(e, t, n, r);
|
|
971
1003
|
break;
|
|
972
1004
|
case "waterfall":
|
|
973
|
-
|
|
1005
|
+
R(e, t, n);
|
|
974
1006
|
break;
|
|
975
1007
|
default: e.fillStyle = "#888", e.font = "11px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`Chart: ${t.chartType}`, i + o / 2, a + s / 2);
|
|
976
1008
|
}
|
|
977
1009
|
}
|
|
978
1010
|
//#endregion
|
|
979
|
-
export {
|
|
1011
|
+
export { z as t };
|