@oliasoft-open-source/charts-library 3.3.6 → 3.3.7
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 +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37545,7 +37545,10 @@ const getLineChartToolTips = (options) => {
|
|
|
37545
37545
|
const labels = getTooltipLabels(tooltipItem[0].dataset);
|
|
37546
37546
|
const { titleLabel, titleAxisLabel } = labels;
|
|
37547
37547
|
const formattedValue = titleLabel === TooltipLabel.Y ? tooltipItem[0].parsed.y : tooltipItem[0].parsed.x;
|
|
37548
|
-
const roundedValue = Math.abs(formattedValue) < 1 ? formattedValue
|
|
37548
|
+
const roundedValue = Math.abs(formattedValue) < 1 ? displayNumber(formattedValue, {
|
|
37549
|
+
scientific: true,
|
|
37550
|
+
roundScientificCoefficient: 4
|
|
37551
|
+
}) : displayNumber(formattedValue);
|
|
37549
37552
|
return `${roundedValue} ${titleAxisLabel}`;
|
|
37550
37553
|
};
|
|
37551
37554
|
const labelCallback = (tooltipItem) => {
|
|
@@ -37555,7 +37558,10 @@ const getLineChartToolTips = (options) => {
|
|
|
37555
37558
|
const { valueLabel, valueAxisLabel } = labels;
|
|
37556
37559
|
const getTooltipItemValue = () => {
|
|
37557
37560
|
const labelNumber = valueLabel === TooltipLabel.X ? tooltipItem.parsed.x : tooltipItem.parsed.y;
|
|
37558
|
-
return Math.abs(labelNumber) < 1 ? labelNumber
|
|
37561
|
+
return Math.abs(labelNumber) < 1 ? displayNumber(labelNumber, {
|
|
37562
|
+
scientific: true,
|
|
37563
|
+
roundScientificCoefficient: 4
|
|
37564
|
+
}) : displayNumber(labelNumber);
|
|
37559
37565
|
};
|
|
37560
37566
|
const splitValueAxisLabel = valueAxisLabel.split(" ");
|
|
37561
37567
|
const newValueAxisLabel = hideSimulationName ? splitValueAxisLabel[splitValueAxisLabel.length - 1] : valueAxisLabel;
|