@tetacom/svg-charts 1.7.26 → 1.7.27

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.
@@ -1846,7 +1846,7 @@ class LinearSeriesBaseComponent extends SeriesBaseComponent {
1846
1846
  if (x0 instanceof Date) {
1847
1847
  x0 = x0.getTime();
1848
1848
  }
1849
- const rightId = bisect(this.series().data, x0);
1849
+ const rightId = bisect([...this.series().data.sort((a, b) => a.x - b.x)], x0);
1850
1850
  const range = scaleY.range();
1851
1851
  const intersect = lineIntersection(pointer, range[0], pointer, Number.MAX_SAFE_INTEGER, scaleX(this.series().data[rightId - 1]?.x), scaleY(this.series().data[rightId - 1]?.y), scaleX(this.series().data[rightId]?.x), scaleY(this.series().data[rightId]?.y));
1852
1852
  const x = scaleX.invert(intersect.x);
@@ -1877,7 +1877,7 @@ class LinearSeriesBaseComponent extends SeriesBaseComponent {
1877
1877
  if (y0 instanceof Date) {
1878
1878
  y0 = y0.getTime();
1879
1879
  }
1880
- const rightId = bisect(this.series().data, y0);
1880
+ const rightId = bisect([...this.series().data.sort((a, b) => a.y - b.y)], y0);
1881
1881
  const range = scaleX.range();
1882
1882
  const intersect = lineIntersection(range[0], mouse[1], Number.MAX_SAFE_INTEGER, mouse[1], scaleX(this.series().data[rightId - 1]?.x), scaleY(this.series().data[rightId - 1]?.y), scaleX(this.series().data[rightId]?.x), scaleY(this.series().data[rightId]?.y));
1883
1883
  const x = scaleX.invert(intersect.x);