logitude-dashboard-library 1.4.39 → 1.4.41

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.
@@ -56,6 +56,25 @@ export interface ChartInfo {
56
56
  legendWidth: string;
57
57
  alignLegendWithCanvas: string;
58
58
  centerLabelBold: string;
59
+ showSecondaryLimits: string;
60
+ showDivLineSecondaryValue: string;
61
+ pYAxisName: string;
62
+ sYAxisname: string;
63
+ sYAxisNameFont: string;
64
+ sYAxisNameFontColor: string;
65
+ sYAxisNameFontSize: string;
66
+ pYAxisNameFont: string;
67
+ pYAxisNameFontColor: string;
68
+ pYAxisNameFontSize: string;
69
+ sYAxisNameBorderPadding: number;
70
+ pYAxisNameBorderPadding: number;
71
+ xAxisNameFont: string;
72
+ xAxisNameFontSize: string;
73
+ xAxisNameFontColor: string;
74
+ yAxisNameFont: string;
75
+ yAxisNameFontSize: string;
76
+ yAxisNameFontColor: string;
77
+ adjustDiv: string;
59
78
  }
60
79
  export declare function getSeriesPositionColor(position: number): string | null;
61
80
  export declare function getSeriesHoverPositionColor(position: number): string | null;
package/dist/index.js CHANGED
@@ -738,7 +738,7 @@ function getPieObject(seriesMeasures, widget) {
738
738
 
739
739
  function getColumnObject(seriesMeasures, widget) {
740
740
  var chart = getDefaultChartobject();
741
- chart.type = "scrollcombi2d";
741
+ chart.type = "scrollcombidy2d";
742
742
  var chartInfo = getDefaultChartInfo();
743
743
  chartInfo.scrollPadding = "8";
744
744
  chartInfo.flatScrollBars = "1";
@@ -750,6 +750,7 @@ function getColumnObject(seriesMeasures, widget) {
750
750
  chartInfo.chartLeftMargin = "20";
751
751
  chartInfo.chartRightMargin = "50";
752
752
  chartInfo.canvasBottomPadding = "10";
753
+ setDualyAxis(chartInfo, widget, seriesMeasures);
753
754
  chart.dataSource = getCategoriesBasedDataSource(chartInfo, seriesMeasures, widget);
754
755
  return chart;
755
756
  }
@@ -786,6 +787,18 @@ function getDefaultChartInfo(widget) {
786
787
  chart.labelFont = defautFont;
787
788
  chart.legendItemFont = defautFont;
788
789
  chart.legendItemFontSize = defautFontSize;
790
+ chart.sYAxisNameFont = defautFont;
791
+ chart.sYAxisNameFontSize = defautFontSize;
792
+ chart.sYAxisNameFontColor = defautColor;
793
+ chart.pYAxisNameFont = defautFont;
794
+ chart.pYAxisNameFontSize = defautFontSize;
795
+ chart.pYAxisNameFontColor = defautColor;
796
+ chart.xAxisNameFont = defautFont;
797
+ chart.xAxisNameFontSize = defautFontSize;
798
+ chart.xAxisNameFontColor = defautColor;
799
+ chart.yAxisNameFont = defautFont;
800
+ chart.yAxisNameFontSize = defautFontSize;
801
+ chart.yAxisNameFontColor = defautColor;
789
802
  chart.enableSlicing = "0";
790
803
  chart.enableRotation = "0";
791
804
  chart.chartTopMargin = "10";
@@ -826,6 +839,33 @@ function setChartInLegend(chart, widget) {
826
839
  chart.pieRadius = "70%";
827
840
  }
828
841
 
842
+ function setDualyAxis(chartInfo, widget, seriesMeasures) {
843
+ var _seriesMeasures$, _seriesMeasures$2;
844
+
845
+ chartInfo.showSecondaryLimits = "0";
846
+ chartInfo.showDivLineSecondaryValue = "0";
847
+ if (!widget) return;
848
+ if (!widget.WidgetMeasures) return;
849
+ if (widget.WidgetMeasures.length < 2) return;
850
+ if (widget.WidgetMeasures[1].YAxisType != 'dual') return;
851
+ chartInfo.showSecondaryLimits = "1";
852
+ chartInfo.showDivLineSecondaryValue = "1";
853
+ chartInfo.pYAxisNameBorderPadding = 0;
854
+ chartInfo.sYAxisNameBorderPadding = 0;
855
+ var textLength = Math.max(seriesMeasures[0].Name.length, seriesMeasures[1].Name.length);
856
+ chartInfo.pYAxisName = getTitle((_seriesMeasures$ = seriesMeasures[0]) === null || _seriesMeasures$ === void 0 ? void 0 : _seriesMeasures$.Name, textLength);
857
+ chartInfo.sYAxisname = getTitle((_seriesMeasures$2 = seriesMeasures[1]) === null || _seriesMeasures$2 === void 0 ? void 0 : _seriesMeasures$2.Name, textLength);
858
+ }
859
+
860
+ function getTitle(text, maxLenght) {
861
+ var textLenght = text.length;
862
+ if (textLenght >= maxLenght) return text.replace(/\s+/g, '&nbsp;&nbsp;');
863
+ var neededSpaces = Math.ceil((maxLenght - textLenght) / 2);
864
+ var space = '&nbsp;';
865
+ text = space.repeat(neededSpaces) + text + space.repeat(neededSpaces);
866
+ return text.replace(/\s+/g, '&nbsp;&nbsp;');
867
+ }
868
+
829
869
  var FusionChartHelper = /*#__PURE__*/function () {
830
870
  function FusionChartHelper(widget, chart) {
831
871
  this.chart = chart;