@oliasoft-open-source/charts-library 3.4.5-beta-1 → 3.4.5
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
|
@@ -25060,6 +25060,11 @@ const getAnnotation = (options, state) => {
|
|
|
25060
25060
|
const annotations = shouldGenerateAnnotations ? generateAnnotations(options, state) : null;
|
|
25061
25061
|
return { annotations };
|
|
25062
25062
|
};
|
|
25063
|
+
const getUnitsFromLabel = (label) => {
|
|
25064
|
+
const matches = label.match(/\[(.*)\]/g);
|
|
25065
|
+
const units = matches && matches.length > 0 ? matches[0] : "";
|
|
25066
|
+
return units;
|
|
25067
|
+
};
|
|
25063
25068
|
const getLineChartToolTips = (options) => {
|
|
25064
25069
|
const getTooltipLabels = (dataset) => {
|
|
25065
25070
|
var _a2, _b2;
|
|
@@ -25105,13 +25110,8 @@ const getLineChartToolTips = (options) => {
|
|
|
25105
25110
|
roundScientificCoefficient: 4
|
|
25106
25111
|
}) : displayNumber(labelNumber);
|
|
25107
25112
|
};
|
|
25108
|
-
const getTooltipItemUnits = () => {
|
|
25109
|
-
const matches = valueAxisLabel.match(/\[(.*?)\]/g);
|
|
25110
|
-
const units2 = matches && matches.length > 0 ? matches[0] : "";
|
|
25111
|
-
return units2;
|
|
25112
|
-
};
|
|
25113
25113
|
const tooltipItemValue = getTooltipItemValue();
|
|
25114
|
-
const units =
|
|
25114
|
+
const units = getUnitsFromLabel(valueAxisLabel);
|
|
25115
25115
|
const tooltipLabel = getTooltipLabel(tooltipItem, showLabelsInTooltips);
|
|
25116
25116
|
return `${label}: ${tooltipItemValue} ${units} ${tooltipLabel}`;
|
|
25117
25117
|
};
|