@datarailsshared/dr_renderer 1.2.335 → 1.2.339
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 +1 -1
- package/src/highcharts_renderer.js +20 -19
- package/src/pivottable.js +1 -0
- package/tests/highcharts_renderer.test.js +56 -14
package/package.json
CHANGED
@@ -549,7 +549,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
549
549
|
var func = function () {
|
550
550
|
var value = parseFloat(this.y);
|
551
551
|
if (pivotData) {
|
552
|
-
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this);
|
552
|
+
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this, pivotData);
|
553
553
|
var rows = series_name.split(highchartsRenderer.delimer);
|
554
554
|
|
555
555
|
if (is_drill_down_pie && highchartsRenderer.selfStartsWith(series_name, "Series ")) {
|
@@ -562,7 +562,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
562
562
|
rows = [];
|
563
563
|
}
|
564
564
|
|
565
|
-
var cols = highchartsRenderer.getColsInFormatterContext(this);
|
565
|
+
var cols = highchartsRenderer.getColsInFormatterContext(this, pivotData);
|
566
566
|
if (typeof (cols) == 'object' && cols.name) {
|
567
567
|
cols = cols.name;
|
568
568
|
}
|
@@ -730,7 +730,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
730
730
|
|
731
731
|
var y = parseFloat(this.y);
|
732
732
|
if (pivotData) {
|
733
|
-
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this);
|
733
|
+
let series_name = highchartsRenderer.getSeriesNameInFormatterContext(this, pivotData);
|
734
734
|
var rows = series_name.split(highchartsRenderer.delimer);
|
735
735
|
if (is_drill_down_pie && highchartsRenderer.selfStartsWith(series_name,"Series ")) {
|
736
736
|
rows = [];
|
@@ -741,7 +741,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
741
741
|
rows = [];
|
742
742
|
}
|
743
743
|
|
744
|
-
var cols = highchartsRenderer.getColsInFormatterContext(this);
|
744
|
+
var cols = highchartsRenderer.getColsInFormatterContext(this, pivotData);
|
745
745
|
if (!cols && is_drill_down_pie) {
|
746
746
|
cols = this.name;
|
747
747
|
}
|
@@ -768,7 +768,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
768
768
|
? isWaterfallWalkthrough
|
769
769
|
? this.key
|
770
770
|
: cols[0]
|
771
|
-
: highchartsRenderer.isFormattingAxis() && lodash.get(this, 'point.name') || cols
|
771
|
+
: highchartsRenderer.isFormattingAxis(pivotData) && lodash.get(this, 'point.name') || cols
|
772
772
|
);
|
773
773
|
|
774
774
|
highchartsRenderer.replaceDrOthersKeys(cols, rows, drOthersInAxis, othersName);
|
@@ -3009,7 +3009,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3009
3009
|
zoomType: additionOptions && additionOptions.chart && additionOptions.chart.zoom_type ? additionOptions.chart.zoom_type : 'None',
|
3010
3010
|
events: {
|
3011
3011
|
'drilldown': function (e) {
|
3012
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3012
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
3013
3013
|
if (drilldownFunc)
|
3014
3014
|
drilldownFunc(e, this, "drilldown");
|
3015
3015
|
|
@@ -3128,7 +3128,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3128
3128
|
zoomType: 'x',
|
3129
3129
|
events: {
|
3130
3130
|
'drilldown': function (e) {
|
3131
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3131
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
3132
3132
|
if (drilldownFunc)
|
3133
3133
|
drilldownFunc(e, this, "drilldown");
|
3134
3134
|
|
@@ -3286,7 +3286,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
3286
3286
|
type: 'column',
|
3287
3287
|
events: {
|
3288
3288
|
'drilldown': function (e) {
|
3289
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
3289
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
3290
3290
|
if (drilldownFunc)
|
3291
3291
|
drilldownFunc(e, this, "drilldown");
|
3292
3292
|
|
@@ -5930,7 +5930,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
5930
5930
|
opt = {};
|
5931
5931
|
}
|
5932
5932
|
opt.drillDownListFunc = (e) => {
|
5933
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
5933
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5934
5934
|
drillDownListFunc(e);
|
5935
5935
|
};
|
5936
5936
|
opt.insightsTooltipFunc = insightsTooltipFunc;
|
@@ -9323,15 +9323,15 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9323
9323
|
return !highchartsRenderer.enabledNewWidgetValueFormatting || !highchartsRenderer.isChartWithMultiValues(pivotData) || !isSecondaryAxis || isCustomFormat;
|
9324
9324
|
}
|
9325
9325
|
|
9326
|
-
highchartsRenderer.isFormattingAxis = function () {
|
9327
|
-
return lodash.includes(lodash.get(document, 'ReportHippo.user.features', []), FEATURES.FORMAT_AXIS);
|
9326
|
+
highchartsRenderer.isFormattingAxis = function (pivotData) {
|
9327
|
+
return lodash.includes(lodash.get(document, 'ReportHippo.user.features', []), FEATURES.FORMAT_AXIS) && pivotData.isFormattingAxisLabels;
|
9328
9328
|
}
|
9329
9329
|
|
9330
9330
|
// Method for getting formatted kyes for Axis (cols, rows)
|
9331
9331
|
// TODO: Move here dates formatting from highchartsRenderer.getWidgetDataSorters. Ticket created: DR-22009
|
9332
9332
|
highchartsRenderer.getFormattedKey = function (initialKey, pivotData, type) {
|
9333
9333
|
const isFlatKey = lodash.isString(initialKey) || lodash.isNumber(initialKey);
|
9334
|
-
if (highchartsRenderer.isFormattingAxis() && (isFlatKey || lodash.isArray(initialKey))) {
|
9334
|
+
if (highchartsRenderer.isFormattingAxis(pivotData) && (isFlatKey || lodash.isArray(initialKey))) {
|
9335
9335
|
let values = isFlatKey ? initialKey.toString().split(highchartsRenderer.delimer) : lodash.cloneDeep(initialKey);
|
9336
9336
|
if (values) {
|
9337
9337
|
lodash.forEach(values, (value, key) => {
|
@@ -9357,7 +9357,7 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9357
9357
|
|
9358
9358
|
highchartsRenderer.getFormattedKeys = function(pivotData, isCols, keys) {
|
9359
9359
|
keys = keys || (isCols ? pivotData.getColKeys() : pivotData.getRowKeys());
|
9360
|
-
return highchartsRenderer.isFormattingAxis()
|
9360
|
+
return highchartsRenderer.isFormattingAxis(pivotData)
|
9361
9361
|
? lodash.map(keys, key => highchartsRenderer.getFormattedKey(key, pivotData, isCols ? 'colFormats' : 'rowFormats'))
|
9362
9362
|
: keys;
|
9363
9363
|
}
|
@@ -9370,22 +9370,23 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9370
9370
|
return highchartsRenderer.getFormattedKeys(pivotData, false, keys);
|
9371
9371
|
}
|
9372
9372
|
|
9373
|
-
highchartsRenderer.modifyEventPointForDrilldown = function(e) {
|
9374
|
-
if (!highchartsRenderer.isFormattingAxis()) {
|
9373
|
+
highchartsRenderer.modifyEventPointForDrilldown = function(e, pivotData) {
|
9374
|
+
if (!highchartsRenderer.isFormattingAxis(pivotData)) {
|
9375
9375
|
return;
|
9376
9376
|
}
|
9377
9377
|
e.point = lodash.cloneDeep(e.point);
|
9378
9378
|
e.point.name = e.point.initialName;
|
9379
|
+
e.point.series.name = lodash.get(e.point.series, 'userOptions.initialName', e.point.series.name);
|
9379
9380
|
lodash.set(e, 'point.category.userOptions', e.point.initialName.toString().split(highchartsRenderer.delimer));
|
9380
9381
|
}
|
9381
9382
|
|
9382
|
-
highchartsRenderer.getSeriesNameInFormatterContext = function(context) {
|
9383
|
-
return ((highchartsRenderer.isFormattingAxis() && lodash.get(context, 'series.userOptions.initialName')) || context.series.name || '') + "";
|
9383
|
+
highchartsRenderer.getSeriesNameInFormatterContext = function(context, pivotData) {
|
9384
|
+
return ((highchartsRenderer.isFormattingAxis(pivotData) && lodash.get(context, 'series.userOptions.initialName')) || context.series.name || '') + "";
|
9384
9385
|
}
|
9385
9386
|
|
9386
|
-
highchartsRenderer.getColsInFormatterContext = function(context) {
|
9387
|
+
highchartsRenderer.getColsInFormatterContext = function(context, pivotData) {
|
9387
9388
|
return lodash.get(context, 'point.options.colsForTotal')
|
9388
|
-
|| highchartsRenderer.isFormattingAxis() && (lodash.get(context, 'point.initialName') || lodash.get(context, 'options.initialName'))
|
9389
|
+
|| highchartsRenderer.isFormattingAxis(pivotData) && (lodash.get(context, 'point.initialName') || lodash.get(context, 'options.initialName'))
|
9389
9390
|
|| context.key;
|
9390
9391
|
}
|
9391
9392
|
|
package/src/pivottable.js
CHANGED
@@ -696,6 +696,7 @@ let initPivotTable = function($, window, document) {
|
|
696
696
|
this.sortByValueAttrs = opts.sortByValueAttrs || [];
|
697
697
|
this.colFormats = opts.colFormats || [];
|
698
698
|
this.rowFormats = opts.rowFormats || [];
|
699
|
+
this.isFormattingAxisLabels = opts.rendererOptions && opts.rendererOptions.isFormattingAxisLabels;
|
699
700
|
this.getFormattedColKeys = (keys) => opts.getFormattedColKeys(this, keys);
|
700
701
|
this.getFormattedRowKeys = (keys) => opts.getFormattedRowKeys(this, keys);
|
701
702
|
|
@@ -4842,13 +4842,21 @@ describe('highcharts_renderer', () => {
|
|
4842
4842
|
|
4843
4843
|
describe('Function isFormattingAxis', () => {
|
4844
4844
|
it('should return true if FF is true', () => {
|
4845
|
+
const pivotData = { isFormattingAxisLabels: true };
|
4845
4846
|
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
4846
|
-
expect(highchartsRenderer.isFormattingAxis()).toEqual(true);
|
4847
|
+
expect(highchartsRenderer.isFormattingAxis(pivotData)).toEqual(true);
|
4847
4848
|
});
|
4848
4849
|
|
4849
4850
|
it('should return false if FF is false', () => {
|
4851
|
+
const pivotData = { isFormattingAxisLabels: true };
|
4850
4852
|
lodash.set(document, 'ReportHippo.user.features', []);
|
4851
|
-
expect(highchartsRenderer.isFormattingAxis()).toEqual(false);
|
4853
|
+
expect(highchartsRenderer.isFormattingAxis(pivotData)).toEqual(false);
|
4854
|
+
});
|
4855
|
+
|
4856
|
+
it('should return false if FF is true but isFormattingAxisLabels for chart is false', () => {
|
4857
|
+
const pivotData = { isFormattingAxisLabels: false };
|
4858
|
+
lodash.set(document, 'ReportHippo.user.features', []);
|
4859
|
+
expect(highchartsRenderer.isFormattingAxis(pivotData)).toEqual(false);
|
4852
4860
|
});
|
4853
4861
|
});
|
4854
4862
|
|
@@ -4863,6 +4871,7 @@ describe('highcharts_renderer', () => {
|
|
4863
4871
|
const pivotData = {
|
4864
4872
|
colFormats: ['$####.##', '₪####.##'],
|
4865
4873
|
rowFormats: ['€####.##', '£####.##'],
|
4874
|
+
isFormattingAxisLabels: true,
|
4866
4875
|
};
|
4867
4876
|
const type = 'colFormats';
|
4868
4877
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4874,6 +4883,7 @@ describe('highcharts_renderer', () => {
|
|
4874
4883
|
const pivotData = {
|
4875
4884
|
colFormats: ['€####.##', '£####.##'],
|
4876
4885
|
rowFormats: ['$####.##', '₪####.##'],
|
4886
|
+
isFormattingAxisLabels: true,
|
4877
4887
|
};
|
4878
4888
|
const type = 'rowFormats';
|
4879
4889
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4885,6 +4895,7 @@ describe('highcharts_renderer', () => {
|
|
4885
4895
|
const pivotData = {
|
4886
4896
|
colFormats: ['$####.##', '₪####.##'],
|
4887
4897
|
rowFormats: ['€####.##', '£####.##'],
|
4898
|
+
isFormattingAxisLabels: true,
|
4888
4899
|
};
|
4889
4900
|
const type = 'colFormats';
|
4890
4901
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4896,6 +4907,7 @@ describe('highcharts_renderer', () => {
|
|
4896
4907
|
const pivotData = {
|
4897
4908
|
colFormats: ['€####.##', '£####.##'],
|
4898
4909
|
rowFormats: ['$####.##', '₪####.##'],
|
4910
|
+
isFormattingAxisLabels: true,
|
4899
4911
|
};
|
4900
4912
|
const type = 'rowFormats';
|
4901
4913
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4906,6 +4918,7 @@ describe('highcharts_renderer', () => {
|
|
4906
4918
|
const initialKey = '1000 , 2000';
|
4907
4919
|
const pivotData = {
|
4908
4920
|
colFormats: ['$####.##', '₪####.##'],
|
4921
|
+
isFormattingAxisLabels: true,
|
4909
4922
|
};
|
4910
4923
|
const type = 'colFormats';
|
4911
4924
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4916,6 +4929,7 @@ describe('highcharts_renderer', () => {
|
|
4916
4929
|
const initialKey = ['1000', '2000'];
|
4917
4930
|
const pivotData = {
|
4918
4931
|
colFormats: ['$####.##', '₪####.##'],
|
4932
|
+
isFormattingAxisLabels: true,
|
4919
4933
|
};
|
4920
4934
|
const type = 'colFormats';
|
4921
4935
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4926,6 +4940,7 @@ describe('highcharts_renderer', () => {
|
|
4926
4940
|
const initialKey = ['1000', '2000'];
|
4927
4941
|
const pivotData = {
|
4928
4942
|
colFormats: ['$####.##', null],
|
4943
|
+
isFormattingAxisLabels: true,
|
4929
4944
|
};
|
4930
4945
|
const type = 'colFormats';
|
4931
4946
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4936,6 +4951,7 @@ describe('highcharts_renderer', () => {
|
|
4936
4951
|
const initialKey = ['1000', '2000'];
|
4937
4952
|
const pivotData = {
|
4938
4953
|
colFormats: [null, '$####.##'],
|
4954
|
+
isFormattingAxisLabels: true,
|
4939
4955
|
};
|
4940
4956
|
const type = 'colFormats';
|
4941
4957
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4953,6 +4969,7 @@ describe('highcharts_renderer', () => {
|
|
4953
4969
|
const pivotData = {
|
4954
4970
|
colFormats: ['$####.##', '₪####.##'],
|
4955
4971
|
rowFormats: ['€####.##', '£####.##'],
|
4972
|
+
isFormattingAxisLabels: true,
|
4956
4973
|
};
|
4957
4974
|
const type = 'colFormats';
|
4958
4975
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type,);
|
@@ -4964,6 +4981,7 @@ describe('highcharts_renderer', () => {
|
|
4964
4981
|
const pivotData = {
|
4965
4982
|
colFormats: ['€####.##', '£####.##'],
|
4966
4983
|
rowFormats: ['$####.##', '₪####.##'],
|
4984
|
+
isFormattingAxisLabels: true,
|
4967
4985
|
};
|
4968
4986
|
const type = 'rowFormats';
|
4969
4987
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4975,6 +4993,7 @@ describe('highcharts_renderer', () => {
|
|
4975
4993
|
const pivotData = {
|
4976
4994
|
colFormats: ['$####.##', '₪####.##'],
|
4977
4995
|
rowFormats: ['€####.##', '£####.##'],
|
4996
|
+
isFormattingAxisLabels: true,
|
4978
4997
|
};
|
4979
4998
|
const type = 'colFormats';
|
4980
4999
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4986,6 +5005,7 @@ describe('highcharts_renderer', () => {
|
|
4986
5005
|
const pivotData = {
|
4987
5006
|
colFormats: ['€####.##', '£####.##'],
|
4988
5007
|
rowFormats: ['$####.##', '₪####.##'],
|
5008
|
+
isFormattingAxisLabels: true,
|
4989
5009
|
};
|
4990
5010
|
const type = 'rowFormats';
|
4991
5011
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -4996,6 +5016,7 @@ describe('highcharts_renderer', () => {
|
|
4996
5016
|
const initialKey = '1000 , 2000';
|
4997
5017
|
const pivotData = {
|
4998
5018
|
colFormats: ['$####.##', '₪####.##'],
|
5019
|
+
isFormattingAxisLabels: true,
|
4999
5020
|
};
|
5000
5021
|
const type = 'colFormats';
|
5001
5022
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -5006,6 +5027,7 @@ describe('highcharts_renderer', () => {
|
|
5006
5027
|
const initialKey = ['1000', '2000'];
|
5007
5028
|
const pivotData = {
|
5008
5029
|
colFormats: ['$####.##', '₪####.##'],
|
5030
|
+
isFormattingAxisLabels: true,
|
5009
5031
|
};
|
5010
5032
|
const type = 'colFormats';
|
5011
5033
|
const formattedKey = highchartsRenderer.getFormattedKey(initialKey, pivotData, type);
|
@@ -5036,6 +5058,7 @@ describe('highcharts_renderer', () => {
|
|
5036
5058
|
const pivotData = {
|
5037
5059
|
getColKeys: () => testKeys,
|
5038
5060
|
getRowKeys: () => testKeys,
|
5061
|
+
isFormattingAxisLabels: true,
|
5039
5062
|
};
|
5040
5063
|
|
5041
5064
|
beforeEach(() => {
|
@@ -5158,9 +5181,19 @@ describe('highcharts_renderer', () => {
|
|
5158
5181
|
category: {
|
5159
5182
|
userOptions: ['key4'],
|
5160
5183
|
},
|
5184
|
+
series: {
|
5185
|
+
name: 'key5',
|
5186
|
+
userOptions: {
|
5187
|
+
initialName: 'key6',
|
5188
|
+
}
|
5189
|
+
}
|
5161
5190
|
}
|
5162
5191
|
};
|
5163
5192
|
|
5193
|
+
const pivotData = {
|
5194
|
+
isFormattingAxisLabels: true,
|
5195
|
+
};
|
5196
|
+
|
5164
5197
|
beforeEach(() => {
|
5165
5198
|
spyOn(highchartsRenderer, 'getFormattedKeys').and.returnValue(null);
|
5166
5199
|
});
|
@@ -5169,8 +5202,9 @@ describe('highcharts_renderer', () => {
|
|
5169
5202
|
const e = lodash.cloneDeep(event);
|
5170
5203
|
lodash.set(document, 'ReportHippo.user.features', []);
|
5171
5204
|
|
5172
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
5205
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5173
5206
|
expect(e.point.name).toEqual(event.point.name);
|
5207
|
+
expect(e.point.series.name).toEqual(event.point.series.name);
|
5174
5208
|
expect(e.point.category.userOptions).toEqual(event.point.category.userOptions);
|
5175
5209
|
});
|
5176
5210
|
|
@@ -5178,8 +5212,9 @@ describe('highcharts_renderer', () => {
|
|
5178
5212
|
const e = lodash.cloneDeep(event);
|
5179
5213
|
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5180
5214
|
|
5181
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
5215
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5182
5216
|
expect(e.point.name).toEqual(event.point.initialName);
|
5217
|
+
expect(e.point.series.name).toEqual(event.point.series.userOptions.initialName);
|
5183
5218
|
expect(e.point.category.userOptions).toEqual([event.point.initialName]);
|
5184
5219
|
});
|
5185
5220
|
});
|
@@ -5189,6 +5224,10 @@ describe('highcharts_renderer', () => {
|
|
5189
5224
|
const name1 = 'test series name';
|
5190
5225
|
const name2 = 'test series name 2';
|
5191
5226
|
|
5227
|
+
const pivotData = {
|
5228
|
+
isFormattingAxisLabels: true,
|
5229
|
+
};
|
5230
|
+
|
5192
5231
|
it('should return series.userOptions.initialName if it is present and axis formatting is on', () => {
|
5193
5232
|
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5194
5233
|
const context = {
|
@@ -5199,7 +5238,7 @@ describe('highcharts_renderer', () => {
|
|
5199
5238
|
name: name2,
|
5200
5239
|
}
|
5201
5240
|
}
|
5202
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name1);
|
5241
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name1);
|
5203
5242
|
});
|
5204
5243
|
|
5205
5244
|
it('should return series.name if axis formatting is on but series.userOptions.initialName is not present', () => {
|
@@ -5209,7 +5248,7 @@ describe('highcharts_renderer', () => {
|
|
5209
5248
|
name: name2,
|
5210
5249
|
}
|
5211
5250
|
}
|
5212
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name2);
|
5251
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5213
5252
|
});
|
5214
5253
|
|
5215
5254
|
it('should return series.name if series.userOptions.initialName is present but axis formatting is off', () => {
|
@@ -5222,7 +5261,7 @@ describe('highcharts_renderer', () => {
|
|
5222
5261
|
name: name2,
|
5223
5262
|
}
|
5224
5263
|
}
|
5225
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name2);
|
5264
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5226
5265
|
});
|
5227
5266
|
});
|
5228
5267
|
|
@@ -5230,7 +5269,10 @@ describe('highcharts_renderer', () => {
|
|
5230
5269
|
|
5231
5270
|
const name1 = 'test series name 1';
|
5232
5271
|
const name2 = 'test series name 2';
|
5233
|
-
const name3 = 'test series name 3';
|
5272
|
+
const name3 = 'test series name 3';
|
5273
|
+
const pivotData = {
|
5274
|
+
isFormattingAxisLabels: true,
|
5275
|
+
};
|
5234
5276
|
|
5235
5277
|
it('should return point.options.colsForTotal if it is present', () => {
|
5236
5278
|
const context = {
|
@@ -5245,7 +5287,7 @@ describe('highcharts_renderer', () => {
|
|
5245
5287
|
|
5246
5288
|
lodash.forEach(['use_default_table_format_for_axis'], [], features => {
|
5247
5289
|
lodash.set(document, 'ReportHippo.user.features', features);
|
5248
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name3);
|
5290
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5249
5291
|
});
|
5250
5292
|
});
|
5251
5293
|
|
@@ -5260,7 +5302,7 @@ describe('highcharts_renderer', () => {
|
|
5260
5302
|
},
|
5261
5303
|
key: name2,
|
5262
5304
|
}
|
5263
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name1);
|
5305
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name1);
|
5264
5306
|
});
|
5265
5307
|
|
5266
5308
|
it('should return context.key if FF is off and colsForTotal is not present', () => {
|
@@ -5273,8 +5315,8 @@ describe('highcharts_renderer', () => {
|
|
5273
5315
|
initialName: name3,
|
5274
5316
|
},
|
5275
5317
|
key: name2,
|
5276
|
-
}
|
5277
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name2);
|
5318
|
+
};
|
5319
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name2);
|
5278
5320
|
});
|
5279
5321
|
|
5280
5322
|
it('should return options.initialName if FF is on, colsForTotal is not present and point.initialName is not present', () => {
|
@@ -5285,7 +5327,7 @@ describe('highcharts_renderer', () => {
|
|
5285
5327
|
},
|
5286
5328
|
key: name2,
|
5287
5329
|
}
|
5288
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name3);
|
5330
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5289
5331
|
});
|
5290
5332
|
|
5291
5333
|
it('should return context.key if FF is on, no colsForTotal a, no point.initialName no options.initialName', () => {
|
@@ -5293,7 +5335,7 @@ describe('highcharts_renderer', () => {
|
|
5293
5335
|
const context = {
|
5294
5336
|
key: name2,
|
5295
5337
|
}
|
5296
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name2);
|
5338
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name2);
|
5297
5339
|
});
|
5298
5340
|
});
|
5299
5341
|
});
|