@acorex/charts 20.3.48 → 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
|
@@ -61,6 +61,8 @@ class AXGaugeChartComponent extends AXChartComponent {
|
|
|
61
61
|
title: '',
|
|
62
62
|
value: '',
|
|
63
63
|
}, ...(ngDevMode ? [{ debugName: "_tooltipData" }] : []));
|
|
64
|
+
_tooltipRafId = null;
|
|
65
|
+
_pendingTooltipCoords = null;
|
|
64
66
|
// Expose tooltip signals as read-only for the template
|
|
65
67
|
tooltipVisible = this._tooltipVisible.asReadonly();
|
|
66
68
|
tooltipPosition = this._tooltipPosition.asReadonly();
|
|
@@ -393,22 +395,24 @@ class AXGaugeChartComponent extends AXChartComponent {
|
|
|
393
395
|
});
|
|
394
396
|
this._tooltipVisible.set(true);
|
|
395
397
|
}
|
|
396
|
-
/**
|
|
397
|
-
* Updates the tooltip position based on the mouse event
|
|
398
|
-
* For gauge charts, we need simpler coordinate handling since D3 events are already in container coordinates
|
|
399
|
-
*/
|
|
400
398
|
updateTooltipPosition(event) {
|
|
401
|
-
|
|
402
|
-
if (
|
|
399
|
+
this._pendingTooltipCoords = { x: event.clientX, y: event.clientY };
|
|
400
|
+
if (this._tooltipRafId != null)
|
|
403
401
|
return;
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
402
|
+
this._tooltipRafId = requestAnimationFrame(() => {
|
|
403
|
+
this._tooltipRafId = null;
|
|
404
|
+
const coords = this._pendingTooltipCoords;
|
|
405
|
+
if (!coords)
|
|
406
|
+
return;
|
|
407
|
+
const containerEl = this.chartContainerEl()?.nativeElement;
|
|
408
|
+
if (!containerEl)
|
|
409
|
+
return;
|
|
410
|
+
const rect = containerEl.getBoundingClientRect();
|
|
411
|
+
const tooltipEl = containerEl.querySelector('.chart-tooltip');
|
|
412
|
+
const tooltipRect = tooltipEl?.getBoundingClientRect() ?? null;
|
|
413
|
+
const pos = computeTooltipPosition(rect, tooltipRect, coords.x + 10, coords.y - 10, this.TOOLTIP_GAP);
|
|
414
|
+
this._tooltipPosition.set(pos);
|
|
415
|
+
});
|
|
412
416
|
}
|
|
413
417
|
/**
|
|
414
418
|
* Hides the tooltip
|
|
@@ -420,6 +424,11 @@ class AXGaugeChartComponent extends AXChartComponent {
|
|
|
420
424
|
* Cleans up chart resources
|
|
421
425
|
*/
|
|
422
426
|
cleanupChart() {
|
|
427
|
+
if (this._tooltipRafId != null) {
|
|
428
|
+
cancelAnimationFrame(this._tooltipRafId);
|
|
429
|
+
this._tooltipRafId = null;
|
|
430
|
+
}
|
|
431
|
+
this._pendingTooltipCoords = null;
|
|
423
432
|
if (this.svgElement) {
|
|
424
433
|
this.svgElement.remove();
|
|
425
434
|
this.svgElement = null;
|