logitude-dashboard-library 3.2.37 → 3.2.39
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/Utils/General.d.ts +1 -1
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +17 -10
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -730,11 +730,15 @@ var getGlobalNumberFormatting = function getGlobalNumberFormatting() {
|
|
|
730
730
|
return numberSeparatorSettings;
|
|
731
731
|
};
|
|
732
732
|
|
|
733
|
-
var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value, decimalDigitsCount) {
|
|
733
|
+
var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value, decimalDigitsCount, isToolTip) {
|
|
734
734
|
if (decimalDigitsCount === void 0) {
|
|
735
735
|
decimalDigitsCount = -1;
|
|
736
736
|
}
|
|
737
737
|
|
|
738
|
+
if (isToolTip === void 0) {
|
|
739
|
+
isToolTip = false;
|
|
740
|
+
}
|
|
741
|
+
|
|
738
742
|
if (isNaN(value) || value == null || value == undefined) return value + "";
|
|
739
743
|
var decimalParts = value.toString().split(".");
|
|
740
744
|
var maxFractionDigits = decimalParts[1] ? decimalParts[1].length : 0;
|
|
@@ -742,10 +746,13 @@ var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value,
|
|
|
742
746
|
|
|
743
747
|
var _numberSeparatorSettings = getGlobalNumberFormatting();
|
|
744
748
|
|
|
745
|
-
|
|
746
|
-
|
|
749
|
+
if (!isToolTip) {
|
|
750
|
+
var factor = Math.pow(10, decimalDigitsCount);
|
|
751
|
+
var truncatedValue = Math.floor(value * factor) / factor;
|
|
752
|
+
value = truncatedValue;
|
|
753
|
+
}
|
|
747
754
|
|
|
748
|
-
var _val =
|
|
755
|
+
var _val = value.toLocaleString('en-US', {
|
|
749
756
|
minimumFractionDigits: 0,
|
|
750
757
|
maximumFractionDigits: decimalDigitsCount
|
|
751
758
|
});
|
|
@@ -2105,7 +2112,7 @@ function buildToolTip(widget, value, seriesMeasure, label, index, groupbyId, sec
|
|
|
2105
2112
|
var customToolTip = "\n <div style=\"min-width: 108px;" + padding + "\">\n\n <div style=\"display: flex;align-items: center;margin-bottom: 6px;\">\n <span style=\"margin: 0; min-height: 10px; min-width: 10px; height: 10px; width: 10px; background-color: transparent; border-radius: 50%; display: inline-block;\"></span>\n <p style=\" margin: 0; margin-left: 4px; white-space: pre-line; font-family: 'Manrope'; font-style: normal;font-weight: 400; font-size: 11px; line-height: 100%; color: #323232;\"> " + getTooltiplabel(label, seriesMeasure) + "</p>\n </div>\n\n <hr style=\"margin: 0;border-top: 1px solid #F0F0F0;\">\n\n <div style=\"display: flex;align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope'; white-space: pre-line; font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;\"> " + getMeasureType(seriesMeasure) + "</p>\n <p style=\"margin: 0;margin-left: 6px; white-space: pre-line; font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #A4A4A4;\">" + getTooltipValue(value, seriesMeasure) + "</p>\n " + getTooltipPercentage(widget) + " </div> ";
|
|
2106
2113
|
|
|
2107
2114
|
if (RenderStackedChartTotalsAndPercentages(widget, seriesMeasure)) {
|
|
2108
|
-
customToolTip += "<div>\n\n <hr style=\"margin-top: 6px;border-top: 1px solid #F0F0F0;\">\n\n <div style=\"display: flex; flex-direction: column; gap: 6px; flex-d align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope'; white-space: pre-line; font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;\"> " + getGroupValuePercentage(seriesMeasure, groupbyId, secGroupbyId) + "</p>\n <p style=\"margin: 0;white-space: pre-line; font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #A4A4A4;\">" + getSumOfGroupValues(seriesMeasure, groupbyId) + "</p>\n </div>\n\n </div>";
|
|
2115
|
+
customToolTip += "<div>\n\n <hr style=\"margin-top: 6px;border-top: 1px solid #F0F0F0;\">\n\n <div style=\"display: flex; flex-direction: column; gap: 6px; flex-d align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope'; white-space: pre-line; font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;\"> " + getGroupValuePercentage(seriesMeasure, groupbyId, secGroupbyId) + "</p>\n </div>\n\n <hr style=\"margin-top: 6px;border-top: 1px solid #F0F0F0;\">\n\n <div style=\"display: flex; flex-direction: column; gap: 6px; flex-d align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;white-space: pre-line; font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #A4A4A4;\">" + getSumOfGroupValues(seriesMeasure, groupbyId) + "</p>\n </div>\n\n </div>";
|
|
2109
2116
|
}
|
|
2110
2117
|
|
|
2111
2118
|
customToolTip += "</div>";
|
|
@@ -2123,7 +2130,7 @@ function RenderStackedChartTotalsAndPercentages(widget, seriesMeasures) {
|
|
|
2123
2130
|
function getGroupValuePercentage(seriesMeasures, groupbyId, secGroupbyId) {
|
|
2124
2131
|
var _seriesMeasures$Value;
|
|
2125
2132
|
|
|
2126
|
-
if (!
|
|
2133
|
+
if (!seriesMeasures) {
|
|
2127
2134
|
return;
|
|
2128
2135
|
}
|
|
2129
2136
|
|
|
@@ -2134,23 +2141,23 @@ function getGroupValuePercentage(seriesMeasures, groupbyId, secGroupbyId) {
|
|
|
2134
2141
|
var percentageValueInLocalFormat = "0";
|
|
2135
2142
|
|
|
2136
2143
|
if (total !== 0 && value) {
|
|
2137
|
-
percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, 2);
|
|
2144
|
+
percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, 2, true);
|
|
2138
2145
|
}
|
|
2139
2146
|
|
|
2140
2147
|
return "<span style=\"margin-right:6px;\">Percentage:</span>" + percentageValueInLocalFormat + "%";
|
|
2141
2148
|
}
|
|
2142
2149
|
|
|
2143
2150
|
function getSumOfGroupValues(seriesMeasure, groupbyId) {
|
|
2144
|
-
if (!
|
|
2151
|
+
if (!seriesMeasure) {
|
|
2145
2152
|
return "";
|
|
2146
2153
|
}
|
|
2147
2154
|
|
|
2148
2155
|
var total = getSumOfGroupValuesAsNumber(seriesMeasure, groupbyId);
|
|
2149
|
-
return "<span style=\"margin-right:6px;\">Total:</span>" + getNumberInSystemLocalFormat(total, 2);
|
|
2156
|
+
return "<span style=\"margin-right:6px;\">Total:</span>" + getNumberInSystemLocalFormat(total, 2, true);
|
|
2150
2157
|
}
|
|
2151
2158
|
|
|
2152
2159
|
function getSumOfGroupValuesAsNumber(seriesMeasure, groupbyId) {
|
|
2153
|
-
if (!
|
|
2160
|
+
if (!seriesMeasure) {
|
|
2154
2161
|
return 0;
|
|
2155
2162
|
}
|
|
2156
2163
|
|