@datarailsshared/dr_renderer 1.2.337 → 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 +19 -19
- package/src/pivottable.js +1 -0
- package/tests/highcharts_renderer.test.js +48 -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,8 +9370,8 @@ 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);
|
@@ -9380,13 +9380,13 @@ let getHighchartsRenderer = function ($, document, Highcharts, default_colors, h
|
|
9380
9380
|
lodash.set(e, 'point.category.userOptions', e.point.initialName.toString().split(highchartsRenderer.delimer));
|
9381
9381
|
}
|
9382
9382
|
|
9383
|
-
highchartsRenderer.getSeriesNameInFormatterContext = function(context) {
|
9384
|
-
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 || '') + "";
|
9385
9385
|
}
|
9386
9386
|
|
9387
|
-
highchartsRenderer.getColsInFormatterContext = function(context) {
|
9387
|
+
highchartsRenderer.getColsInFormatterContext = function(context, pivotData) {
|
9388
9388
|
return lodash.get(context, 'point.options.colsForTotal')
|
9389
|
-
|| 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'))
|
9390
9390
|
|| context.key;
|
9391
9391
|
}
|
9392
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(() => {
|
@@ -5167,6 +5190,10 @@ describe('highcharts_renderer', () => {
|
|
5167
5190
|
}
|
5168
5191
|
};
|
5169
5192
|
|
5193
|
+
const pivotData = {
|
5194
|
+
isFormattingAxisLabels: true,
|
5195
|
+
};
|
5196
|
+
|
5170
5197
|
beforeEach(() => {
|
5171
5198
|
spyOn(highchartsRenderer, 'getFormattedKeys').and.returnValue(null);
|
5172
5199
|
});
|
@@ -5175,7 +5202,7 @@ describe('highcharts_renderer', () => {
|
|
5175
5202
|
const e = lodash.cloneDeep(event);
|
5176
5203
|
lodash.set(document, 'ReportHippo.user.features', []);
|
5177
5204
|
|
5178
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
5205
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5179
5206
|
expect(e.point.name).toEqual(event.point.name);
|
5180
5207
|
expect(e.point.series.name).toEqual(event.point.series.name);
|
5181
5208
|
expect(e.point.category.userOptions).toEqual(event.point.category.userOptions);
|
@@ -5185,7 +5212,7 @@ describe('highcharts_renderer', () => {
|
|
5185
5212
|
const e = lodash.cloneDeep(event);
|
5186
5213
|
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5187
5214
|
|
5188
|
-
highchartsRenderer.modifyEventPointForDrilldown(e);
|
5215
|
+
highchartsRenderer.modifyEventPointForDrilldown(e, pivotData);
|
5189
5216
|
expect(e.point.name).toEqual(event.point.initialName);
|
5190
5217
|
expect(e.point.series.name).toEqual(event.point.series.userOptions.initialName);
|
5191
5218
|
expect(e.point.category.userOptions).toEqual([event.point.initialName]);
|
@@ -5197,6 +5224,10 @@ describe('highcharts_renderer', () => {
|
|
5197
5224
|
const name1 = 'test series name';
|
5198
5225
|
const name2 = 'test series name 2';
|
5199
5226
|
|
5227
|
+
const pivotData = {
|
5228
|
+
isFormattingAxisLabels: true,
|
5229
|
+
};
|
5230
|
+
|
5200
5231
|
it('should return series.userOptions.initialName if it is present and axis formatting is on', () => {
|
5201
5232
|
lodash.set(document, 'ReportHippo.user.features', ['use_default_table_format_for_axis']);
|
5202
5233
|
const context = {
|
@@ -5207,7 +5238,7 @@ describe('highcharts_renderer', () => {
|
|
5207
5238
|
name: name2,
|
5208
5239
|
}
|
5209
5240
|
}
|
5210
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name1);
|
5241
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name1);
|
5211
5242
|
});
|
5212
5243
|
|
5213
5244
|
it('should return series.name if axis formatting is on but series.userOptions.initialName is not present', () => {
|
@@ -5217,7 +5248,7 @@ describe('highcharts_renderer', () => {
|
|
5217
5248
|
name: name2,
|
5218
5249
|
}
|
5219
5250
|
}
|
5220
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name2);
|
5251
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5221
5252
|
});
|
5222
5253
|
|
5223
5254
|
it('should return series.name if series.userOptions.initialName is present but axis formatting is off', () => {
|
@@ -5230,7 +5261,7 @@ describe('highcharts_renderer', () => {
|
|
5230
5261
|
name: name2,
|
5231
5262
|
}
|
5232
5263
|
}
|
5233
|
-
expect(highchartsRenderer.getSeriesNameInFormatterContext(context)).toEqual(name2);
|
5264
|
+
expect(highchartsRenderer.getSeriesNameInFormatterContext(context, pivotData)).toEqual(name2);
|
5234
5265
|
});
|
5235
5266
|
});
|
5236
5267
|
|
@@ -5238,7 +5269,10 @@ describe('highcharts_renderer', () => {
|
|
5238
5269
|
|
5239
5270
|
const name1 = 'test series name 1';
|
5240
5271
|
const name2 = 'test series name 2';
|
5241
|
-
const name3 = 'test series name 3';
|
5272
|
+
const name3 = 'test series name 3';
|
5273
|
+
const pivotData = {
|
5274
|
+
isFormattingAxisLabels: true,
|
5275
|
+
};
|
5242
5276
|
|
5243
5277
|
it('should return point.options.colsForTotal if it is present', () => {
|
5244
5278
|
const context = {
|
@@ -5253,7 +5287,7 @@ describe('highcharts_renderer', () => {
|
|
5253
5287
|
|
5254
5288
|
lodash.forEach(['use_default_table_format_for_axis'], [], features => {
|
5255
5289
|
lodash.set(document, 'ReportHippo.user.features', features);
|
5256
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name3);
|
5290
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5257
5291
|
});
|
5258
5292
|
});
|
5259
5293
|
|
@@ -5268,7 +5302,7 @@ describe('highcharts_renderer', () => {
|
|
5268
5302
|
},
|
5269
5303
|
key: name2,
|
5270
5304
|
}
|
5271
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name1);
|
5305
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name1);
|
5272
5306
|
});
|
5273
5307
|
|
5274
5308
|
it('should return context.key if FF is off and colsForTotal is not present', () => {
|
@@ -5281,8 +5315,8 @@ describe('highcharts_renderer', () => {
|
|
5281
5315
|
initialName: name3,
|
5282
5316
|
},
|
5283
5317
|
key: name2,
|
5284
|
-
}
|
5285
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name2);
|
5318
|
+
};
|
5319
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name2);
|
5286
5320
|
});
|
5287
5321
|
|
5288
5322
|
it('should return options.initialName if FF is on, colsForTotal is not present and point.initialName is not present', () => {
|
@@ -5293,7 +5327,7 @@ describe('highcharts_renderer', () => {
|
|
5293
5327
|
},
|
5294
5328
|
key: name2,
|
5295
5329
|
}
|
5296
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name3);
|
5330
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name3);
|
5297
5331
|
});
|
5298
5332
|
|
5299
5333
|
it('should return context.key if FF is on, no colsForTotal a, no point.initialName no options.initialName', () => {
|
@@ -5301,7 +5335,7 @@ describe('highcharts_renderer', () => {
|
|
5301
5335
|
const context = {
|
5302
5336
|
key: name2,
|
5303
5337
|
}
|
5304
|
-
expect(highchartsRenderer.getColsInFormatterContext(context)).toEqual(name2);
|
5338
|
+
expect(highchartsRenderer.getColsInFormatterContext(context, pivotData)).toEqual(name2);
|
5305
5339
|
});
|
5306
5340
|
});
|
5307
5341
|
});
|