@acorex/charts 20.3.47 → 20.3.50
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/bar-chart/index.d.ts +2 -4
- package/chart-tooltip/index.d.ts +1 -0
- package/donut-chart/index.d.ts +9 -10
- package/fesm2022/acorex-charts-bar-chart.mjs +23 -13
- package/fesm2022/acorex-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-chart-tooltip.mjs +11 -2
- package/fesm2022/acorex-charts-chart-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-charts-donut-chart.mjs +68 -92
- package/fesm2022/acorex-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-gauge-chart.mjs +23 -14
- package/fesm2022/acorex-charts-gauge-chart.mjs.map +1 -1
- package/fesm2022/acorex-charts-line-chart.mjs +23 -7
- package/fesm2022/acorex-charts-line-chart.mjs.map +1 -1
- package/gauge-chart/index.d.ts +2 -4
- package/line-chart/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -73,6 +73,8 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
73
73
|
percentage: '0%',
|
|
74
74
|
color: '',
|
|
75
75
|
}, ...(ngDevMode ? [{ debugName: "_tooltipData" }] : []));
|
|
76
|
+
_tooltipRafId = null;
|
|
77
|
+
_pendingTooltipCoords = null;
|
|
76
78
|
_initialized = signal(false, ...(ngDevMode ? [{ debugName: "_initialized" }] : []));
|
|
77
79
|
_rendered = signal(false, ...(ngDevMode ? [{ debugName: "_rendered" }] : []));
|
|
78
80
|
hiddenSeries = new Set();
|
|
@@ -350,6 +352,11 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
350
352
|
this.createChart();
|
|
351
353
|
}
|
|
352
354
|
cleanupChart() {
|
|
355
|
+
if (this._tooltipRafId != null) {
|
|
356
|
+
cancelAnimationFrame(this._tooltipRafId);
|
|
357
|
+
this._tooltipRafId = null;
|
|
358
|
+
}
|
|
359
|
+
this._pendingTooltipCoords = null;
|
|
353
360
|
if (this.svg) {
|
|
354
361
|
this.d3?.select(this.chartContainerEl()?.nativeElement).selectAll('svg').remove();
|
|
355
362
|
this.svg = null;
|
|
@@ -1047,14 +1054,23 @@ class AXLineChartComponent extends AXChartComponent {
|
|
|
1047
1054
|
.attr('pointer-events', 'none');
|
|
1048
1055
|
}
|
|
1049
1056
|
updateTooltipPosition(event) {
|
|
1050
|
-
|
|
1051
|
-
if (
|
|
1057
|
+
this._pendingTooltipCoords = { x: event.clientX, y: event.clientY };
|
|
1058
|
+
if (this._tooltipRafId != null)
|
|
1052
1059
|
return;
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1060
|
+
this._tooltipRafId = requestAnimationFrame(() => {
|
|
1061
|
+
this._tooltipRafId = null;
|
|
1062
|
+
const coords = this._pendingTooltipCoords;
|
|
1063
|
+
if (!coords)
|
|
1064
|
+
return;
|
|
1065
|
+
const containerEl = this.chartContainerEl()?.nativeElement;
|
|
1066
|
+
if (!containerEl)
|
|
1067
|
+
return;
|
|
1068
|
+
const rect = containerEl.getBoundingClientRect();
|
|
1069
|
+
const tooltipEl = containerEl.querySelector('.chart-tooltip');
|
|
1070
|
+
const tooltipRect = tooltipEl ? tooltipEl.getBoundingClientRect() : null;
|
|
1071
|
+
const pos = computeTooltipPosition(rect, tooltipRect, coords.x, coords.y, this.TOOLTIP_GAP);
|
|
1072
|
+
this._tooltipPosition.set(pos);
|
|
1073
|
+
});
|
|
1058
1074
|
}
|
|
1059
1075
|
// computeTooltipPosition moved to shared chart utils
|
|
1060
1076
|
handlePointClick(event, dataPoint, series) {
|