@oliasoft-open-source/charts-library 3.3.1 → 3.3.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 +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ import { Icon, Tooltip as Tooltip$2, Button, Flex, Text, Menu, Popover, Field, I
|
|
|
14
14
|
import PropTypes from "prop-types";
|
|
15
15
|
import { debounce as debounce$3, isEqual } from "lodash";
|
|
16
16
|
import { jsx as jsx$1 } from "react/jsx-runtime.js";
|
|
17
|
+
import { roundNumberToPrecision } from "@oliasoft-open-source/units/dist/rounding/rounding";
|
|
17
18
|
/*!
|
|
18
19
|
* @kurkle/color v0.3.2
|
|
19
20
|
* https://github.com/kurkle/color#readme
|
|
@@ -38546,7 +38547,8 @@ const PieChart = (props) => {
|
|
|
38546
38547
|
const value = tooltipItem.dataset.data[dataIndex];
|
|
38547
38548
|
const labelValue = typeof value === "object" ? `${value.value || ""} ${options.tooltip.showLabelsInTooltips && value.label ? "(" + value.label + ")" : ""}` : value;
|
|
38548
38549
|
const unit = (data == null ? void 0 : data.yUnit) ? `[${data == null ? void 0 : data.yUnit}]` : "";
|
|
38549
|
-
|
|
38550
|
+
const formattedValue = Math.abs(labelValue) < 1 ? roundNumberToPrecision(labelValue, { n: 3 }) : round$2(labelValue, 3);
|
|
38551
|
+
return `${dataLabel} ${formattedValue} ${unit}`;
|
|
38550
38552
|
}
|
|
38551
38553
|
}
|
|
38552
38554
|
};
|