@codeauradev/ngx-wind-charts 1.0.0 → 1.0.4
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/fesm2022/codeauradev-ngx-wind-charts-map.mjs +2 -2
- package/fesm2022/codeauradev-ngx-wind-charts-map.mjs.map +1 -1
- package/fesm2022/codeauradev-ngx-wind-charts.mjs +232 -118
- package/fesm2022/codeauradev-ngx-wind-charts.mjs.map +1 -1
- package/ngx-charts.css +70 -8
- package/package.json +1 -1
- package/types/codeauradev-ngx-wind-charts.d.ts +13 -0
|
@@ -120,13 +120,18 @@ function donutSlicePath(cx, cy, outer, inner, start, end) {
|
|
|
120
120
|
const [ix1, iy1] = pointOnCircle(cx, cy, inner, start);
|
|
121
121
|
return `M ${round(x0)} ${round(y0)} A ${round(outer)} ${round(outer)} 0 ${large} 1 ${round(x1)} ${round(y1)} L ${round(ix0)} ${round(iy0)} A ${round(inner)} ${round(inner)} 0 ${large} 0 ${round(ix1)} ${round(iy1)} Z`;
|
|
122
122
|
}
|
|
123
|
-
function domainOf(values, includeZero, maxPin) {
|
|
123
|
+
function domainOf(values, includeZero, maxPin, minPin) {
|
|
124
124
|
const finite = values.filter((value) => Number.isFinite(value));
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
const pinned = minPin !== void 0 && Number.isFinite(minPin);
|
|
126
|
+
if (finite.length === 0) {
|
|
127
|
+
const min = pinned ? minPin : 0;
|
|
128
|
+
const max = Math.max(min + 1, maxPin ?? min + 1);
|
|
129
|
+
return {
|
|
130
|
+
min,
|
|
131
|
+
max,
|
|
132
|
+
ticks: [min, max]
|
|
133
|
+
};
|
|
134
|
+
}
|
|
130
135
|
let min = Math.min(...finite);
|
|
131
136
|
let max = Math.max(...finite);
|
|
132
137
|
if (includeZero) {
|
|
@@ -136,17 +141,25 @@ function domainOf(values, includeZero, maxPin) {
|
|
|
136
141
|
if (maxPin !== void 0 && Number.isFinite(maxPin)) max = Math.max(max, maxPin);
|
|
137
142
|
if (min === max) {
|
|
138
143
|
const pad = Math.abs(min) || 1;
|
|
139
|
-
min -= includeZero ? 0 : pad * .5;
|
|
144
|
+
min -= includeZero || pinned ? 0 : pad * .5;
|
|
140
145
|
max += pad * .5;
|
|
141
146
|
if (includeZero) min = Math.min(0, min);
|
|
142
|
-
} else if (!includeZero) {
|
|
147
|
+
} else if (!includeZero && !pinned) {
|
|
143
148
|
const pad = (max - min) * .08;
|
|
144
149
|
min -= pad;
|
|
145
150
|
max += pad;
|
|
146
151
|
}
|
|
147
|
-
|
|
152
|
+
if (pinned) {
|
|
153
|
+
min = minPin;
|
|
154
|
+
if (max <= min) max = min + (Math.abs(min) || 1);
|
|
155
|
+
}
|
|
156
|
+
let ticks = niceTicks(min, max, 4);
|
|
157
|
+
if (pinned) {
|
|
158
|
+
ticks = ticks.filter((tick) => tick >= minPin - 1e-8);
|
|
159
|
+
if (ticks.length === 0 || ticks[0] > minPin + 1e-8) ticks.unshift(minPin);
|
|
160
|
+
}
|
|
148
161
|
return {
|
|
149
|
-
min: ticks[0] ?? min,
|
|
162
|
+
min: pinned ? minPin : ticks[0] ?? min,
|
|
150
163
|
max: ticks[ticks.length - 1] ?? max,
|
|
151
164
|
ticks
|
|
152
165
|
};
|
|
@@ -383,7 +396,8 @@ function barMark(category, seriesName, value, format, color, x, y, width, height
|
|
|
383
396
|
formatted,
|
|
384
397
|
labelX: round(horizontal ? x + width + 6 : x + width / 2),
|
|
385
398
|
labelY: round(horizontal ? y + height / 2 : y - 6),
|
|
386
|
-
showLabel
|
|
399
|
+
showLabel,
|
|
400
|
+
origin: horizontal ? value < 0 ? "right" : "left" : value < 0 ? "top" : "bottom"
|
|
387
401
|
};
|
|
388
402
|
}
|
|
389
403
|
function layoutTrend(input) {
|
|
@@ -392,7 +406,7 @@ function layoutTrend(input) {
|
|
|
392
406
|
const series = input.series;
|
|
393
407
|
const empty = categories.length === 0 || series.length === 0;
|
|
394
408
|
const stacked = input.stacked ?? false;
|
|
395
|
-
const domain = domainOf(stacked ? categories.map((_, index) => series.reduce((sum, item) => sum + num(item.data[index] ?? 0), 0)) : series.reduce((all, item) => all.concat(item.data.map(num)), []), stacked || Boolean(input.filled), void 0);
|
|
409
|
+
const domain = domainOf(stacked ? categories.map((_, index) => series.reduce((sum, item) => sum + num(item.data[index] ?? 0), 0)) : series.reduce((all, item) => all.concat(item.data.map(num)), []), stacked || Boolean(input.filled), void 0, input.min);
|
|
396
410
|
const longest = domain.ticks.reduce((max, tick) => Math.max(max, input.format(tick).length), 2);
|
|
397
411
|
const pad = {
|
|
398
412
|
top: 16,
|
|
@@ -411,6 +425,8 @@ function layoutTrend(input) {
|
|
|
411
425
|
ticks: [],
|
|
412
426
|
categories: [],
|
|
413
427
|
zero: null,
|
|
428
|
+
baseline: height,
|
|
429
|
+
fromZero: false,
|
|
414
430
|
legend: []
|
|
415
431
|
};
|
|
416
432
|
const y = scale(domain.min, domain.max, plot.bottom, plot.top);
|
|
@@ -425,67 +441,66 @@ function layoutTrend(input) {
|
|
|
425
441
|
y: plot.bottom + 16,
|
|
426
442
|
anchor: "middle"
|
|
427
443
|
})).filter((_, index) => index % step === 0);
|
|
444
|
+
const baseline = round(y(domain.min < 0 && domain.max > 0 ? 0 : domain.min));
|
|
428
445
|
const baselines = categories.map(() => 0);
|
|
429
|
-
const layouts = series.map((item, seriesIndex) => {
|
|
430
|
-
const color = seriesColor(item.color, seriesIndex, palette);
|
|
431
|
-
const points = categories.map((category, index) => {
|
|
432
|
-
const value = num(item.data[index] ?? 0);
|
|
433
|
-
const base = stacked ? baselines[index] ?? 0 : 0;
|
|
434
|
-
const yValue = stacked ? base + value : value;
|
|
435
|
-
if (stacked) baselines[index] = yValue;
|
|
436
|
-
return {
|
|
437
|
-
key: `${seriesIndex}-${index}`,
|
|
438
|
-
x: round(xAt(index)),
|
|
439
|
-
y: round(y(yValue)),
|
|
440
|
-
value,
|
|
441
|
-
formatted: input.format(value),
|
|
442
|
-
category,
|
|
443
|
-
series: item.name,
|
|
444
|
-
color
|
|
445
|
-
};
|
|
446
|
-
});
|
|
447
|
-
const line = points.map((point, index) => `${index === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
|
|
448
|
-
let area = null;
|
|
449
|
-
if (input.filled) {
|
|
450
|
-
if (!stacked) {
|
|
451
|
-
const baseline = round(y(domain.min < 0 && domain.max > 0 ? 0 : domain.min));
|
|
452
|
-
area = `${line} L ${points[points.length - 1]?.x ?? 0} ${baseline} L ${points[0]?.x ?? 0} ${baseline} Z`;
|
|
453
|
-
} else {
|
|
454
|
-
const previous = seriesIndex === 0 ? categories.map((_, index) => ({
|
|
455
|
-
x: round(xAt(index)),
|
|
456
|
-
y: round(y(0))
|
|
457
|
-
})) : null;
|
|
458
|
-
area = `${line} ${(previous ? [...previous].reverse() : categories.map((_, index) => {
|
|
459
|
-
const base = series.slice(0, seriesIndex).reduce((sum, entry) => sum + num(entry.data[index] ?? 0), 0);
|
|
460
|
-
return {
|
|
461
|
-
x: round(xAt(index)),
|
|
462
|
-
y: round(y(base))
|
|
463
|
-
};
|
|
464
|
-
}).reverse()).map((point) => `L ${point.x} ${point.y}`).join(" ")} Z`;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
return {
|
|
468
|
-
name: item.name,
|
|
469
|
-
color,
|
|
470
|
-
line,
|
|
471
|
-
area,
|
|
472
|
-
points
|
|
473
|
-
};
|
|
474
|
-
});
|
|
475
|
-
const zeroY = round(y(0));
|
|
476
446
|
return {
|
|
477
447
|
empty: false,
|
|
478
448
|
width,
|
|
479
449
|
height,
|
|
480
|
-
series:
|
|
450
|
+
series: series.map((item, seriesIndex) => {
|
|
451
|
+
const color = seriesColor(item.color, seriesIndex, palette);
|
|
452
|
+
const points = categories.map((category, index) => {
|
|
453
|
+
const value = num(item.data[index] ?? 0);
|
|
454
|
+
const base = stacked ? baselines[index] ?? 0 : 0;
|
|
455
|
+
const yValue = stacked ? base + value : value;
|
|
456
|
+
if (stacked) baselines[index] = yValue;
|
|
457
|
+
return {
|
|
458
|
+
key: `${seriesIndex}-${index}`,
|
|
459
|
+
x: round(xAt(index)),
|
|
460
|
+
y: round(y(yValue)),
|
|
461
|
+
value,
|
|
462
|
+
formatted: input.format(value),
|
|
463
|
+
category,
|
|
464
|
+
series: item.name,
|
|
465
|
+
color
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
const line = points.map((point, index) => `${index === 0 ? "M" : "L"} ${point.x} ${point.y}`).join(" ");
|
|
469
|
+
let area = null;
|
|
470
|
+
if (input.filled) {
|
|
471
|
+
if (!stacked) area = `${line} L ${points[points.length - 1]?.x ?? 0} ${baseline} L ${points[0]?.x ?? 0} ${baseline} Z`;
|
|
472
|
+
else {
|
|
473
|
+
const previous = seriesIndex === 0 ? categories.map((_, index) => ({
|
|
474
|
+
x: round(xAt(index)),
|
|
475
|
+
y: round(y(0))
|
|
476
|
+
})) : null;
|
|
477
|
+
area = `${line} ${(previous ? [...previous].reverse() : categories.map((_, index) => {
|
|
478
|
+
const base = series.slice(0, seriesIndex).reduce((sum, entry) => sum + num(entry.data[index] ?? 0), 0);
|
|
479
|
+
return {
|
|
480
|
+
x: round(xAt(index)),
|
|
481
|
+
y: round(y(base))
|
|
482
|
+
};
|
|
483
|
+
}).reverse()).map((point) => `L ${point.x} ${point.y}`).join(" ")} Z`;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return {
|
|
487
|
+
name: item.name,
|
|
488
|
+
color,
|
|
489
|
+
line,
|
|
490
|
+
area,
|
|
491
|
+
points
|
|
492
|
+
};
|
|
493
|
+
}),
|
|
481
494
|
ticks: yTicks(domain.ticks, input.format, plot),
|
|
482
495
|
categories: categoryLabels,
|
|
483
496
|
zero: domain.min < 0 && domain.max > 0 ? {
|
|
484
497
|
x1: plot.left,
|
|
485
|
-
y1:
|
|
498
|
+
y1: baseline,
|
|
486
499
|
x2: plot.right,
|
|
487
|
-
y2:
|
|
500
|
+
y2: baseline
|
|
488
501
|
} : null,
|
|
502
|
+
baseline,
|
|
503
|
+
fromZero: domain.min <= 0 && domain.max >= 0,
|
|
489
504
|
legend: legendOf(series, palette)
|
|
490
505
|
};
|
|
491
506
|
}
|
|
@@ -899,7 +914,7 @@ var NgxChartFrame = class NgxChartFrame {
|
|
|
899
914
|
<div class="ngx-tip" [style.left.px]="tip.x" [style.top.px]="tip.y">
|
|
900
915
|
<div class="font-medium">{{ tip.title }}</div>
|
|
901
916
|
@for (row of tip.rows; track row.label) {
|
|
902
|
-
<div class="ngx-
|
|
917
|
+
<div class="ngx-tip-row">
|
|
903
918
|
<span class="ngx-swatch" [style.background]="row.swatch"></span>
|
|
904
919
|
<span>{{ row.label }}</span>
|
|
905
920
|
<span class="ml-auto pl-3 font-medium text-foreground">{{ row.value }}</span>
|
|
@@ -972,7 +987,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
972
987
|
<div class="ngx-tip" [style.left.px]="tip.x" [style.top.px]="tip.y">
|
|
973
988
|
<div class="font-medium">{{ tip.title }}</div>
|
|
974
989
|
@for (row of tip.rows; track row.label) {
|
|
975
|
-
<div class="ngx-
|
|
990
|
+
<div class="ngx-tip-row">
|
|
976
991
|
<span class="ngx-swatch" [style.background]="row.swatch"></span>
|
|
977
992
|
<span>{{ row.label }}</span>
|
|
978
993
|
<span class="ml-auto pl-3 font-medium text-foreground">{{ row.value }}</span>
|
|
@@ -1144,8 +1159,10 @@ function chartBox(preferred, initialWidth = 640) {
|
|
|
1144
1159
|
height
|
|
1145
1160
|
};
|
|
1146
1161
|
}
|
|
1162
|
+
let nextFillId = 0;
|
|
1147
1163
|
var NgxLineChart = class NgxLineChart {
|
|
1148
1164
|
host = inject(ElementRef);
|
|
1165
|
+
fillId = `ngx-fill-${nextFillId++}`;
|
|
1149
1166
|
data = input(void 0, ...ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []);
|
|
1150
1167
|
series = input(void 0, ...ngDevMode ? [{ debugName: "series" }] : /* istanbul ignore next */ []);
|
|
1151
1168
|
categories = input(void 0, ...ngDevMode ? [{ debugName: "categories" }] : /* istanbul ignore next */ []);
|
|
@@ -1158,6 +1175,7 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1158
1175
|
colors = input(void 0, ...ngDevMode ? [{ debugName: "colors" }] : /* istanbul ignore next */ []);
|
|
1159
1176
|
ariaLabel = input("Line chart", ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
1160
1177
|
title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
1178
|
+
min = input(void 0, ...ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []);
|
|
1161
1179
|
animate = input(true, ...ngDevMode ? [{ debugName: "animate" }] : /* istanbul ignore next */ []);
|
|
1162
1180
|
box = chartBox(this.height);
|
|
1163
1181
|
tip = signal(null, ...ngDevMode ? [{ debugName: "tip" }] : /* istanbul ignore next */ []);
|
|
@@ -1175,17 +1193,28 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1175
1193
|
palette: this.colors(),
|
|
1176
1194
|
format: resolveFormat(this.format(), this.currency()),
|
|
1177
1195
|
filled: this.filled(),
|
|
1178
|
-
stacked: this.stacked()
|
|
1196
|
+
stacked: this.stacked(),
|
|
1197
|
+
min: this.min()
|
|
1179
1198
|
}), ...ngDevMode ? [{ debugName: "layout" }] : /* istanbul ignore next */ []);
|
|
1180
1199
|
legendOn = computed(() => this.showLegend() ?? this.layout().legend.length > 1, ...ngDevMode ? [{ debugName: "legendOn" }] : /* istanbul ignore next */ []);
|
|
1200
|
+
riseOrigin = computed(() => this.layout().baseline / Math.max(this.layout().height, 1) * 100, ...ngDevMode ? [{ debugName: "riseOrigin" }] : /* istanbul ignore next */ []);
|
|
1181
1201
|
headers = computed(() => ["Category", ...this.normalized().series.map((item) => item.name)], ...ngDevMode ? [{ debugName: "headers" }] : /* istanbul ignore next */ []);
|
|
1182
1202
|
rows = computed(() => this.normalized().categories.map((category, index) => [category, ...this.normalized().series.map((item) => String(item.data[index] ?? 0))]), ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
|
|
1203
|
+
drawDelay(index, count) {
|
|
1204
|
+
if (count <= 1) return 0;
|
|
1205
|
+
return Math.round(index / (count - 1) * 700);
|
|
1206
|
+
}
|
|
1183
1207
|
onPoint(point, event) {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1208
|
+
const index = Number(point.key.slice(point.key.indexOf("-") + 1));
|
|
1209
|
+
const rows = this.layout().series.map((item) => {
|
|
1210
|
+
const match = item.points[index] ?? point;
|
|
1211
|
+
return {
|
|
1212
|
+
swatch: match.color,
|
|
1213
|
+
label: item.name,
|
|
1214
|
+
value: match.formatted
|
|
1215
|
+
};
|
|
1216
|
+
});
|
|
1217
|
+
this.tip.set(tooltipAt(event, point.category, rows));
|
|
1189
1218
|
}
|
|
1190
1219
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1191
1220
|
minVersion: "12.0.0",
|
|
@@ -1286,6 +1315,13 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1286
1315
|
isRequired: false,
|
|
1287
1316
|
transformFunction: null
|
|
1288
1317
|
},
|
|
1318
|
+
min: {
|
|
1319
|
+
classPropertyName: "min",
|
|
1320
|
+
publicName: "min",
|
|
1321
|
+
isSignal: true,
|
|
1322
|
+
isRequired: false,
|
|
1323
|
+
transformFunction: null
|
|
1324
|
+
},
|
|
1289
1325
|
animate: {
|
|
1290
1326
|
classPropertyName: "animate",
|
|
1291
1327
|
publicName: "animate",
|
|
@@ -1327,32 +1363,60 @@ var NgxLineChart = class NgxLineChart {
|
|
|
1327
1363
|
@if (layout().zero; as zero) {
|
|
1328
1364
|
<line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
|
|
1329
1365
|
}
|
|
1330
|
-
|
|
1331
|
-
@
|
|
1332
|
-
|
|
1366
|
+
<defs>
|
|
1367
|
+
@for (item of layout().series; track item.name; let index = $index) {
|
|
1368
|
+
@if (item.area) {
|
|
1369
|
+
<linearGradient
|
|
1370
|
+
[attr.id]="fillId + '-' + index"
|
|
1371
|
+
gradientUnits="userSpaceOnUse"
|
|
1372
|
+
x1="0"
|
|
1373
|
+
[attr.y1]="0"
|
|
1374
|
+
x2="0"
|
|
1375
|
+
[attr.y2]="layout().baseline"
|
|
1376
|
+
>
|
|
1377
|
+
<stop offset="0%" [attr.stop-color]="item.color" stop-opacity="0.32" />
|
|
1378
|
+
<stop offset="100%" [attr.stop-color]="item.color" stop-opacity="0" />
|
|
1379
|
+
</linearGradient>
|
|
1380
|
+
}
|
|
1333
1381
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
<
|
|
1345
|
-
[attr.
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
stroke="
|
|
1351
|
-
|
|
1352
|
-
|
|
1382
|
+
</defs>
|
|
1383
|
+
<g [class.ngx-rise-on]="animate() && layout().fromZero" [style.--ngx-rise-origin.%]="riseOrigin()">
|
|
1384
|
+
@for (item of layout().series; track item.name; let index = $index) {
|
|
1385
|
+
@if (item.area) {
|
|
1386
|
+
<path
|
|
1387
|
+
[attr.d]="item.area"
|
|
1388
|
+
[attr.fill]="'url(#' + fillId + '-' + index + ')'"
|
|
1389
|
+
[class.ngx-in]="animate() && !layout().fromZero"
|
|
1390
|
+
/>
|
|
1391
|
+
}
|
|
1392
|
+
<path
|
|
1393
|
+
[attr.d]="item.line"
|
|
1394
|
+
fill="none"
|
|
1395
|
+
[attr.stroke]="item.color"
|
|
1396
|
+
stroke-width="2"
|
|
1397
|
+
stroke-linejoin="round"
|
|
1398
|
+
stroke-linecap="round"
|
|
1399
|
+
vector-effect="non-scaling-stroke"
|
|
1400
|
+
[class.ngx-draw]="animate() && !layout().fromZero"
|
|
1401
|
+
[attr.pathLength]="animate() && !layout().fromZero ? 1 : null"
|
|
1402
|
+
[attr.stroke-dasharray]="animate() && !layout().fromZero ? 1 : null"
|
|
1353
1403
|
/>
|
|
1404
|
+
@for (point of item.points; track point.key; let pointIndex = $index) {
|
|
1405
|
+
<circle
|
|
1406
|
+
[attr.cx]="point.x"
|
|
1407
|
+
[attr.cy]="point.y"
|
|
1408
|
+
r="4"
|
|
1409
|
+
[attr.fill]="point.color"
|
|
1410
|
+
class="cursor-pointer"
|
|
1411
|
+
[class.ngx-pop]="animate() && !layout().fromZero"
|
|
1412
|
+
[style.animation-delay.ms]="animate() && !layout().fromZero ? drawDelay(pointIndex, item.points.length) : 0"
|
|
1413
|
+
stroke="var(--ngx-surface)"
|
|
1414
|
+
stroke-width="1.5"
|
|
1415
|
+
(pointerenter)="onPoint(point, $event)"
|
|
1416
|
+
/>
|
|
1417
|
+
}
|
|
1354
1418
|
}
|
|
1355
|
-
|
|
1419
|
+
</g>
|
|
1356
1420
|
@for (label of layout().categories; track label.label + '-' + label.x) {
|
|
1357
1421
|
<text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
|
|
1358
1422
|
}
|
|
@@ -1423,32 +1487,60 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1423
1487
|
@if (layout().zero; as zero) {
|
|
1424
1488
|
<line class="ngx-zero" [attr.x1]="zero.x1" [attr.y1]="zero.y1" [attr.x2]="zero.x2" [attr.y2]="zero.y2" />
|
|
1425
1489
|
}
|
|
1426
|
-
|
|
1427
|
-
@
|
|
1428
|
-
|
|
1490
|
+
<defs>
|
|
1491
|
+
@for (item of layout().series; track item.name; let index = $index) {
|
|
1492
|
+
@if (item.area) {
|
|
1493
|
+
<linearGradient
|
|
1494
|
+
[attr.id]="fillId + '-' + index"
|
|
1495
|
+
gradientUnits="userSpaceOnUse"
|
|
1496
|
+
x1="0"
|
|
1497
|
+
[attr.y1]="0"
|
|
1498
|
+
x2="0"
|
|
1499
|
+
[attr.y2]="layout().baseline"
|
|
1500
|
+
>
|
|
1501
|
+
<stop offset="0%" [attr.stop-color]="item.color" stop-opacity="0.32" />
|
|
1502
|
+
<stop offset="100%" [attr.stop-color]="item.color" stop-opacity="0" />
|
|
1503
|
+
</linearGradient>
|
|
1504
|
+
}
|
|
1429
1505
|
}
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
<
|
|
1441
|
-
[attr.
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
stroke="
|
|
1447
|
-
|
|
1448
|
-
|
|
1506
|
+
</defs>
|
|
1507
|
+
<g [class.ngx-rise-on]="animate() && layout().fromZero" [style.--ngx-rise-origin.%]="riseOrigin()">
|
|
1508
|
+
@for (item of layout().series; track item.name; let index = $index) {
|
|
1509
|
+
@if (item.area) {
|
|
1510
|
+
<path
|
|
1511
|
+
[attr.d]="item.area"
|
|
1512
|
+
[attr.fill]="'url(#' + fillId + '-' + index + ')'"
|
|
1513
|
+
[class.ngx-in]="animate() && !layout().fromZero"
|
|
1514
|
+
/>
|
|
1515
|
+
}
|
|
1516
|
+
<path
|
|
1517
|
+
[attr.d]="item.line"
|
|
1518
|
+
fill="none"
|
|
1519
|
+
[attr.stroke]="item.color"
|
|
1520
|
+
stroke-width="2"
|
|
1521
|
+
stroke-linejoin="round"
|
|
1522
|
+
stroke-linecap="round"
|
|
1523
|
+
vector-effect="non-scaling-stroke"
|
|
1524
|
+
[class.ngx-draw]="animate() && !layout().fromZero"
|
|
1525
|
+
[attr.pathLength]="animate() && !layout().fromZero ? 1 : null"
|
|
1526
|
+
[attr.stroke-dasharray]="animate() && !layout().fromZero ? 1 : null"
|
|
1449
1527
|
/>
|
|
1528
|
+
@for (point of item.points; track point.key; let pointIndex = $index) {
|
|
1529
|
+
<circle
|
|
1530
|
+
[attr.cx]="point.x"
|
|
1531
|
+
[attr.cy]="point.y"
|
|
1532
|
+
r="4"
|
|
1533
|
+
[attr.fill]="point.color"
|
|
1534
|
+
class="cursor-pointer"
|
|
1535
|
+
[class.ngx-pop]="animate() && !layout().fromZero"
|
|
1536
|
+
[style.animation-delay.ms]="animate() && !layout().fromZero ? drawDelay(pointIndex, item.points.length) : 0"
|
|
1537
|
+
stroke="var(--ngx-surface)"
|
|
1538
|
+
stroke-width="1.5"
|
|
1539
|
+
(pointerenter)="onPoint(point, $event)"
|
|
1540
|
+
/>
|
|
1541
|
+
}
|
|
1450
1542
|
}
|
|
1451
|
-
|
|
1543
|
+
</g>
|
|
1452
1544
|
@for (label of layout().categories; track label.label + '-' + label.x) {
|
|
1453
1545
|
<text [attr.x]="label.x" [attr.y]="label.y" text-anchor="middle" dominant-baseline="middle">{{ label.label }}</text>
|
|
1454
1546
|
}
|
|
@@ -1556,6 +1648,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1556
1648
|
required: false
|
|
1557
1649
|
}]
|
|
1558
1650
|
}],
|
|
1651
|
+
min: [{
|
|
1652
|
+
type: i0.Input,
|
|
1653
|
+
args: [{
|
|
1654
|
+
isSignal: true,
|
|
1655
|
+
alias: "min",
|
|
1656
|
+
required: false
|
|
1657
|
+
}]
|
|
1658
|
+
}],
|
|
1559
1659
|
animate: [{
|
|
1560
1660
|
type: i0.Input,
|
|
1561
1661
|
args: [{
|
|
@@ -1783,13 +1883,20 @@ var NgxBarChart = class NgxBarChart {
|
|
|
1783
1883
|
[attr.fill]="mark.color"
|
|
1784
1884
|
rx="3"
|
|
1785
1885
|
class="cursor-pointer"
|
|
1786
|
-
[class.ngx-
|
|
1886
|
+
[class.ngx-grow-y]="animate() && orientation() !== 'horizontal'"
|
|
1887
|
+
[class.ngx-grow-x]="animate() && orientation() === 'horizontal'"
|
|
1888
|
+
[class.ngx-grow-bottom]="mark.origin === 'bottom'"
|
|
1889
|
+
[class.ngx-grow-top]="mark.origin === 'top'"
|
|
1890
|
+
[class.ngx-grow-left]="mark.origin === 'left'"
|
|
1891
|
+
[class.ngx-grow-right]="mark.origin === 'right'"
|
|
1787
1892
|
[style.animation-delay.ms]="animate() ? $index * 18 : 0"
|
|
1788
1893
|
(pointerenter)="onMark(mark, $event)"
|
|
1789
1894
|
/>
|
|
1790
1895
|
@if (mark.showLabel) {
|
|
1791
1896
|
<text
|
|
1792
1897
|
class="ngx-value"
|
|
1898
|
+
[class.ngx-in]="animate()"
|
|
1899
|
+
[style.animation-delay.ms]="animate() ? $index * 18 + 380 : 0"
|
|
1793
1900
|
[attr.x]="mark.labelX"
|
|
1794
1901
|
[attr.y]="mark.labelY"
|
|
1795
1902
|
[attr.text-anchor]="orientation() === 'horizontal' ? 'start' : 'middle'"
|
|
@@ -1880,13 +1987,20 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1880
1987
|
[attr.fill]="mark.color"
|
|
1881
1988
|
rx="3"
|
|
1882
1989
|
class="cursor-pointer"
|
|
1883
|
-
[class.ngx-
|
|
1990
|
+
[class.ngx-grow-y]="animate() && orientation() !== 'horizontal'"
|
|
1991
|
+
[class.ngx-grow-x]="animate() && orientation() === 'horizontal'"
|
|
1992
|
+
[class.ngx-grow-bottom]="mark.origin === 'bottom'"
|
|
1993
|
+
[class.ngx-grow-top]="mark.origin === 'top'"
|
|
1994
|
+
[class.ngx-grow-left]="mark.origin === 'left'"
|
|
1995
|
+
[class.ngx-grow-right]="mark.origin === 'right'"
|
|
1884
1996
|
[style.animation-delay.ms]="animate() ? $index * 18 : 0"
|
|
1885
1997
|
(pointerenter)="onMark(mark, $event)"
|
|
1886
1998
|
/>
|
|
1887
1999
|
@if (mark.showLabel) {
|
|
1888
2000
|
<text
|
|
1889
2001
|
class="ngx-value"
|
|
2002
|
+
[class.ngx-in]="animate()"
|
|
2003
|
+
[style.animation-delay.ms]="animate() ? $index * 18 + 380 : 0"
|
|
1890
2004
|
[attr.x]="mark.labelX"
|
|
1891
2005
|
[attr.y]="mark.labelY"
|
|
1892
2006
|
[attr.text-anchor]="orientation() === 'horizontal' ? 'start' : 'middle'"
|