logitude-dashboard-library 3.2.41 → 3.2.42

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.
@@ -1,3 +1,4 @@
1
+ import { ReactWidgetPM } from "../types/widget";
1
2
  declare const isNullOrUndefined: (val: any) => boolean;
2
3
  declare const isNullOrUndefinedOrEmpty: (val: any) => boolean;
3
4
  declare const getGlobalNumberFormatting: () => {
@@ -5,7 +6,7 @@ declare const getGlobalNumberFormatting: () => {
5
6
  decimalSeparator: string;
6
7
  };
7
8
  declare const isValueInteger: (measureCode: string | null | undefined, measureFieldType: string | null | undefined) => boolean;
8
- declare const getTruncatedValue: (value: number | null | undefined | any, decimalDigitsCount?: number) => number | null | undefined;
9
- declare const getNumberInSystemLocalFormat: (value: number | null | undefined, decimalDigitsCount?: number, minimumFractionDigits?: number, isValueTruncated?: boolean) => string;
9
+ declare const getTruncatedValue: (value: number | null | undefined | any, widget: ReactWidgetPM) => number | null | undefined;
10
+ declare const getNumberInSystemLocalFormat: (value: number | null | undefined, decimalDigitsCount?: number, minimumFractionDigits?: number, isValueTruncated?: boolean, applyAbbreviation?: boolean) => string;
10
11
  declare const ConvertStringToPascalCaseHelper: (stringValue: string) => string;
11
12
  export { isNullOrUndefined, isNullOrUndefinedOrEmpty, getGlobalNumberFormatting, getNumberInSystemLocalFormat, ConvertStringToPascalCaseHelper, isValueInteger, getTruncatedValue };
@@ -9,7 +9,7 @@ $red: #F74E49;
9
9
  $dark-grey: #717585;
10
10
 
11
11
  .dl-dashboard-body {
12
- background: #F3F3F3;
12
+ background: #f3f4f5;
13
13
  height: 100%;
14
14
  padding: 2px;
15
15
  margin: 0;
@@ -658,12 +658,12 @@ $dark-grey: #717585;
658
658
  font-weight: bold;
659
659
  }
660
660
 
661
- .db-fc-container {
661
+ .db-fc-parent-container {
662
662
  width: 100%;
663
663
  height: calc(100% - 5px);
664
664
  }
665
665
 
666
- .db-fc-parent-container {
666
+ .db-fc-container {
667
667
  width: 100%;
668
668
  height: calc(100% - 5px);
669
669
  }
@@ -674,6 +674,7 @@ $dark-grey: #717585;
674
674
  fill: #323232 !important;
675
675
  fill-opacity: 100 !important;
676
676
  }
677
+
677
678
  .db-fc-container tspan {
678
679
  font-family: 'Manrope' !important;
679
680
  font-size: inherit !important;
@@ -691,6 +692,34 @@ $dark-grey: #717585;
691
692
  height: 100%;
692
693
  }
693
694
 
695
+ .db-fc-container-guage {
696
+ width: 100%;
697
+ height: calc(100% - 5px);
698
+ }
699
+
700
+ .db-fc-container-guage text {
701
+ font-family: 'Manrope' !important;
702
+ font-size: inherit !important;
703
+ fill-opacity: 100 !important;
704
+ }
705
+
706
+ .db-fc-container-guage tspan {
707
+ font-family: 'Manrope' !important;
708
+ font-size: inherit !important;
709
+ fill: #323232 !important;
710
+ fill-opacity: 100 !important;
711
+ }
712
+
713
+ .db-fc-container-guage * {
714
+ font-family: 'Manrope' !important;
715
+ // font-size: 10px !important;
716
+ }
717
+
718
+ .db-fc-container-guage>*:first-child {
719
+ width: 100%;
720
+ height: 100%;
721
+ }
722
+
694
723
  .dl-line {
695
724
  border-top: 1px solid #E7E7E7;
696
725
  margin-left: 12px;
@@ -2,4 +2,4 @@ import { ChartObject } from "fusioncharts";
2
2
  import { SeriesMeasure } from "../../../../types/SeriesMeasure";
3
3
  import { ReactWidgetPM } from "../../../../types/widget";
4
4
  export declare function BuildFusionChartObject(seriesMeasures: SeriesMeasure[], widget: ReactWidgetPM): ChartObject;
5
- export declare const getGaugeObject: (data: any, widget: ReactWidgetPM) => ChartObject;
5
+ export declare const getGaugeObject: (data: any, widget: ReactWidgetPM, isPreviewModeActive?: boolean | undefined) => ChartObject;
@@ -93,7 +93,12 @@ export interface ChartInfo {
93
93
  manageResize: string | null;
94
94
  valueBelowPivot: string | null;
95
95
  showValue: string | null;
96
+ valueFontSize: string | null;
97
+ valueFontColor: string | null;
96
98
  autoScale: string | null;
99
+ formatNumber: string | null;
100
+ forceDecimals: string | null;
101
+ decimals: string | null;
97
102
  }
98
103
  export declare function getSeriesPositionColor(position: number): string | null;
99
104
  export declare function getSeriesHoverPositionColor(position: number): string | null;
package/dist/index.js CHANGED
@@ -856,16 +856,12 @@ var isValueInteger = function isValueInteger(measureCode, measureFieldType) {
856
856
  return false;
857
857
  };
858
858
 
859
- var getTruncatedValue = function getTruncatedValue(value, decimalDigitsCount) {
860
- if (decimalDigitsCount === void 0) {
861
- decimalDigitsCount = 2;
862
- }
863
-
859
+ var getTruncatedValue = function getTruncatedValue(value, widget) {
864
860
  if (value == null || value == undefined || isNaN(value)) return value;
865
- return truncateDecimals(value, decimalDigitsCount);
861
+ return truncateDecimals(value, widget.DecimalPlaces || 0);
866
862
  };
867
863
 
868
- var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value, decimalDigitsCount, minimumFractionDigits, isValueTruncated) {
864
+ var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value, decimalDigitsCount, minimumFractionDigits, isValueTruncated, applyAbbreviation) {
869
865
  if (decimalDigitsCount === void 0) {
870
866
  decimalDigitsCount = -1;
871
867
  }
@@ -878,6 +874,10 @@ var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value,
878
874
  isValueTruncated = true;
879
875
  }
880
876
 
877
+ if (applyAbbreviation === void 0) {
878
+ applyAbbreviation = false;
879
+ }
880
+
881
881
  if (value == null || value == undefined || isNaN(value)) return value + "";
882
882
  var decimalParts = value.toString().split(".");
883
883
  var maxFractionDigits = decimalParts[1] ? decimalParts[1].length : 0;
@@ -889,6 +889,18 @@ var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value,
889
889
  value = truncateDecimals(value, decimalDigitsCount);
890
890
  }
891
891
 
892
+ var abbreviationSymbol = null;
893
+
894
+ if (applyAbbreviation) {
895
+ if (Math.abs(value) >= 1000 && Math.abs(value) < 1000000) {
896
+ value = value / 1000;
897
+ abbreviationSymbol = "K";
898
+ } else if (Math.abs(value) >= 1000000) {
899
+ value = value / 1000000;
900
+ abbreviationSymbol = "M";
901
+ }
902
+ }
903
+
892
904
  var _val = value.toLocaleString('en-US', {
893
905
  minimumFractionDigits: minimumFractionDigits,
894
906
  maximumFractionDigits: decimalDigitsCount
@@ -900,7 +912,7 @@ var getNumberInSystemLocalFormat = function getNumberInSystemLocalFormat(value,
900
912
  _formattedValue = _formattedValue.replaceAll(".", "#");
901
913
  _formattedValue = _formattedValue.replaceAll("*", _numberSeparatorSettings.thousandsSeparator);
902
914
  _formattedValue = _formattedValue.replaceAll("#", _numberSeparatorSettings.decimalSeparator);
903
- return _formattedValue;
915
+ return applyAbbreviation && abbreviationSymbol ? "" + _formattedValue + abbreviationSymbol : _formattedValue;
904
916
  }
905
917
 
906
918
  return value + "";
@@ -1756,17 +1768,19 @@ var TableChart = function TableChart(props) {
1756
1768
  }
1757
1769
 
1758
1770
  var columnValue = data[column.FieldCode];
1771
+ var decimalPlaces = (widget === null || widget === void 0 ? void 0 : widget.DecimalPlaces) || 0;
1772
+ var isAbbreviationApplied = (widget === null || widget === void 0 ? void 0 : widget.UseNumberAbbreviation) || false;
1759
1773
 
1760
1774
  if (FieldDataType.isPercentage(column.DataTypeCode)) {
1761
- return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), 2, 2) + "%" : 0 + '%';
1775
+ return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), decimalPlaces, decimalPlaces, true, isAbbreviationApplied) + "%" : 0 + '%';
1762
1776
  }
1763
1777
 
1764
1778
  if (FieldDataType.isInteger(column.DataTypeCode)) {
1765
- return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), 0, 0, false) : "";
1779
+ return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), decimalPlaces, decimalPlaces, false, isAbbreviationApplied) : "";
1766
1780
  }
1767
1781
 
1768
1782
  if (FieldDataType.isNumericType(column.DataTypeCode)) {
1769
- return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), 2, 2) : "";
1783
+ return !isNullOrUndefined(columnValue) ? getNumberInSystemLocalFormat(Number(columnValue), decimalPlaces, decimalPlaces, true, isAbbreviationApplied) : "";
1770
1784
  }
1771
1785
 
1772
1786
  return ConvertStringToPascalCaseHelper(columnValue);
@@ -1817,6 +1831,8 @@ var TableChart = function TableChart(props) {
1817
1831
  };
1818
1832
 
1819
1833
  var headerTemplate = function headerTemplate(column) {
1834
+ var _widget = props.customChartProps.widget;
1835
+ var showMeasureUnit = _widget.ShowMeasureUnit || false;
1820
1836
 
1821
1837
  if (sortField != column.FieldCode) {
1822
1838
  return React__default.createElement("div", {
@@ -1833,7 +1849,7 @@ var TableChart = function TableChart(props) {
1833
1849
  fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
1834
1850
  },
1835
1851
  className: "p-column-title"
1836
- }, column.DisplayName));
1852
+ }, column.MeasureUnit && showMeasureUnit ? column.DisplayName + " (" + column.MeasureUnit + ")" : column.DisplayName));
1837
1853
  }
1838
1854
 
1839
1855
  return React__default.createElement("div", {
@@ -1850,7 +1866,7 @@ var TableChart = function TableChart(props) {
1850
1866
  fontSize: getTableFormattingPropertyValue("TableHeaderFontSize", "px")
1851
1867
  },
1852
1868
  className: "p-column-title"
1853
- }, column.DisplayName));
1869
+ }, column.MeasureUnit && showMeasureUnit ? column.DisplayName + " (" + column.MeasureUnit + ")" : column.DisplayName));
1854
1870
  };
1855
1871
 
1856
1872
  return isLoading ? React__default.createElement("div", {
@@ -2271,10 +2287,10 @@ function buildToolTip(widget, value, seriesMeasure, label, index, groupbyId, sec
2271
2287
  }
2272
2288
 
2273
2289
  var padding = widget.TypeCode == 'line' && index > 0 ? 'padding-top: 3px' : '';
2274
- 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 " + getPieDonutToolTipPercentage(widget, seriesMeasure, groupbyId, secGroupbyId) + " </div> ";
2290
+ 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, widget) + "</p>\n " + getPieDonutToolTipPercentage(widget, seriesMeasure, groupbyId, secGroupbyId) + " </div> ";
2275
2291
 
2276
2292
  if (RenderStackedChartTotalsAndPercentages(widget, seriesMeasure)) {
2277
- 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>";
2293
+ 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, widget) + "</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, widget) + "</p>\n </div>\n\n </div>";
2278
2294
  }
2279
2295
 
2280
2296
  customToolTip += "</div>";
@@ -2289,31 +2305,33 @@ function RenderStackedChartTotalsAndPercentages(widget, seriesMeasures) {
2289
2305
  return widget.IsStacked && (seriesMeasures.MeasureCode === MeasureCode.Count || seriesMeasures.MeasureCode === MeasureCode.Sum);
2290
2306
  }
2291
2307
 
2292
- function getGroupValuePercentage(seriesMeasures, groupbyId, secGroupbyId) {
2308
+ function getGroupValuePercentage(seriesMeasures, groupbyId, secGroupbyId, widget) {
2293
2309
  if (!seriesMeasures) {
2294
2310
  return;
2295
2311
  }
2296
2312
 
2297
- var percentageValueInLocalFormat = getPercentageGroupValueAsNumber(seriesMeasures, groupbyId, secGroupbyId);
2313
+ var percentageValueInLocalFormat = getPercentageGroupValueAsNumber(seriesMeasures, groupbyId, secGroupbyId, widget);
2298
2314
  return "<span style=\"margin-right:6px;\">Percentage:</span>" + percentageValueInLocalFormat + "%";
2299
2315
  }
2300
2316
 
2301
- function getSumOfGroupValues(seriesMeasure, groupbyId) {
2317
+ function getSumOfGroupValues(seriesMeasure, groupbyId, widget) {
2302
2318
  if (!seriesMeasure) {
2303
2319
  return "";
2304
2320
  }
2305
2321
 
2322
+ var decimalPlaces = (widget === null || widget === void 0 ? void 0 : widget.DecimalPlaces) || 0;
2306
2323
  var total = getSumOfGroupValuesAsNumber(seriesMeasure, groupbyId);
2307
- return "<span style=\"margin-right:6px;\">Total:</span>" + getNumberInSystemLocalFormat(total, 2, 0);
2324
+ return "<span style=\"margin-right:6px;\">Total:</span>" + getNumberInSystemLocalFormat(total, decimalPlaces, decimalPlaces, true);
2308
2325
  }
2309
2326
 
2310
- function getPercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGroupbyId) {
2327
+ function getPercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGroupbyId, widget) {
2311
2328
  var _seriesMeasure$Values;
2312
2329
 
2313
2330
  if (!seriesMeasure) {
2314
2331
  return;
2315
2332
  }
2316
2333
 
2334
+ var decimalPlaces = (widget === null || widget === void 0 ? void 0 : widget.DecimalPlaces) || 0;
2317
2335
  var total = getSumOfGroupValuesAsNumber(seriesMeasure, groupbyId);
2318
2336
  var value = (_seriesMeasure$Values = seriesMeasure.Values.filter(function (v) {
2319
2337
  return v.GroupById === groupbyId && v.GroupByIdSec === secGroupbyId;
@@ -2321,7 +2339,7 @@ function getPercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGroupbyId)
2321
2339
  var percentageValueInLocalFormat = "0.00";
2322
2340
 
2323
2341
  if (total !== 0 && value) {
2324
- percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, 2, 0, false);
2342
+ percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, decimalPlaces, decimalPlaces, false);
2325
2343
  }
2326
2344
 
2327
2345
  return percentageValueInLocalFormat;
@@ -2360,17 +2378,18 @@ function getPieDonutToolTipPercentage(widget, seriesMeasures, groupbyId, secGrou
2360
2378
  return "";
2361
2379
  }
2362
2380
 
2363
- var percentageValueInLocalFormat = getDonutPiePercentageGroupValueAsNumber(seriesMeasures, groupbyId, secGroupbyId);
2381
+ var percentageValueInLocalFormat = getDonutPiePercentageGroupValueAsNumber(seriesMeasures, groupbyId, secGroupbyId, widget);
2364
2382
  return "<p style=\"margin: 0;margin-left: 2px;font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #A4A4A4;flex: none; order: 1;flex-grow: 0;\">(" + percentageValueInLocalFormat + ")%</p>";
2365
2383
  }
2366
2384
 
2367
- function getDonutPiePercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGroupbyId) {
2385
+ function getDonutPiePercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGroupbyId, widget) {
2368
2386
  var _seriesMeasure$Values2;
2369
2387
 
2370
2388
  if (!seriesMeasure) {
2371
2389
  return;
2372
2390
  }
2373
2391
 
2392
+ var decimalPlaces = (widget === null || widget === void 0 ? void 0 : widget.DecimalPlaces) || 0;
2374
2393
  var total = getSumOfValuesAsNumber(seriesMeasure);
2375
2394
  var value = (_seriesMeasure$Values2 = seriesMeasure.Values.filter(function (v) {
2376
2395
  return v.GroupById === groupbyId && v.GroupByIdSec === secGroupbyId;
@@ -2378,7 +2397,7 @@ function getDonutPiePercentageGroupValueAsNumber(seriesMeasure, groupbyId, secGr
2378
2397
  var percentageValueInLocalFormat = "0.00";
2379
2398
 
2380
2399
  if (total !== 0 && value) {
2381
- percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, 2, 0, false);
2400
+ percentageValueInLocalFormat = getNumberInSystemLocalFormat(value / total * 100, decimalPlaces, decimalPlaces, false);
2382
2401
  }
2383
2402
 
2384
2403
  return percentageValueInLocalFormat;
@@ -2390,16 +2409,18 @@ function getTooltiplabel(value, seriesMeasure) {
2390
2409
  return '$label';
2391
2410
  }
2392
2411
 
2393
- function getTooltipValue(value, seriesMeasure) {
2412
+ function getTooltipValue(value, seriesMeasure, widget) {
2394
2413
  if (isNullOrUndefined(value)) {
2395
2414
  return '$dataValue';
2396
2415
  }
2397
2416
 
2417
+ var decimalPlaces = (widget === null || widget === void 0 ? void 0 : widget.DecimalPlaces) || 0;
2418
+
2398
2419
  if (FieldDataType.isPercentage(seriesMeasure === null || seriesMeasure === void 0 ? void 0 : seriesMeasure.MeasureFieldDataType)) {
2399
- return getNumberInSystemLocalFormat(value, 2, 0) + "%";
2420
+ return getNumberInSystemLocalFormat(value, decimalPlaces, decimalPlaces, true) + "%";
2400
2421
  }
2401
2422
 
2402
- return getNumberInSystemLocalFormat(value, 2, 0);
2423
+ return getNumberInSystemLocalFormat(value, decimalPlaces, decimalPlaces, true);
2403
2424
  }
2404
2425
 
2405
2426
  function getMeasureType(seriesMeasure) {
@@ -2465,7 +2486,7 @@ function buildDataSource(values, widget) {
2465
2486
  var series = values[0];
2466
2487
  data = series.Values.map(function (e) {
2467
2488
  var item = {
2468
- value: getTruncatedValue(e.Value),
2489
+ value: getTruncatedValue(e.Value, widget),
2469
2490
  label: getLabelFormatByDateGroupType(e.Label, widget, false),
2470
2491
  id: {
2471
2492
  GroupById: e.GroupById,
@@ -2485,7 +2506,7 @@ function buildDataSet(seriesMeasures, widget) {
2485
2506
  seriesMeasures.forEach(function (seriesMeasure) {
2486
2507
  var datas = seriesMeasure.Values.map(function (e, index) {
2487
2508
  return {
2488
- value: getTruncatedValue(e.Value),
2509
+ value: getTruncatedValue(e.Value, widget),
2489
2510
  id: {
2490
2511
  GroupById: e.GroupById,
2491
2512
  MeasureFieldId: seriesMeasure.MeasureFieldId,
@@ -2583,7 +2604,7 @@ function buildStackedGroupData(secGroup, series, widget) {
2583
2604
  return x.GroupById == group.code && x.GroupByIdSec == secGroup.code;
2584
2605
  })) === null || _series$Values$find === void 0 ? void 0 : _series$Values$find.Value;
2585
2606
  data.push({
2586
- value: getTruncatedValue(value),
2607
+ value: getTruncatedValue(value, widget),
2587
2608
  id: {
2588
2609
  GroupById: group.code,
2589
2610
  MeasureFieldId: series.MeasureFieldId,
@@ -2591,7 +2612,7 @@ function buildStackedGroupData(secGroup, series, widget) {
2591
2612
  MeasureCode: series.MeasureCode,
2592
2613
  Formula: series.Formula
2593
2614
  },
2594
- tooltext: buildToolTip(widget, null, series, group.label + " - " + secGroup.label, 0, group.code, secGroup.code)
2615
+ tooltext: buildToolTip(widget, value, series, group.label + " - " + secGroup.label, 0, group.code, secGroup.code)
2595
2616
  });
2596
2617
  });
2597
2618
  return data;
@@ -2680,13 +2701,15 @@ var getWidgetRanges = function getWidgetRanges(widget, value) {
2680
2701
  return gaugeRanges;
2681
2702
  };
2682
2703
 
2683
- var getGaugeObject = function getGaugeObject(data, widget) {
2704
+ var getGaugeObject = function getGaugeObject(data, widget, isPreviewModeActive) {
2684
2705
  var fusionObject = getDefaultChartobject();
2685
2706
  fusionObject.type = 'angulargauge';
2686
2707
  var chartInfo = getDefaultChartInfo(widget);
2687
2708
  chartInfo.manageResize = "1";
2688
2709
  chartInfo.valueBelowPivot = "1";
2689
- chartInfo.showValue = "1";
2710
+ chartInfo.showValue = widget.ShowValue ? "1" : '0';
2711
+ chartInfo.valueFontSize = widget.ShowValue ? widget.ValueFontSize : null;
2712
+ chartInfo.valueFontColor = widget.ShowValue ? widget.ValueFontColor : null;
2690
2713
  chartInfo.autoScale = "1";
2691
2714
  chartInfo.chartTopMargin = "0";
2692
2715
  chartInfo.chartBottomMargin = "0";
@@ -2700,7 +2723,8 @@ var getGaugeObject = function getGaugeObject(data, widget) {
2700
2723
  },
2701
2724
  "dials": {
2702
2725
  "dial": [{
2703
- "value": getTruncatedValue(value)
2726
+ "value": getTruncatedValue(value, widget),
2727
+ "tooltext": !isPreviewModeActive ? "Click for more details" : null
2704
2728
  }]
2705
2729
  }
2706
2730
  };
@@ -2930,19 +2954,45 @@ function getDefaultChartInfo(widget) {
2930
2954
  }
2931
2955
 
2932
2956
  if (widget.IsStacked && isValuePositionInside && isColumnOrBarChart(widget)) {
2933
- chart.minPlotHeightForValue = "35";
2957
+ chart.minPlotHeightForValue = "15";
2934
2958
  }
2935
2959
 
2936
2960
  if (isValuePositionInside && isPieOrDonutChart(widget)) {
2937
2961
  chart.minAngleForValue = "27";
2938
2962
  }
2939
2963
 
2940
- chart.numberSuffix = isFirstMeasureTypePercentage(widget) ? "%" : null;
2964
+ chart.formatNumber = "1";
2941
2965
 
2942
2966
  var _numberSeparatorSettings = getGlobalNumberFormatting();
2943
2967
 
2944
2968
  chart.thousandSeparator = _numberSeparatorSettings.thousandsSeparator;
2945
2969
  chart.decimalSeparator = _numberSeparatorSettings.decimalSeparator;
2970
+ chart.numberSuffix = isFirstMeasureTypePercentage(widget) ? "%" : null;
2971
+
2972
+ if (widget.ShowMeasureUnit && widget.MeasureUnit1) {
2973
+ chart.numberSuffix = chart.numberSuffix ? " " + widget.MeasureUnit1 + " " + chart.numberSuffix : " " + widget.MeasureUnit1;
2974
+ }
2975
+
2976
+ if (widget.ShowMeasureUnit && widget.MeasureUnit2) {
2977
+ chart.sNumberSuffix = " " + widget.MeasureUnit2;
2978
+ }
2979
+
2980
+ if (isDecimalPlacesEnabled(widget)) {
2981
+ if (widget.DecimalPlaces && widget.DecimalPlaces > 0) {
2982
+ chart.forceDecimals = "1";
2983
+ chart.decimals = "" + widget.DecimalPlaces;
2984
+ } else {
2985
+ chart.forceDecimals = "0";
2986
+ chart.decimals = "0";
2987
+ }
2988
+ }
2989
+
2990
+ if (isWidgetUsedAbbreviation(widget)) {
2991
+ chart.formatNumberScale = "1";
2992
+ } else {
2993
+ chart.formatNumberScale = "0";
2994
+ }
2995
+
2946
2996
  chart.palettecolors = "#369CFB, #FCAF16, #EE5F77, #4AC76F, #935BE0, #FAD337, #32C7C7, #EB67D0, #3C9957, #FF7D4B, #78A6FF, #35838F, #BAA9F3, #C1DA72, #F0AEAD, #246EAB";
2947
2997
  chart.enableSlicing = "0";
2948
2998
  chart.enableRotation = "0";
@@ -2956,7 +3006,6 @@ function getDefaultChartInfo(widget) {
2956
3006
  chart.scrollHeight = "6";
2957
3007
  chart.scrollWidth = "6";
2958
3008
  chart.plotColorinTooltip = "0";
2959
- chart.formatNumberScale = "0";
2960
3009
  return chart;
2961
3010
  }
2962
3011
 
@@ -3014,7 +3063,14 @@ function setDualyAxis(chartInfo, widget, seriesMeasures) {
3014
3063
  chartInfo.showDivLineSecondaryValue = "1";
3015
3064
  chartInfo.pYAxisNameBorderPadding = 0;
3016
3065
  chartInfo.sYAxisNameBorderPadding = 0;
3017
- chartInfo.sNumberSuffix = isSecondMeasureTypePercentage(widget) ? "%" : null;
3066
+
3067
+ if (chartInfo.sNumberSuffix) {
3068
+ if (isSecondMeasureTypePercentage(widget)) {
3069
+ chartInfo.sNumberSuffix = chartInfo.sNumberSuffix + " % ";
3070
+ }
3071
+ } else {
3072
+ chartInfo.sNumberSuffix = isSecondMeasureTypePercentage(widget) ? "%" : null;
3073
+ }
3018
3074
 
3019
3075
  if (isNullOrUndefined(seriesMeasures)) {
3020
3076
  chartInfo.pYAxisName = "";
@@ -3036,6 +3092,26 @@ function getTitle(text, maxLenght) {
3036
3092
  return text.replace(/\s+/g, '&nbsp;&nbsp;');
3037
3093
  }
3038
3094
 
3095
+ function isDecimalPlacesEnabled(widget) {
3096
+ if (widget.TypeCode == "pivot") {
3097
+ return false;
3098
+ }
3099
+
3100
+ return true;
3101
+ }
3102
+
3103
+ function isWidgetUsedAbbreviation(widget) {
3104
+ if (!widget || widget.TypeCode == 'kpi' || widget.TypeCode == 'pivot') {
3105
+ return false;
3106
+ }
3107
+
3108
+ if (widget.UseNumberAbbreviation) {
3109
+ return true;
3110
+ }
3111
+
3112
+ return false;
3113
+ }
3114
+
3039
3115
  var FusionChartHelper = /*#__PURE__*/function () {
3040
3116
  function FusionChartHelper(widget, chart) {
3041
3117
  this.chart = chart;
@@ -3738,7 +3814,7 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
3738
3814
  isDummyChange = false;
3739
3815
  }
3740
3816
 
3741
- var chart = getGaugeObject(data, widget.current);
3817
+ var chart = getGaugeObject(data, widget.current, props.isPreviewModeActive);
3742
3818
  setArgs(chart);
3743
3819
 
3744
3820
  if (!isDummyChange) {
@@ -3750,6 +3826,67 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
3750
3826
  }
3751
3827
  };
3752
3828
 
3829
+ var dataplotClick = function dataplotClick(eventObj, dataObj) {
3830
+ props.onSelectDataPoint({
3831
+ GroupById: dataObj.id.groupbyid,
3832
+ MeasureFieldId: dataObj.id.measurefieldid,
3833
+ MeasureCode: dataObj.id.measurecode,
3834
+ Formula: dataObj.id.formula,
3835
+ Widget: widget.current,
3836
+ GroupByIdSec: dataObj.id.groupbyidsec
3837
+ });
3838
+ };
3839
+
3840
+ var renderComplete = function renderComplete(eventObj) {
3841
+ var chartRef = eventObj.sender;
3842
+ var chartContainer = FusionCharts.getObjectReference(chartRef.id);
3843
+
3844
+ if (!chartContainer) {
3845
+ console.error('Chart container is undefined');
3846
+ return;
3847
+ }
3848
+
3849
+ var svgContainer = chartContainer.querySelector('svg');
3850
+
3851
+ if (!svgContainer) {
3852
+ console.error('SVG Container is undefined');
3853
+ return;
3854
+ }
3855
+
3856
+ var textElements = svgContainer.querySelectorAll('text');
3857
+
3858
+ if (textElements.length > 0) {
3859
+ var lastTextElement = textElements[textElements.length - 1];
3860
+
3861
+ if (!props.isPreviewModeActive) {
3862
+ lastTextElement.style.cursor = 'pointer';
3863
+ lastTextElement.style.transition = 'fill 0.2s, text-decoration 0.2s';
3864
+ lastTextElement.addEventListener('mouseenter', function () {
3865
+ lastTextElement.style.fill = '#007bff';
3866
+ lastTextElement.style.textDecoration = 'underline';
3867
+ });
3868
+ lastTextElement.addEventListener('mouseleave', function () {
3869
+ lastTextElement.style.fill = '';
3870
+ lastTextElement.style.textDecoration = 'none';
3871
+ });
3872
+ }
3873
+
3874
+ lastTextElement.addEventListener('click', function () {
3875
+ var _widget$current2, _widget$current3, _widget$current4, _widget$current4$Widg;
3876
+
3877
+ var measureFieldId;
3878
+ var currentWidgetMeasure = widget === null || widget === void 0 ? void 0 : (_widget$current2 = widget.current) === null || _widget$current2 === void 0 ? void 0 : _widget$current2.WidgetMeasures[0];
3879
+ if (widget !== null && widget !== void 0 && (_widget$current3 = widget.current) !== null && _widget$current3 !== void 0 && _widget$current3.WidgetMeasures) measureFieldId = widget === null || widget === void 0 ? void 0 : (_widget$current4 = widget.current) === null || _widget$current4 === void 0 ? void 0 : (_widget$current4$Widg = _widget$current4.WidgetMeasures[0]) === null || _widget$current4$Widg === void 0 ? void 0 : _widget$current4$Widg.MeasureFieldId;
3880
+ props.onSelectDataPoint({
3881
+ MeasureFieldId: measureFieldId,
3882
+ Widget: widget.current,
3883
+ MeasureCode: currentWidgetMeasure.MeasureCode,
3884
+ Formula: currentWidgetMeasure.Formula
3885
+ });
3886
+ });
3887
+ }
3888
+ };
3889
+
3753
3890
  return !dataLoaded ? React__default.createElement("div", {
3754
3891
  ref: progressRef,
3755
3892
  className: 'dl-full-hight dl-flex-content-center spinner-custome'
@@ -3764,10 +3901,13 @@ var FusionChart$1 = React.forwardRef(function (props, comRef) {
3764
3901
  className: 'db-fc-parent-container',
3765
3902
  ref: fusionRef
3766
3903
  }, React__default.createElement("div", {
3767
- className: 'db-fc-container',
3904
+ className: 'db-fc-container-guage',
3768
3905
  key: fusionKey,
3769
3906
  id: chartContainerId
3770
- }, React__default.createElement(ReactFC, Object.assign({}, args)))) : React__default.createElement("div", {
3907
+ }, React__default.createElement(ReactFC, Object.assign({}, args, {
3908
+ "fcEvent-dataplotClick": dataplotClick,
3909
+ "fcEvent-renderComplete": renderComplete
3910
+ })))) : React__default.createElement("div", {
3771
3911
  className: "dl-flex-content-center dl-full-hight",
3772
3912
  style: {
3773
3913
  width: '100%'