@datarailsshared/dr_renderer 1.4.25 → 1.4.28

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.4.25",
3
+ "version": "1.4.28",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -51,7 +51,7 @@ const GAUGE_OPTIONS_DEFAULT = {
51
51
  ],
52
52
  };
53
53
 
54
- function DrGaugeChart(pivotData, opts) {
54
+ function DrGaugeChart(pivotData, opts, isDynamicGoal) {
55
55
  this.render = function () {
56
56
  return DrGaugeChart.highchartsRenderer.ptCreateElementAndDraw(this.configChart(), opts);
57
57
  };
@@ -84,7 +84,9 @@ function DrGaugeChart(pivotData, opts) {
84
84
  return (value - min) < (max - min) / 2;
85
85
  };
86
86
 
87
- this.createTicks = DrGaugeChart.createTicks;
87
+ this.createTicks = function(plotBands, options) {
88
+ return DrGaugeChart.createTicks(plotBands, options);
89
+ }
88
90
 
89
91
  this.mergeOptions = function (options) {
90
92
  return helpers.mergeDeep(
@@ -111,7 +113,7 @@ function DrGaugeChart(pivotData, opts) {
111
113
  };
112
114
 
113
115
  this.toPercent = function (value) {
114
- return `${Math.round((value * 100) / (this.options.isAbsoluteValue ? this.max : this.goal.value))}%`;
116
+ return `${Math.round((value * 100) / (this.options.isAbsoluteValue ? this.max : this.options.goal.value))}%`;
115
117
  };
116
118
 
117
119
  this.formatValueLabel = function (value, options) {
@@ -171,9 +173,17 @@ function DrGaugeChart(pivotData, opts) {
171
173
  goal: { value },
172
174
  } = options;
173
175
 
176
+ let valueForPosition = value;
177
+ let verticalOffset = 0;
178
+
179
+ if (DrGaugeChart.dynamicGoalFeatureEnabled() && (value > this.max || value < this.min)) {
180
+ valueForPosition = value > this.max ? this.max : this.min;
181
+ verticalOffset = 30;
182
+ }
183
+
174
184
  return {
175
- x: center[0] - radius * Math.sin(Math.PI / 2 - this.getAngleForValue(value)) - goalIconSize[0] / 2,
176
- y: center[1] - radius * Math.cos(Math.PI / 2 - this.getAngleForValue(value)) - goalIconSize[1] / 2,
185
+ x: center[0] - radius * Math.sin(Math.PI / 2 - this.getAngleForValue(valueForPosition)) - goalIconSize[0] / 2,
186
+ y: center[1] + verticalOffset - radius * Math.cos(Math.PI / 2 - this.getAngleForValue(valueForPosition)) - goalIconSize[1] / 2,
177
187
  };
178
188
  };
179
189
 
@@ -197,6 +207,42 @@ function DrGaugeChart(pivotData, opts) {
197
207
  return label;
198
208
  };
199
209
 
210
+ this.getGoalLabelPosition = function (chart, options, goalLabel) {
211
+ const padding = 7;
212
+ const point = this.getGoalIconPosition(chart, options);
213
+ const isLower = options.goal.value < this.min;
214
+
215
+ return {
216
+ x: point.x + (isLower ? -goalLabel.element.clientWidth : padding),
217
+ y: point.y + padding,
218
+ };
219
+ }
220
+
221
+ this.createGoalLabel = function (chart, options) {
222
+ const label = chart.renderer.text(
223
+ this.formatTickLabel(options.goal.value, options), 0, 0, true
224
+ ).add().toFront();
225
+
226
+ label.attr(this.getGoalLabelPosition(chart, options, label));
227
+
228
+ if (options.tooltips.show) {
229
+ const drTooltip = new DrChartTooltip(chart, {
230
+ fontSize: options.tooltips.font_size,
231
+ fontFamily: options.tooltips.font_style,
232
+ color: options.tooltips.font_color,
233
+ });
234
+ drTooltip.add(
235
+ this.toPercent(options.goal.value),
236
+ label.element,
237
+ {
238
+ direction: "right",
239
+ }
240
+ );
241
+ }
242
+
243
+ return label;
244
+ };
245
+
200
246
  this.getPaneDimensions = function (chart, options) {
201
247
  const { renderer } = chart;
202
248
  const valueLabel = this.createValueLabel(chart, this.options);
@@ -265,7 +311,7 @@ function DrGaugeChart(pivotData, opts) {
265
311
  };
266
312
 
267
313
  this.updateLabelsWhenGoalIsHidden = function (ticks, options) {
268
- if (ticks[options.goal.value].label.opacity === 0) {
314
+ if (ticks[options.goal.value] && ticks[options.goal.value].label.opacity === 0) {
269
315
 
270
316
  const ticksArray = Object.entries(ticks);
271
317
 
@@ -363,6 +409,10 @@ function DrGaugeChart(pivotData, opts) {
363
409
  chart.startBorder = DrGaugeChart.createBorder(chart, options, "start");
364
410
  chart.endBorder = DrGaugeChart.createBorder(chart, options, "end");
365
411
  chart.goalIcon = this.createGoalIcon(chart, options);
412
+
413
+ if (DrGaugeChart.dynamicGoalFeatureEnabled() && (options.goal.value > this.max || options.goal.value < this.min)) {
414
+ chart.goalLabel = this.createGoalLabel(chart, options);
415
+ }
366
416
  };
367
417
 
368
418
  this.updateCustomElements = function (chart, options) {
@@ -370,6 +420,10 @@ function DrGaugeChart(pivotData, opts) {
370
420
  chart.endBorder.attr(DrGaugeChart.getBorderPosition(chart, options, "end"));
371
421
  chart.goalIcon.attr(this.getGoalIconPosition(chart, options));
372
422
  chart.label.attr(DrGaugeChart.getValueLabelPosition(chart, options));
423
+
424
+ if (chart.goalLabel) {
425
+ chart.goalLabel.attr(this.getGoalLabelPosition(chart, options, chart.goalLabel));
426
+ }
373
427
  };
374
428
 
375
429
  this.createPlotBands = function (options) {
@@ -391,7 +445,9 @@ function DrGaugeChart(pivotData, opts) {
391
445
  });
392
446
 
393
447
  // clamp last segment
394
- bands[bands.length - 1].to = Math.max(bands[bands.length - 1].to, goalValue);
448
+ if (!DrGaugeChart.dynamicGoalFeatureEnabled()) {
449
+ bands[bands.length - 1].to = Math.max(bands[bands.length - 1].to, goalValue);
450
+ }
395
451
 
396
452
  return bands;
397
453
  };
@@ -400,6 +456,10 @@ function DrGaugeChart(pivotData, opts) {
400
456
  chart.startBorder.toFront();
401
457
  chart.endBorder.toFront();
402
458
  chart.goalIcon.toFront();
459
+
460
+ if (chart.goalLabel) {
461
+ chart.goalLabel.toFront();
462
+ }
403
463
  };
404
464
 
405
465
  this.clampValueToPane = function (value, max = this.max, min = this.min) {
@@ -407,6 +467,16 @@ function DrGaugeChart(pivotData, opts) {
407
467
  return helpers.clamp(min - correction, value, max + correction);
408
468
  };
409
469
 
470
+ this.setGoal = function (pivotData, opts) {
471
+ if (isDynamicGoal) {
472
+ this.options.goal = {
473
+ title: this.options.goal.title,
474
+ value: DrGaugeChart.getValue(pivotData, opts, true, true),
475
+ };
476
+ }
477
+ this.goal = this.options.goal;
478
+ };
479
+
410
480
  this.configChart = function () {
411
481
  return {
412
482
  title: {
@@ -513,18 +583,25 @@ function DrGaugeChart(pivotData, opts) {
513
583
 
514
584
  this.originalOptions = opts;
515
585
  this.options = this.mergeOptions(opts.chartOptions);
516
- this.aggregation = pivotData.getAggregator([], []);
586
+ this.aggregation = DrGaugeChart.getAggregation(pivotData, opts.chartOptions);
517
587
  this.format = this.aggregation.widget_values_format;
518
- this.goal = this.options.goal;
588
+ this.setGoal(pivotData, opts);
519
589
  this.plotBands = this.createPlotBands(this.options);
520
590
  this.ticks = this.createTicks(this.plotBands, this.options);
521
- this.value = DrGaugeChart.getValue(pivotData, opts);
591
+ this.value = DrGaugeChart.getValue(pivotData, opts, isDynamicGoal);
522
592
  this.max = this.ticks[this.ticks.length - 1];
523
593
  this.min = this.ticks[0];
524
594
  }
525
595
 
526
596
  DrGaugeChart.createTicks = function (plotBands, options) {
527
- return _.uniq([plotBands[0].from || 0, ...plotBands.map((b) => b.to), options.goal.value]).sort((a, b) => a - b);
597
+ const goal = options.goal.value;
598
+ const ticks = [plotBands[0].from || 0, ...plotBands.map((b) => b.to)];
599
+
600
+ if (!DrGaugeChart.dynamicGoalFeatureEnabled() || goal < Math.max(...ticks) && goal > Math.min(...ticks)) {
601
+ ticks.push(options.goal.value);
602
+ }
603
+
604
+ return _.uniq(ticks.sort((a, b) => a - b));
528
605
  };
529
606
 
530
607
  DrGaugeChart.getBorderPosition = function (chart, options, position) {
@@ -583,33 +660,51 @@ DrGaugeChart.getSingleValueAgg = function (opts, aggfunc, base) {
583
660
  return DrGaugeChart.highchartsRenderer.getSingleValueAgg(opts, aggfunc, base);
584
661
  };
585
662
 
586
- DrGaugeChart.getValue = function (pivotData, opts) {
587
- const lineSeries = DrGaugeChart.ptCreateBasicLineSeries(pivotData, null, true, null, null, opts, {});
663
+ DrGaugeChart.getAggregation = function(pivotData, options, isForGoal = false) {
664
+ if (_.get(options, 'dynamicGaugeConfig')) {
665
+ return pivotData.getAggregator([], [isForGoal ? options.dynamicGaugeConfig.goal : options.dynamicGaugeConfig.needle]);
666
+ }
667
+ return pivotData.getAggregator([], []);
668
+ }
588
669
 
589
- let total = _.flatten(lineSeries
590
- .map((s) => s.data.map((v) => v))
591
- .filter((v) => !_.isNaN(v))
592
- );
593
670
 
594
- let aggfunc = (a, b) => a + b;
595
- let base = 0;
596
- let singleValueAgg = DrGaugeChart.getSingleValueAgg(
597
- {
598
- value: {
599
- value: "Sum",
671
+ DrGaugeChart.getValue = function (pivotData, opts, isDynamicGoal = false, isForGoal = false) {
672
+ const aggregator = DrGaugeChart.getAggregation(pivotData, opts.chartOptions, isForGoal)
673
+
674
+ let total;
675
+ if (!isDynamicGoal) {
676
+ const lineSeries = DrGaugeChart.ptCreateBasicLineSeries(pivotData, null, true, null, null, opts, {});
677
+
678
+ total = _.flatten(lineSeries
679
+ .map((s) => s.data.map((v) => v))
680
+ .filter((v) => !_.isNaN(v))
681
+ );
682
+
683
+ let aggfunc = (a, b) => a + b;
684
+ let base = 0;
685
+ let singleValueAgg = DrGaugeChart.getSingleValueAgg(
686
+ {
687
+ value: {
688
+ value: "Sum",
689
+ },
600
690
  },
601
- },
602
- aggfunc,
603
- base
604
- );
691
+ aggfunc,
692
+ base
693
+ );
605
694
 
606
- aggfunc = singleValueAgg.aggfunc;
607
- base = singleValueAgg.base;
695
+ aggfunc = singleValueAgg.aggfunc;
696
+ base = singleValueAgg.base;
608
697
 
609
- const aggregator = pivotData.getAggregator([], []);
610
- const value = total.length > 0 ? total.reduce(aggfunc, base) : aggregator.value();
698
+ if (total.length > 0) {
699
+ return total.reduce(aggfunc, base);
700
+ }
701
+ }
611
702
 
612
- return value;
703
+ return aggregator.value();
613
704
  };
614
705
 
706
+ DrGaugeChart.dynamicGoalFeatureEnabled = function() {
707
+ return DrGaugeChart.highchartsRenderer.hasFeature(helpers.FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL);
708
+ }
709
+
615
710
  module.exports = { DrGaugeChart, GAUGE_OPTIONS_DEFAULT };
@@ -66,6 +66,15 @@ function isShowingEmptyValues(additionOptions) {
66
66
  return !additionOptions || !additionOptions.chart || additionOptions.chart.dislay_empty_values !== false;
67
67
  }
68
68
 
69
+ const FEATURES = {
70
+ ENABLE_NEW_WIDGET_VALUE_FORMATTING: 'enable_new_widget_value_formatting',
71
+ FORMAT_DATES_AS_OTHER_AXIS_TYPES: 'format_dates_as_other_axis_types',
72
+ MULTIPLE_DIMENSION_TAGS: 'multiple_dimension_tags',
73
+ USE_NEW_SCENARIO_TAG: 'use_new_scenario_tag',
74
+ ENABLE_SERVER_WIDGET_DATA_SORTING: 'enable_server_widget_data_sorting',
75
+ ENABLE_GAUGE_DYNAMIC_GOAL: 'enable_gauge_dynamic_goal',
76
+ }
77
+
69
78
  module.exports = {
70
79
  backendSortingKeysAreNotEmpty,
71
80
  capitalize,
@@ -75,4 +84,5 @@ module.exports = {
75
84
  removeSVGTextCorrection,
76
85
  disableLegendInteractionIfRequired,
77
86
  isShowingEmptyValues,
87
+ FEATURES
78
88
  }
@@ -61,6 +61,7 @@ const CHART_TYPES = {
61
61
  GAUGE_SOLID_CHART: 'gauge-solid-chart',
62
62
  GAUGE_CHART: 'gauge-chart',
63
63
  GAUGE_CHART_ENHANCED: 'gauge-chart-enhanced',
64
+ GAUGE_CHART_DYNAMIC_GOAL: 'gauge-chart-dynamic-goal',
64
65
  GAUGE_CHART_CATEGORIES_SUMMARY: 'gauge-chart-categories-summary',
65
66
  KPI_WIDGET: 'kpi-widget',
66
67
  TEXT_WIDGET: 'text-widget',
@@ -155,13 +156,7 @@ const CHART_AXIS_DEFAULT_LABEL = 'Axis (Category)';
155
156
 
156
157
  const CHART_LEGEND_DEFAULT_LABEL = 'Legend (Series)';
157
158
 
158
- const FEATURES = {
159
- ENABLE_NEW_WIDGET_VALUE_FORMATTING: 'enable_new_widget_value_formatting',
160
- FORMAT_DATES_AS_OTHER_AXIS_TYPES: 'format_dates_as_other_axis_types',
161
- MULTIPLE_DIMENSION_TAGS: 'multiple_dimension_tags',
162
- USE_NEW_SCENARIO_TAG: 'use_new_scenario_tag',
163
- ENABLE_SERVER_WIDGET_DATA_SORTING: 'enable_server_widget_data_sorting',
164
- }
159
+ const FEATURES = helpers.FEATURES;
165
160
 
166
161
  const TICKS_COUNT = 5;
167
162
 
@@ -2305,6 +2300,10 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
2305
2300
  return new DrGaugeChart(pivotData, opts).render();
2306
2301
  };
2307
2302
 
2303
+ highchartsRenderer.ptRenderGaugeDynamicGoal = (pivotData, opts) => {
2304
+ return new DrGaugeChart(pivotData, opts, true).render();
2305
+ };
2306
+
2308
2307
  highchartsRenderer.ptRenderGaugeCategoriesSummary = (pivotData, opts) => {
2309
2308
  return new DrGaugeCategoriesSummaryChart(pivotData, opts).render();
2310
2309
  };
@@ -4740,6 +4739,23 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
4740
4739
  return highchartsRenderer.getNoDataResult(true);
4741
4740
  }
4742
4741
 
4742
+ if (lodash.get(widget, 'chart_type') === highchartsRenderer.CHART_TYPES.GAUGE_CHART_DYNAMIC_GOAL) {
4743
+ const noNeedleOrGoalSelected =
4744
+ !lodash.get(widget, 'options.chartOptions.dynamicGaugeConfig.goal')
4745
+ || !lodash.get(widget, 'options.chartOptions.dynamicGaugeConfig.needle');
4746
+
4747
+ if (noNeedleOrGoalSelected) {
4748
+ options.error_has_occurred = true;
4749
+ options.error_params = {
4750
+ title: 'Please configure goal and needle',
4751
+ // TODO: add text
4752
+ text: '',
4753
+ class: 'configure-gauge-settings',
4754
+ }
4755
+ return highchartsRenderer.getNoDataResult(true);
4756
+ }
4757
+ }
4758
+
4743
4759
  var tmp = $.pivotUtilities.aggregatorTemplates;
4744
4760
  var defaults, e, result, opts, optsFiltered;
4745
4761
  defaults = {
@@ -7600,6 +7616,21 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7600
7616
  axisTooltipDescription: 'The category (usually an independent variable) is shown on the x-axis and should be between 2 to 5 total columns. ',
7601
7617
  legendTooltipTitle: 'Drag one field to further configure your x-axis.',
7602
7618
  legendTooltipDescription: 'The breakdown subdivides the chart by a category field for further analysis of what’s contributing to the increase or decrease.',
7619
+ categoryContainerSettings: {
7620
+ multiple: false,
7621
+ singleFieldReplacement: true,
7622
+ onlyOneFieldHeight: true,
7623
+ },
7624
+ legendContainerSettings: {
7625
+ multiple: false,
7626
+ singleFieldReplacement: true,
7627
+ onlyOneFieldHeight: true,
7628
+ },
7629
+ valuesContainerSettings: {
7630
+ multiple: false,
7631
+ singleFieldReplacement: true,
7632
+ onlyOneFieldHeight: true,
7633
+ },
7603
7634
  },
7604
7635
  [highchartsRenderer.CHART_TYPES.WATERFALL_WALKTHROUGH]: {
7605
7636
  name: 'Walkthrough Chart',
@@ -7613,6 +7644,17 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7613
7644
  axisTooltipTitle: 'Drag one or more fields to configure your x-axis.',
7614
7645
  axisTooltipDescription: 'The category is shown on the x-axis and should be between 2 to 10 columns.',
7615
7646
  legendTooltipTitle: '',
7647
+ categoryContainerSettings: {
7648
+ fixedInitialHeight: true,
7649
+ },
7650
+ valuesContainerSettings: {
7651
+ multiple: false,
7652
+ singleFieldReplacement: true,
7653
+ onlyOneFieldHeight: true,
7654
+ },
7655
+ filtersContainerSettings: {
7656
+ fixedInitialHeight: true,
7657
+ },
7616
7658
  },
7617
7659
  'combo-chart': {
7618
7660
  name: 'Combo Chart ',
@@ -7786,12 +7828,45 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
7786
7828
  },
7787
7829
  [highchartsRenderer.CHART_TYPES.GAUGE_CHART_ENHANCED]: {
7788
7830
  name: 'Gauge chart',
7789
- label: 'Gauge',
7831
+ categoryLabel: 'Gauge',
7832
+ displayLabelInEditor: highchartsRenderer.hasFeature(FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL),
7833
+ label: highchartsRenderer.hasFeature(FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL) ? 'Static goal' : 'Gauge',
7790
7834
  title: 'Measures progress toward a goal or a KPI.',
7791
7835
  axisName: 'X-Axis',
7792
7836
  legendName: 'Data Series',
7793
7837
  startedMessage: 'To get started, drag one field to the value section. Best practice: Drag one field to the filter section, and filter as required.',
7838
+ valuesContainerSettings: {
7839
+ fixedInitialHeight: true,
7840
+ },
7841
+ filtersContainerSettings: {
7842
+ fixedInitialHeight: true,
7843
+ },
7844
+ },
7845
+
7846
+ // TODO: update descriptions if required
7847
+ [highchartsRenderer.CHART_TYPES.GAUGE_CHART_DYNAMIC_GOAL]: {
7848
+ name: 'Gauge chart with dynamic goal',
7849
+ categoryLabel: 'Gauge',
7850
+ displayLabelInEditor: true,
7851
+ iconType: highchartsRenderer.CHART_TYPES.GAUGE_CHART_ENHANCED,
7852
+ label: 'Dynamic goal',
7853
+ title: 'Measures progress toward a goal or a KPI.',
7854
+ axisName: 'Goal',
7855
+ legendName: 'Data Series',
7856
+ startedMessage: 'To get started, drag one field to the value section. Best practice: Drag one field to the filter section, and filter as required.',
7857
+ categoryContainerSettings: {
7858
+ multiple: false,
7859
+ singleFieldReplacement: true,
7860
+ onlyOneFieldHeight: true,
7861
+ },
7862
+ valuesContainerSettings: {
7863
+ fixedInitialHeight: true,
7864
+ },
7865
+ filtersContainerSettings: {
7866
+ fixedInitialHeight: true,
7867
+ },
7794
7868
  },
7869
+
7795
7870
  [highchartsRenderer.CHART_TYPES.GAUGE_CHART_CATEGORIES_SUMMARY]: {
7796
7871
  name: 'Gauge chart categories summary',
7797
7872
  label: 'Gauge',
@@ -8212,27 +8287,41 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
8212
8287
  highchartsRenderer.suboptions["table_design_options"],
8213
8288
  ]
8214
8289
  },
8290
+ {
8291
+ type: highchartsRenderer.CHART_TYPES.GAUGE_CHART_DYNAMIC_GOAL,
8292
+ name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.GAUGE_CHART_DYNAMIC_GOAL].name,
8293
+ class: 'google-visualization-charteditor-thumbs-gauge-solid',
8294
+ render: highchartsRenderer.ptRenderGaugeDynamicGoal,
8295
+ suboptions: [
8296
+ highchartsRenderer.suboptions["label_gauge"],
8297
+ highchartsRenderer.suboptions["tooltips_gauge"],
8298
+ highchartsRenderer.suboptions["subtitle"],
8299
+ highchartsRenderer.suboptions["table_options_gauge"],
8300
+ highchartsRenderer.suboptions["table_design_options"],
8301
+ ],
8302
+ hidden: !highchartsRenderer.hasFeature(FEATURES.ENABLE_GAUGE_DYNAMIC_GOAL),
8303
+ },
8304
+ ]
8305
+ },
8306
+ {
8307
+ type: 'gauge-categories-summary',
8308
+ name: 'Gauge Categories Summary',
8309
+ class: 'google-visualization-charteditor-mini-gauge',
8310
+ hidden: true,
8311
+ subtypes: [
8312
+ {
8313
+ type: highchartsRenderer.CHART_TYPES.GAUGE_CHART_CATEGORIES_SUMMARY,
8314
+ name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.GAUGE_CHART_CATEGORIES_SUMMARY].name,
8315
+ class: 'google-visualization-charteditor-thumbs-gauge-solid',
8316
+ render: highchartsRenderer.ptRenderGaugeCategoriesSummary,
8317
+ suboptions: [
8318
+ highchartsRenderer.suboptions["label_gauge"],
8319
+ highchartsRenderer.suboptions["tooltips_gauge"],
8320
+ highchartsRenderer.suboptions["subtitle"]
8321
+ ]
8322
+ },
8215
8323
  ]
8216
8324
  },
8217
- {
8218
- type: 'gauge-categories-summary',
8219
- name: 'Gauge Categories Summary',
8220
- class: 'google-visualization-charteditor-mini-gauge',
8221
- hidden: true,
8222
- subtypes: [
8223
- {
8224
- type: highchartsRenderer.CHART_TYPES.GAUGE_CHART_CATEGORIES_SUMMARY,
8225
- name: highchartsRenderer.chartsTypesInfo[highchartsRenderer.CHART_TYPES.GAUGE_CHART_CATEGORIES_SUMMARY].name,
8226
- class: 'google-visualization-charteditor-thumbs-gauge-solid',
8227
- render: highchartsRenderer.ptRenderGaugeCategoriesSummary,
8228
- suboptions: [
8229
- highchartsRenderer.suboptions["label_gauge"],
8230
- highchartsRenderer.suboptions["tooltips_gauge"],
8231
- highchartsRenderer.suboptions["subtitle"]
8232
- ]
8233
- },
8234
- ]
8235
- },
8236
8325
  {
8237
8326
  type: 'kpi',
8238
8327
  name: 'KPI',
@@ -6,6 +6,8 @@ const DR_SCENARIO = {
6
6
  };
7
7
 
8
8
  function createSingleDataSeriesForForecast(chart_series, chartOptions, pivotData, isChartCombiLine) {
9
+ if (!chartOptions || !chartOptions.chart) return null;
10
+
9
11
  const { actuals, forecast, smart_query } = chartOptions.chart;
10
12
  const input = pivotData.input;
11
13
 
@@ -23,6 +23,7 @@ DrGaugeChart.highchartsRenderer = {
23
23
  }),
24
24
  disableChartAnimations: jest.fn((value) => disableChartAnimation = value),
25
25
  chartAnimationsDisabled: jest.fn(() => disableChartAnimation),
26
+ hasFeature: jest.fn().mockReturnValue(false),
26
27
  };
27
28
 
28
29
  const mockAggregationValue = 1000;