@datarailsshared/dr_renderer 1.2.40 → 1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/dr_renderer",
3
- "version": "1.2.40",
3
+ "version": "1.2.42",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -732,6 +732,12 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
732
732
  };
733
733
 
734
734
  highchartsRenderer.ptCreateElementAndDraw = function (chartOptions, opts) {
735
+ if (lodash.get(opts, 'paletteOptions.widgetPalette', null)) {
736
+ const mc_palette = lodash.find(lodash.get(opts.paletteOptions, 'monochromePalettes', []), { selected: true });
737
+ chartOptions.colors = mc_palette ? mc_palette.colors : opts.paletteOptions.widgetPalette;
738
+ } else if (lodash.get(opts, 'paletteOptions.dashboardPalette.colors', null)) {
739
+ chartOptions.colors = opts.paletteOptions.dashboardPalette.colors;
740
+ }
735
741
  if (opts && opts.hasOwnProperty('onlyOptions') && opts.onlyOptions) {
736
742
  chartOptions = highchartsRenderer.updateChartOptions(chartOptions, {credits: {enabled: false}});
737
743
  return chartOptions;
@@ -2541,7 +2547,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2541
2547
  style = {};
2542
2548
  }
2543
2549
  }
2550
+
2551
+ if(typeof style !== 'object' || style === null){
2552
+ style = {};
2553
+ }
2554
+
2544
2555
  style.fontWeight = useNewUx ? 'normal' : 'bold';
2556
+
2545
2557
  return style;
2546
2558
  }
2547
2559
 
@@ -4162,7 +4174,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4162
4174
  options.chartOptions.legends_position = { value: 'none' };
4163
4175
  delete options.chartOptions.chart.hideLegends;
4164
4176
  }
4165
- if (['pie-chart', 'pie-chart-drilldown'].includes(type)) {
4177
+ if (lodash.includes(['pie-chart', 'pie-chart-drilldown'], type)) {
4166
4178
  if (options.chartOptions && options.chartOptions.label) {
4167
4179
  if (options.chartOptions.label.only_value) {
4168
4180
  options.chartOptions.label.show_percentage_in_labels = false;