logitude-dashboard-library 3.1.6 → 3.1.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 CHANGED
@@ -700,78 +700,6 @@ var CustomChart = function CustomChart(props) {
700
700
  }, project());
701
701
  };
702
702
 
703
- var plotColorsDictionary = {
704
- plotColor0: "#369CFB",
705
- plotColor1: "#4AC76F",
706
- plotColor2: "#F6CF33",
707
- plotColor3: "#32C7C7",
708
- plotColor4: "#935BE0",
709
- plotColor5: "#FAAD14",
710
- plotColor6: "#EE5F77",
711
- plotColor7: "#5D62B5",
712
- plotColor8: "#29C3BE",
713
- plotColor9: "#F2726F",
714
- plotColor10: "#FFC533",
715
- plotColor11: "#62B58F",
716
- plotColor12: "#BC95DF",
717
- plotColor13: "#67CDF2"
718
- };
719
-
720
- var getPlotColorByIndexOrder = function getPlotColorByIndexOrder(index) {
721
- var _index = index;
722
-
723
- if (_index >= 14) {
724
- _index = _index % 14;
725
- }
726
-
727
- switch (_index) {
728
- case 0:
729
- return plotColorsDictionary.plotColor0;
730
-
731
- case 1:
732
- return plotColorsDictionary.plotColor1;
733
-
734
- case 2:
735
- return plotColorsDictionary.plotColor2;
736
-
737
- case 3:
738
- return plotColorsDictionary.plotColor3;
739
-
740
- case 4:
741
- return plotColorsDictionary.plotColor4;
742
-
743
- case 5:
744
- return plotColorsDictionary.plotColor5;
745
-
746
- case 6:
747
- return plotColorsDictionary.plotColor6;
748
-
749
- case 7:
750
- return plotColorsDictionary.plotColor7;
751
-
752
- case 8:
753
- return plotColorsDictionary.plotColor8;
754
-
755
- case 9:
756
- return plotColorsDictionary.plotColor9;
757
-
758
- case 10:
759
- return plotColorsDictionary.plotColor10;
760
-
761
- case 11:
762
- return plotColorsDictionary.plotColor11;
763
-
764
- case 12:
765
- return plotColorsDictionary.plotColor12;
766
-
767
- case 13:
768
- return plotColorsDictionary.plotColor13;
769
-
770
- default:
771
- return "#0566c2";
772
- }
773
- };
774
-
775
703
  function buildToolTip(widget, value, seriesName, label, index) {
776
704
  var padding = widget.TypeCode == 'line' && index > 0 ? 'padding-top: 3px' : '';
777
705
  return "\n <div style=\"min-width: 108px;" + padding + "\">\n <div style=\"display: flex;align-items: center;margin-bottom: 6px;\">\n <span style=\"margin: 0; height: 10px; width: 10px; background-color: transparent; border-radius: 50%; display: inline-block;\"></span>\n <p style=\" margin: 0; margin-left: 4px;font-family: 'Manrope'; font-style: normal;font-weight: 400; font-size: 11px; line-height: 100%; color: #323232; flex: none; order: 1;flex-grow: 0;\"> " + getTooltiplabel(label) + "</p>\n </div>\n <hr style=\"margin: 0;border-top: 1px solid #F0F0F0;\">\n <div style=\"display: flex;align-items: center;margin:0;margin-top: 6px;\">\n <p style=\"margin: 0;font-family: 'Manrope';font-style: normal;font-weight: 400; font-size: 11px;line-height: 100%;color: #A4A4A4;flex: none;order: 0;flex-grow: 0;\"> " + getMeasureType(seriesName) + "</p>\n <p style=\"margin: 0;margin-left: 6px;font-family: 'Manrope';font-style: normal;font-weight: 500;font-size: 11px;line-height: 100%; color: #323232;flex: none; order: 1;flex-grow: 0;\">" + getTooltipValue(value) + "</p>\n " + getTooltipPercentage(widget) + " </div>\n </div>\n ";
@@ -872,7 +800,6 @@ function buildDataSource(values, widget) {
872
800
 
873
801
  function buildDataSet(seriesMeasures, widget) {
874
802
  var dataSet = [];
875
- var seriesPosition = 1;
876
803
  seriesMeasures.forEach(function (seriesMeasure) {
877
804
  var datas = seriesMeasure.Values.map(function (e, index) {
878
805
  return {
@@ -886,18 +813,16 @@ function buildDataSet(seriesMeasures, widget) {
886
813
  tooltext: buildToolTip(widget, e.Value, seriesMeasure, null, index)
887
814
  };
888
815
  });
889
- var color = getPlotColorByIndexOrder(seriesPosition);
890
816
  dataSet.push({
891
817
  data: datas,
892
818
  seriesname: seriesMeasure.Name,
893
- anchorBgColor: color,
819
+ anchorBgColor: "inherit",
894
820
  anchorBorderColor: "#FFFFFF",
895
821
  anchorBorderThickness: "2",
896
- anchorHoverColor: color,
822
+ anchorHoverColor: "inherit",
897
823
  parentyaxis: seriesMeasure.PlotasLineChart && seriesMeasure.PlotonSecondAxis ? 'S' : "P",
898
824
  renderAs: seriesMeasure.PlotasLineChart ? 'line' : "column"
899
825
  });
900
- seriesPosition++;
901
826
  });
902
827
  return dataSet;
903
828
  }
@@ -1421,6 +1346,78 @@ var FusionChartHelper = /*#__PURE__*/function () {
1421
1346
  return FusionChartHelper;
1422
1347
  }();
1423
1348
 
1349
+ var plotColorsDictionary = {
1350
+ plotColor0: "#369CFB",
1351
+ plotColor1: "#4AC76F",
1352
+ plotColor2: "#F6CF33",
1353
+ plotColor3: "#32C7C7",
1354
+ plotColor4: "#935BE0",
1355
+ plotColor5: "#FAAD14",
1356
+ plotColor6: "#EE5F77",
1357
+ plotColor7: "#5D62B5",
1358
+ plotColor8: "#29C3BE",
1359
+ plotColor9: "#F2726F",
1360
+ plotColor10: "#FFC533",
1361
+ plotColor11: "#62B58F",
1362
+ plotColor12: "#BC95DF",
1363
+ plotColor13: "#67CDF2"
1364
+ };
1365
+
1366
+ var getPlotColorByIndexOrder = function getPlotColorByIndexOrder(index) {
1367
+ var _index = index;
1368
+
1369
+ if (_index >= 14) {
1370
+ _index = _index % 14;
1371
+ }
1372
+
1373
+ switch (_index) {
1374
+ case 0:
1375
+ return plotColorsDictionary.plotColor0;
1376
+
1377
+ case 1:
1378
+ return plotColorsDictionary.plotColor1;
1379
+
1380
+ case 2:
1381
+ return plotColorsDictionary.plotColor2;
1382
+
1383
+ case 3:
1384
+ return plotColorsDictionary.plotColor3;
1385
+
1386
+ case 4:
1387
+ return plotColorsDictionary.plotColor4;
1388
+
1389
+ case 5:
1390
+ return plotColorsDictionary.plotColor5;
1391
+
1392
+ case 6:
1393
+ return plotColorsDictionary.plotColor6;
1394
+
1395
+ case 7:
1396
+ return plotColorsDictionary.plotColor7;
1397
+
1398
+ case 8:
1399
+ return plotColorsDictionary.plotColor8;
1400
+
1401
+ case 9:
1402
+ return plotColorsDictionary.plotColor9;
1403
+
1404
+ case 10:
1405
+ return plotColorsDictionary.plotColor10;
1406
+
1407
+ case 11:
1408
+ return plotColorsDictionary.plotColor11;
1409
+
1410
+ case 12:
1411
+ return plotColorsDictionary.plotColor12;
1412
+
1413
+ case 13:
1414
+ return plotColorsDictionary.plotColor13;
1415
+
1416
+ default:
1417
+ return "#0566c2";
1418
+ }
1419
+ };
1420
+
1424
1421
  ReactFC.fcRoot(FusionCharts, Charts, FusionTheme);
1425
1422
  FusionCharts.options['license']({
1426
1423
  key: 'prD4C-8eiA7A3A3C7E6G4B4A3J4C7B2D3D2nyqE1C3fd1npaE4D4tlA-21D7E4F4F1F1E1F4F1A10A8C2C5F5E2F2D1hwqD1B5D1aG4A19A32twbC6D3G4lhJ-7A9C11A5B-13ddA2I3A1B9B3D7A2B4G2H3H1F-7smC8B2XB4cetB8A7A5mxD3SG4F2tvgB2A3B2E4C3I3C7B3A4A3A2D3D2G4J-7==',
@@ -1604,9 +1601,19 @@ var FusionChart = React.forwardRef(function (props, comRef) {
1604
1601
  setFchart(chart);
1605
1602
  };
1606
1603
 
1607
- var loaded = function loaded(event) {
1608
- var chartData = event.sender.getChartData();
1604
+ var handlePieDonutChartTooltip = function handlePieDonutChartTooltip(chartData) {
1605
+ if (chartData && chartData.data && chartData.data.length) {
1606
+ chartData.data.forEach(function (item, index) {
1607
+ var color = getPlotColorByIndexOrder(index);
1608
+ item.tooltext = item.tooltext.replaceAll("transparent", color);
1609
+ });
1610
+ setArgs(_extends({}, args, {
1611
+ dataSource: chartData
1612
+ }));
1613
+ }
1614
+ };
1609
1615
 
1616
+ var handleOtherChartsTooltip = function handleOtherChartsTooltip(chartData) {
1610
1617
  if (chartData && chartData.dataset && chartData.dataset.length) {
1611
1618
  chartData.dataset.forEach(function (el, index) {
1612
1619
  el.data.forEach(function (item) {
@@ -1614,9 +1621,23 @@ var FusionChart = React.forwardRef(function (props, comRef) {
1614
1621
  item.tooltext = item.tooltext.replaceAll("transparent", color);
1615
1622
  });
1616
1623
  });
1624
+ setArgs(_extends({}, args, {
1625
+ dataSource: chartData
1626
+ }));
1617
1627
  }
1628
+ };
1618
1629
 
1619
- setArgs(_extends({}, chartData));
1630
+ var loaded = function loaded(event) {
1631
+ var _widget$current6, _widget$current7;
1632
+
1633
+ var chartData = event.sender.args && event.sender.args.dataSource ? event.sender.args.dataSource : null;
1634
+ var isPieOrDonutChart = ((_widget$current6 = widget.current) === null || _widget$current6 === void 0 ? void 0 : _widget$current6.TypeCode) == 'pie' || ((_widget$current7 = widget.current) === null || _widget$current7 === void 0 ? void 0 : _widget$current7.TypeCode) == 'donut';
1635
+
1636
+ if (isPieOrDonutChart) {
1637
+ handlePieDonutChartTooltip(chartData);
1638
+ } else {
1639
+ handleOtherChartsTooltip(chartData);
1640
+ }
1620
1641
  };
1621
1642
 
1622
1643
  return !dataLoaded ? React__default.createElement("div", {
@@ -1634,11 +1655,10 @@ var FusionChart = React.forwardRef(function (props, comRef) {
1634
1655
  ref: fusionRef
1635
1656
  }, React__default.createElement("div", {
1636
1657
  className: 'db-fc-container',
1658
+ key: fusionKey,
1637
1659
  ref: ref,
1638
1660
  id: chartContainerId
1639
- }, React__default.createElement(ReactFC, Object.assign({
1640
- key: fusionKey
1641
- }, args, {
1661
+ }, React__default.createElement(ReactFC, Object.assign({}, args, {
1642
1662
  "fcEvent-dataplotClick": dataplotClick,
1643
1663
  "fcEvent-loaded": loaded,
1644
1664
  onRender: renderComplete