@oliasoft-open-source/charts-library 3.3.6-beta-1 → 3.3.6-beta-2

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
@@ -37570,14 +37570,12 @@ const getLineChartToolTips = (options) => {
37570
37570
  const labelNumber = valueLabel === TooltipLabel.X ? tooltipItem.parsed.x : tooltipItem.parsed.y;
37571
37571
  return Math.abs(labelNumber) < 1 ? labelNumber.toPrecision(3) : labelNumber.toFixed(3);
37572
37572
  };
37573
- const splitValueAxisLabel = valueAxisLabel.split(" ");
37574
- const newValueAxisLabel = hideSimulationName ? splitValueAxisLabel[splitValueAxisLabel.length - 1] : valueAxisLabel;
37575
37573
  const tooltipItemValue = getTooltipItemValue();
37576
- const valAxisLabel = label === valueAxisLabel || valueAxisLabel.includes(label) ? "" : newValueAxisLabel;
37577
37574
  const tooltipLabel = getTooltipLabel(tooltipItem, showLabelsInTooltips);
37575
+ const matches = valueAxisLabel.match(/\[(.*?)\]/g);
37576
+ const units = matches && matches.length > 0 ? matches[0] : "";
37578
37577
  const truncatedLabel = truncateMiddle(label);
37579
- const truncatedAxisLabel = truncateMiddle(valAxisLabel);
37580
- return `${truncatedLabel}: ${tooltipItemValue} ${truncatedAxisLabel}${tooltipLabel}`;
37578
+ return `${truncatedLabel}: ${tooltipItemValue} ${units} ${tooltipLabel}`;
37581
37579
  };
37582
37580
  return {
37583
37581
  enabled: options.tooltip.tooltips,