@datarailsshared/dr_renderer 1.2.422 → 1.2.423

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.422",
3
+ "version": "1.2.423",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -788,10 +788,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
788
788
  }
789
789
 
790
790
  var cols = highchartsRenderer.getColsInFormatterContext(this);
791
- if (!cols && is_drill_down_pie) {
791
+ if (lodash.isNil(cols) && is_drill_down_pie) {
792
792
  cols = this.name;
793
793
  }
794
- if (!cols) {
794
+ if (lodash.isNil(cols)) {
795
795
  cols = [];
796
796
  }
797
797
 
@@ -1902,8 +1902,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1902
1902
  // it displays negative values as empty segments in version <= 8.2.2
1903
1903
  ob.y = val >= 0 || chartOptions.chart.type !== 'pie' ? val : 0;
1904
1904
 
1905
- if (!isNaN(key))
1906
- key = Number(key)
1905
+ if (lodash.isBoolean(key)) {
1906
+ key = key.toString();
1907
+ } else if (!isNaN(key)) {
1908
+ key = Number(key);
1909
+ }
1910
+
1907
1911
  ob.drilldown = key;
1908
1912
  pie_series.push(ob);
1909
1913
  });
@@ -1931,7 +1935,14 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
1931
1935
  var col_ob = {};
1932
1936
  var col_n = col_n_value[0];
1933
1937
  if (col_n != undefined) {
1934
- col_ob.id = !isNaN(col_n) ? Number(col_n) : col_n;
1938
+
1939
+ col_ob.id = col_n;
1940
+ if (lodash.isBoolean(col_ob.id)) {
1941
+ col_ob.id = col_ob.id.toString();
1942
+ } else if (!isNaN(col_ob.id)) {
1943
+ col_ob.id = Number(col_ob.id);
1944
+ }
1945
+
1935
1946
  col_ob.initialName = col_n === highchartsRenderer.DR_OTHERS_KEY ? othersName : col_n;
1936
1947
  col_ob.name = highchartsRenderer.getFormattedColKey(col_ob.initialName, pivotData);
1937
1948
  col_ob.data = [];
@@ -9690,10 +9701,16 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
9690
9701
  }
9691
9702
 
9692
9703
  highchartsRenderer.getColsInFormatterContext = function(context) {
9693
- return lodash.get(context, 'point.options.colsForTotal')
9694
- || lodash.get(context, 'point.initialName')
9695
- || lodash.get(context, 'options.initialName')
9696
- || context.key;
9704
+ const colsForTotal = lodash.get(context, "point.options.colsForTotal");
9705
+ const pointInitialName = lodash.get(context, "point.initialName");
9706
+ const optionsInitialName = lodash.get(context, "options.initialName");
9707
+
9708
+ switch(true) {
9709
+ case !lodash.isNil(colsForTotal): return colsForTotal;
9710
+ case !lodash.isNil(pointInitialName): return pointInitialName;
9711
+ case !lodash.isNil(optionsInitialName): return optionsInitialName;
9712
+ default: return context.key;
9713
+ }
9697
9714
  }
9698
9715
 
9699
9716
  highchartsRenderer.getTableFormatInfosForWidgetFields = function(widget, pivotOptions, fields) {