@eclipse-scout/chart 23.1.12 → 23.1.14

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.
@@ -1841,6 +1841,10 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
1841
1841
  if (isTooltipShowing) {
1842
1842
  this._renderTooltipLater(context);
1843
1843
  } else {
1844
+ // clear timeout before creating a new handler.
1845
+ // Otherwise, changing the context within the tooltip delay time creates a second handler
1846
+ // and the first one will always be executed, since the tooltipTimoutId reference to it is lost
1847
+ clearTimeout(this._tooltipTimeoutId);
1844
1848
  this._tooltipTimeoutId = setTimeout(() => this._renderTooltipLater(context), _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.tooltips.DEFAULT_TOOLTIP_DELAY);
1845
1849
  }
1846
1850
  }
@@ -1876,11 +1880,8 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
1876
1880
  if (_eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.objects.isFunction(tooltipItems)) {
1877
1881
  tooltipText += _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.arrays.ensure(tooltipItems(dataPoints, tooltipLabel, tooltipLabelValue, tooltipColor)).join('');
1878
1882
  }
1879
- let positionAndOffset = this._computeTooltipPositionAndOffset(firstDataPoint),
1880
- origin = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.graphics.offsetBounds(this.$canvas);
1881
- origin.x += tooltip.caretX + positionAndOffset.offsetX;
1882
- origin.y += tooltip.caretY + positionAndOffset.offsetY;
1883
- origin.height = positionAndOffset.height;
1883
+ let positionAndOffset = this._computeTooltipPositionAndOffset(firstDataPoint);
1884
+ let offset = new _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.Point(tooltip.caretX + positionAndOffset.offsetX, tooltip.caretY + positionAndOffset.offsetY);
1884
1885
  this._tooltip = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.scout.create({
1885
1886
  objectType: _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.Tooltip,
1886
1887
  parent: this.chart,
@@ -1890,7 +1891,12 @@ class ChartJsRenderer extends _index__WEBPACK_IMPORTED_MODULE_0__.AbstractChartR
1890
1891
  cssClass: _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.strings.join(' ', 'chart-tooltip', tooltipOptions.cssClass),
1891
1892
  tooltipPosition: positionAndOffset.tooltipPosition,
1892
1893
  tooltipDirection: positionAndOffset.tooltipDirection,
1893
- origin: origin
1894
+ originProducer: $anchor => {
1895
+ const origin = _eclipse_scout_core__WEBPACK_IMPORTED_MODULE_2__.graphics.offsetBounds($anchor);
1896
+ origin.height = positionAndOffset.height;
1897
+ return origin;
1898
+ },
1899
+ offsetProducer: origin => offset
1894
1900
  });
1895
1901
  this._tooltip.render();
1896
1902
  this._tooltip.$container.css('pointer-events', 'none');