@oliasoft-open-source/charts-library 3.6.2 → 3.6.3

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/dist/index.js CHANGED
@@ -25502,23 +25502,29 @@ const getLineChartDataLabels = (options) => {
25502
25502
  formatter: (_value, context) => context.dataset.data[context.dataIndex].label || ""
25503
25503
  } : { display: false };
25504
25504
  };
25505
- const annotationEnter = ({ element }, { chart: chart2 }) => {
25505
+ const annotationEnter = (element, chart2) => {
25506
25506
  var _a2;
25507
25507
  if ((_a2 = element.options.scaleID) == null ? void 0 : _a2.includes(AxisType.X)) {
25508
25508
  element.options.label.xAdjust = chart2.chartArea.left;
25509
25509
  }
25510
25510
  element.options.borderWidth = BORDER_WIDTH.HOVERED;
25511
- if (element.options.label)
25511
+ if (element.options.label) {
25512
+ element.label.options.display = true;
25512
25513
  element.options.label.enabled = true;
25514
+ }
25513
25515
  chart2.draw();
25514
25516
  chart2.canvas.style.cursor = CursorStyle.Pointer;
25517
+ return true;
25515
25518
  };
25516
- const annotationLeave = ({ element }, { chart: chart2 }) => {
25519
+ const annotationLeave = (element, chart2) => {
25517
25520
  element.options.borderWidth = BORDER_WIDTH.INITIAL;
25518
- if (element.options.label)
25521
+ if (element.options.label) {
25522
+ element.label.options.display = false;
25519
25523
  element.options.label.enabled = false;
25524
+ }
25520
25525
  chart2.draw();
25521
25526
  chart2.canvas.style.cursor = CursorStyle.Initial;
25527
+ return true;
25522
25528
  };
25523
25529
  const generateAnnotations = (options, state) => {
25524
25530
  const { annotationsData } = (options == null ? void 0 : options.annotations) || {};
@@ -25537,22 +25543,22 @@ const generateAnnotations = (options, state) => {
25537
25543
  const label = type === "line" ? {
25538
25544
  backgroundColor: color2,
25539
25545
  content: curr == null ? void 0 : curr.label,
25540
- enabled: false,
25546
+ display: false,
25541
25547
  position: Position.Top
25542
25548
  } : {
25543
25549
  content: curr == null ? void 0 : curr.label,
25544
- enabled: true,
25550
+ display: true,
25545
25551
  font: { weight: "normal" }
25546
25552
  };
25547
- const enter = (context, event) => {
25553
+ const enter = ({ element }, { chart: chart2 }) => {
25548
25554
  if (type !== "line")
25549
25555
  return;
25550
- annotationEnter(context, event);
25556
+ annotationEnter(element, chart2);
25551
25557
  };
25552
- const leave = (context, event) => {
25558
+ const leave = ({ element }, { chart: chart2 }) => {
25553
25559
  if (type !== "line")
25554
25560
  return;
25555
- annotationLeave(context, event);
25561
+ annotationLeave(element, chart2);
25556
25562
  };
25557
25563
  const annotation2 = {
25558
25564
  ...curr,