@datarailsshared/dr_renderer 1.2.396 → 1.2.398

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.396",
3
+ "version": "1.2.398",
4
4
  "description": "DataRails charts and tables renderer",
5
5
  "keywords": [
6
6
  "datarails",
@@ -6174,4 +6174,868 @@ describe('highcharts_renderer', () => {
6174
6174
  expect(tooltipHtml).toEqual('row 1: 10.99%');
6175
6175
  });
6176
6176
  });
6177
+
6178
+ describe("Function updateFiltersShowNames", () => {
6179
+
6180
+ it("should receive array or object", () => {
6181
+
6182
+ const filters = [{
6183
+ field: 4030578,
6184
+ name: "Month",
6185
+ values: [1682812800, 1680220800, "[null]"],
6186
+ is_excluded: false,
6187
+ allow_nulls: false,
6188
+ show_in_graph: true,
6189
+ type: "Date",
6190
+ override_global_filter: false,
6191
+ },
6192
+ {
6193
+ field: 4030223,
6194
+ name: "AccountCode",
6195
+ values: null,
6196
+ is_excluded: false,
6197
+ allow_nulls: false,
6198
+ show_in_graph: true,
6199
+ type: "Text",
6200
+ override_global_filter: false,
6201
+ },
6202
+ ];
6203
+
6204
+ highchartsRenderer.updateFiltersShowNames(filters);
6205
+
6206
+ expect(filters[0].value_to_show).toEqual("04/30/2023, 03/31/2023, [null]");
6207
+ expect(filters[1].value_to_show).toEqual("All");
6208
+ });
6209
+
6210
+ it("should receive array or object", () => {
6211
+ const filters = [{
6212
+ field: 934090,
6213
+ name: "Data Type",
6214
+ values: ["Activity"],
6215
+ is_excluded: false,
6216
+ allow_nulls: false,
6217
+ show_in_graph: false,
6218
+ type: "Text",
6219
+ override_global_filter: false,
6220
+ },
6221
+ {
6222
+ field: 934093,
6223
+ name: "Scenario",
6224
+ values: {
6225
+ type: "advanced",
6226
+ val: [{
6227
+ operator: null,
6228
+ condition: "equals",
6229
+ value: "Actuals",
6230
+ }, ],
6231
+ },
6232
+ is_excluded: false,
6233
+ allow_nulls: false,
6234
+ show_in_graph: false,
6235
+ type: "Text",
6236
+ override_global_filter: false,
6237
+ },
6238
+ ];
6239
+
6240
+ highchartsRenderer.updateFiltersShowNames(filters);
6241
+
6242
+ expect(filters[0].value_to_show).toEqual("Activity");
6243
+ expect(filters[1].value_to_show).toEqual("All");
6244
+ });
6245
+ });
6246
+
6247
+ describe("Function returnRawDataValue", () => {
6248
+ const testCases = [{
6249
+ name: "Date",
6250
+ filter: {
6251
+ field: 4030578,
6252
+ name: "Month",
6253
+ values: [1682812800, 1680220800, "[null]", null, 0, "", 1680220800],
6254
+ is_excluded: false,
6255
+ allow_nulls: false,
6256
+ show_in_graph: true,
6257
+ type: "Date",
6258
+ override_global_filter: false,
6259
+ },
6260
+ expectedResults: [
6261
+ "04/30/2023", "03/31/2023", "[null]", "[null]", "Untagged", "[blank]", "03/31/2023",
6262
+ ],
6263
+ },
6264
+ {
6265
+ name: "Date with VT_Month",
6266
+ filter: {
6267
+ field: 4030578,
6268
+ name: "VT_Month",
6269
+ values: [1682812800, 1680220800, "[null]", null, 0, "", 1680220800],
6270
+ is_excluded: false,
6271
+ allow_nulls: false,
6272
+ show_in_graph: true,
6273
+ type: "Date",
6274
+ override_global_filter: false,
6275
+ },
6276
+ expectedResults: [
6277
+ "Apr 2023", "Mar 2023", "[null]", "[null]", "Untagged", "[blank]", "Mar 2023",
6278
+ ],
6279
+ },
6280
+ {
6281
+ name: "Number",
6282
+ filter: {
6283
+ field: 4030578,
6284
+ name: "Month",
6285
+ values: [100, 200, "[null]", null, "Text", 0],
6286
+ is_excluded: false,
6287
+ allow_nulls: false,
6288
+ show_in_graph: true,
6289
+ type: "Number",
6290
+ override_global_filter: false,
6291
+ },
6292
+ expectedResults: [100, 200, "[null]", "[null]", "Text", 0],
6293
+ },
6294
+ ];
6295
+
6296
+ testCases.forEach((testCase) => {
6297
+ describe(`Scenario: ${testCase.name}`, () => {
6298
+ testCase.filter.values.forEach((value, index) => {
6299
+ it(`should return the expected result with value ${value}`, () => {
6300
+ const result = highchartsRenderer.returnRawDataValue(testCase.filter.type, value, testCase.filter.format, testCase.filter.name);
6301
+ expect(result).toEqual(testCase.expectedResults[index]);
6302
+ });
6303
+ });
6304
+ });
6305
+ });
6306
+ });
6307
+
6308
+ describe("Function check_values_not_for_convert", () => {
6309
+ const testCases = [{
6310
+ name: "should return a array when field is series row name equal to field name",
6311
+ currentgraph: {
6312
+ rows: [{
6313
+ name: "Month",
6314
+ }, ],
6315
+ cols: [{
6316
+ name: "Grouping",
6317
+ }, ],
6318
+ options: {
6319
+ chartOptions: {
6320
+ delta_column: {
6321
+ field: "series",
6322
+ name: "Month",
6323
+ },
6324
+ },
6325
+ },
6326
+ },
6327
+ field_name: "Month",
6328
+ expected: ["Month"],
6329
+ },
6330
+ {
6331
+ name: "should return an empty array when field is category and col name does not equal to field name",
6332
+ currentgraph: {
6333
+ rows: [{
6334
+ name: "Month",
6335
+ }, ],
6336
+ cols: [{
6337
+ name: "Grouping",
6338
+ }, ],
6339
+ options: {
6340
+ chartOptions: {
6341
+ delta_column: {
6342
+ field: "category",
6343
+ name: "Month",
6344
+ },
6345
+ },
6346
+ },
6347
+ },
6348
+ field_name: "Month",
6349
+ expected: [],
6350
+ },
6351
+ {
6352
+ name: "should return an empty array when field is category and col name does not equal to field name",
6353
+ currentgraph: {
6354
+ rows: [{
6355
+ name: "Grouping",
6356
+ }, ],
6357
+ cols: [{
6358
+ name: "Month",
6359
+ }, ],
6360
+ options: {
6361
+ chartOptions: {
6362
+ delta_column: {
6363
+ field: "category",
6364
+ name: "Month",
6365
+ },
6366
+ },
6367
+ },
6368
+ },
6369
+ field_name: "Month",
6370
+ expected: ["Month"],
6371
+ },
6372
+ {
6373
+ name: 'should return an array with keys with trend "total" from walkthrough_options.values.walkthrough',
6374
+ currentgraph: {
6375
+ chart_type: "waterfall-chart-walkthrough",
6376
+ options: {
6377
+ walkthrough_options: {
6378
+ values: {
6379
+ walkthrough: [{
6380
+ trend: "total",
6381
+ key: ["Total"]
6382
+ },
6383
+ {
6384
+ trend: "other",
6385
+ key: ["Value2"]
6386
+ },
6387
+ ],
6388
+ },
6389
+ },
6390
+ },
6391
+ },
6392
+ field_name: "SampleName",
6393
+ expected: ["Total"],
6394
+ },
6395
+ {
6396
+ name: "should return an empty array when no conditions are met",
6397
+ currentgraph: {
6398
+ options: {
6399
+ chartOptions: {}
6400
+ },
6401
+ chart_type: "column-chart",
6402
+ },
6403
+ field_name: "Month",
6404
+ expected: [],
6405
+ },
6406
+ ];
6407
+
6408
+ testCases.forEach(({
6409
+ name,
6410
+ currentgraph,
6411
+ field_name,
6412
+ expected
6413
+ }) => {
6414
+ it(name, () => {
6415
+ const result = highchartsRenderer.check_values_not_for_convert(
6416
+ currentgraph,
6417
+ field_name
6418
+ );
6419
+ expect(result).toEqual(expected);
6420
+ });
6421
+ });
6422
+ });
6423
+ describe('Function ptCreateColumnSeries', () => {
6424
+ const format = null;
6425
+ let pivotDataMock, additionalOptionsMock, colors, onlyNumbers, isUniqueVals, opts, chartOptions, isNotDrillDown, chartType;
6426
+ beforeEach(() => {
6427
+ colors = [
6428
+ "#ff0202",
6429
+ "#b3060e",
6430
+ "#70000a"
6431
+ ];
6432
+ opts = {};
6433
+ chartOptions = {};
6434
+ pivotDataMock = {
6435
+ getAggregator: (rows, cols) => {
6436
+ let aggregator = highchartsRenderer.rhPivotAggregatorSum([''], format, true, {}, {});
6437
+ const agg = aggregator({}, '', '');
6438
+
6439
+ if (lodash.isEqual(cols, ['col 1']) && lodash.isEqual(rows, ['row 1'])) {
6440
+ agg.sum = 12345;
6441
+ } else if (lodash.isEqual(cols, ['col 1']) && lodash.isEqual(rows, ['row 2'])) {
6442
+ agg.sum = 123450;
6443
+ } else if (lodash.isEqual(cols, ['col 2']) && lodash.isEqual(rows, ['row 1'])) {
6444
+ agg.sum = 54321;
6445
+ } else if (lodash.isEqual(cols, ['col 2']) && lodash.isEqual(rows, ['row 2'])) {
6446
+ agg.sum = 11111;
6447
+ } else if (lodash.isEqual(cols, [highchartsRenderer.DR_OTHERS_KEY]) && lodash.isEqual(rows, ['row 1'])) {
6448
+ agg.sum = 99999;
6449
+ } else if (lodash.isEqual(cols, [highchartsRenderer.DR_OTHERS_KEY]) && lodash.isEqual(rows, ['row 2'])) {
6450
+ agg.sum = 99991;
6451
+ }
6452
+
6453
+ return agg;
6454
+ },
6455
+ getColKeys: () => [['col 1'], ['col 2'], [highchartsRenderer.DR_OTHERS_KEY]],
6456
+ getRowKeys: () => [['row 1'], ['row 2']],
6457
+ rowFormats: [],
6458
+ colFormats: [],
6459
+ rowAttrs: ['row 1'],
6460
+ };
6461
+ });
6462
+
6463
+ it('should prepare appropriate chart series, when additional options have delta column \'field\'', ()=> {
6464
+ additionalOptionsMock = {
6465
+ delta_column: {
6466
+ field: 'series',
6467
+ name: 'row 1',
6468
+ chart: 'line'
6469
+ }
6470
+ };
6471
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6472
+ expect(value).toEqual([
6473
+ {
6474
+ data: [
6475
+ {
6476
+ initialName: 'col 1',
6477
+ name: 'col 1',
6478
+ y: 123450,
6479
+ drilldown: true
6480
+ },
6481
+ {
6482
+ initialName: 'col 2',
6483
+ name: 'col 2',
6484
+ y: 11111,
6485
+ drilldown: true
6486
+ },
6487
+ {
6488
+ initialName: 'Others',
6489
+ name: 'Others',
6490
+ y: 99991,
6491
+ drilldown: true
6492
+ }
6493
+ ],
6494
+ initialName: 'row 2',
6495
+ name: 'row 2',
6496
+ dataLabels: {
6497
+ style: {
6498
+ fontSize: '11',
6499
+ fontFamily: 'Poppins',
6500
+ fontWeight: 'normal'
6501
+ },
6502
+ color: '#151a41',
6503
+ allowOverlap: false,
6504
+ enabled: true,
6505
+ formatter: expect.any(Function)
6506
+ },
6507
+ color: '#b3060e'
6508
+ },
6509
+ {
6510
+ data: [
6511
+ {
6512
+ initialName: 'col 1',
6513
+ name: 'col 1',
6514
+ y: 12345,
6515
+ drilldown: true
6516
+ },
6517
+ {
6518
+ initialName: 'col 2',
6519
+ name: 'col 2',
6520
+ y: 54321,
6521
+ drilldown: true
6522
+ },
6523
+ {
6524
+ initialName: 'Others',
6525
+ name: 'Others',
6526
+ y: 99999,
6527
+ drilldown: true
6528
+ }
6529
+ ],
6530
+ initialName: 'row 1',
6531
+ name: 'row 1',
6532
+ dataLabels: {
6533
+ style: {
6534
+ fontSize: '11',
6535
+ fontFamily: 'Poppins',
6536
+ fontWeight: 'normal'
6537
+ },
6538
+ color: '#151a41',
6539
+ allowOverlap: false,
6540
+ enabled: true,
6541
+ formatter: expect.any(Function)
6542
+ },
6543
+ color: '#5ecfb9',
6544
+ type: 'line',
6545
+ lineColor: '#5ecfb9',
6546
+ marker: {
6547
+ lineColor: '#5ecfb9'
6548
+ }
6549
+ }
6550
+ ]);
6551
+ });
6552
+ it('should prepare appropriate chart series, when additional options have delta column \'only variant\'', ()=> {
6553
+ additionalOptionsMock = {
6554
+ delta_column: {
6555
+ field: 'series',
6556
+ only_variant: true,
6557
+ name: 'row 1',
6558
+ chart: 'line'
6559
+ }
6560
+ };
6561
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6562
+ expect(value).toEqual([
6563
+ {
6564
+ data: [
6565
+ {
6566
+ initialName: 'col 1',
6567
+ name: 'col 1',
6568
+ y: 12345,
6569
+ drilldown: true
6570
+ },
6571
+ {
6572
+ initialName: 'col 2',
6573
+ name: 'col 2',
6574
+ y: 54321,
6575
+ drilldown: true
6576
+ },
6577
+ {
6578
+ initialName: 'Others',
6579
+ name: 'Others',
6580
+ y: 99999,
6581
+ drilldown: true
6582
+ }
6583
+ ],
6584
+ initialName: 'row 1',
6585
+ name: 'row 1',
6586
+ dataLabels: {
6587
+ style: {
6588
+ fontSize: '11',
6589
+ fontFamily: 'Poppins',
6590
+ fontWeight: 'normal'
6591
+ },
6592
+ color: '#151a41',
6593
+ allowOverlap: false,
6594
+ enabled: true,
6595
+ formatter: expect.any(Function)
6596
+ },
6597
+ color: '#5ecfb9',
6598
+ type: 'line',
6599
+ lineColor: '#5ecfb9',
6600
+ marker: {
6601
+ lineColor: '#5ecfb9'
6602
+ }
6603
+ }
6604
+ ]);
6605
+ });
6606
+ it('should prepare appropriate chart series, when opts \'total\' configuration is set to true', ()=> {
6607
+ additionalOptionsMock = {};
6608
+ opts = {
6609
+ total: true
6610
+ };
6611
+ pivotDataMock.colTotals = {
6612
+ 'col 1': {value: () => 123450},
6613
+ 'col 2': {value: () => 123451},
6614
+ 'DR_Others': {value: () => 123452},
6615
+ };
6616
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6617
+ expect(value).toEqual([
6618
+ {
6619
+ color: '#ff0202',
6620
+ data: [
6621
+ {
6622
+ drilldown: true,
6623
+ initialName: 'col 1',
6624
+ name: 'col 1',
6625
+ y: 12345
6626
+ },
6627
+ {
6628
+ drilldown: true,
6629
+ initialName: 'col 2',
6630
+ name: 'col 2',
6631
+ y: 54321
6632
+ },
6633
+ {
6634
+ drilldown: true,
6635
+ initialName: 'Others',
6636
+ name: 'Others',
6637
+ y: 99999
6638
+ }
6639
+ ],
6640
+ dataLabels: {
6641
+ allowOverlap: false,
6642
+ color: '#151a41',
6643
+ enabled: true,
6644
+ formatter: expect.any(Function),
6645
+ style: {
6646
+ fontFamily: 'Poppins',
6647
+ fontSize: '11',
6648
+ fontWeight: 'normal'
6649
+ }
6650
+ },
6651
+ initialName: 'row 1',
6652
+ name: 'row 1'
6653
+ },
6654
+ {
6655
+ color: '#b3060e',
6656
+ data: [
6657
+ {
6658
+ drilldown: true,
6659
+ initialName: 'col 1',
6660
+ name: 'col 1',
6661
+ y: 123450
6662
+ },
6663
+ {
6664
+ drilldown: true,
6665
+ initialName: 'col 2',
6666
+ name: 'col 2',
6667
+ y: 11111
6668
+ },
6669
+ {
6670
+ drilldown: true,
6671
+ initialName: 'Others',
6672
+ name: 'Others',
6673
+ y: 99991
6674
+ }
6675
+ ],
6676
+ dataLabels: {
6677
+ allowOverlap: false,
6678
+ color: '#151a41',
6679
+ enabled: true,
6680
+ formatter: expect.any(Function),
6681
+ style: {
6682
+ fontFamily: 'Poppins',
6683
+ fontSize: '11',
6684
+ fontWeight: 'normal'
6685
+ }
6686
+ },
6687
+ initialName: 'row 2',
6688
+ name: 'row 2'
6689
+ },
6690
+ {
6691
+ className: 'totalSeries',
6692
+ color: '#70000a',
6693
+ data: [
6694
+ {
6695
+ initialName: 'col 1',
6696
+ name: 'col 1',
6697
+ y: 123450
6698
+ },
6699
+ {
6700
+ initialName: 'col 2',
6701
+ name: 'col 2',
6702
+ y: 123451
6703
+ },
6704
+ {
6705
+ initialName: 'DR_Others',
6706
+ name: 'DR_Others',
6707
+ y: 123452
6708
+ }
6709
+ ],
6710
+ dataLabels: {
6711
+ allowOverlap: false,
6712
+ color: '#151a41',
6713
+ enabled: true,
6714
+ formatter: expect.any(Function),
6715
+ style: {
6716
+ fontFamily: 'Poppins',
6717
+ fontSize: '11',
6718
+ fontWeight: 'normal'
6719
+ }
6720
+ },
6721
+ initialName: 'row 2',
6722
+ name: 'Total'
6723
+ }
6724
+ ]);
6725
+ });
6726
+ it('should prepare appropriate chart series, when opts \'trendLine\' configuration is set to true', ()=> {
6727
+ opts = {
6728
+ trendLine: true
6729
+ };
6730
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6731
+ expect(value).toEqual([
6732
+ {
6733
+ data: [
6734
+ {
6735
+ initialName: 'col 1',
6736
+ name: 'col 1',
6737
+ y: 12345,
6738
+ drilldown: true
6739
+ },
6740
+ {
6741
+ initialName: 'col 2',
6742
+ name: 'col 2',
6743
+ y: 54321,
6744
+ drilldown: true
6745
+ },
6746
+ {
6747
+ initialName: 'Others',
6748
+ name: 'Others',
6749
+ y: 99999,
6750
+ drilldown: true
6751
+ }
6752
+ ],
6753
+ initialName: 'row 1',
6754
+ name: 'row 1',
6755
+ dataLabels: {
6756
+ style: {
6757
+ fontSize: '11',
6758
+ fontFamily: 'Poppins',
6759
+ fontWeight: 'normal'
6760
+ },
6761
+ color: '#151a41',
6762
+ allowOverlap: false,
6763
+ enabled: true,
6764
+ formatter: expect.any(Function),
6765
+ },
6766
+ color: '#ff0202'
6767
+ },
6768
+ {
6769
+ data: [
6770
+ {
6771
+ initialName: 'col 1',
6772
+ name: 'col 1',
6773
+ y: 123450,
6774
+ drilldown: true
6775
+ },
6776
+ {
6777
+ initialName: 'col 2',
6778
+ name: 'col 2',
6779
+ y: 11111,
6780
+ drilldown: true
6781
+ },
6782
+ {
6783
+ initialName: 'Others',
6784
+ name: 'Others',
6785
+ y: 99991,
6786
+ drilldown: true
6787
+ }
6788
+ ],
6789
+ initialName: 'row 2',
6790
+ name: 'row 2',
6791
+ dataLabels: {
6792
+ style: {
6793
+ fontSize: '11',
6794
+ fontFamily: 'Poppins',
6795
+ fontWeight: 'normal'
6796
+ },
6797
+ color: '#151a41',
6798
+ allowOverlap: false,
6799
+ enabled: true,
6800
+ formatter: expect.any(Function),
6801
+ },
6802
+ color: '#b3060e'
6803
+ },
6804
+ {
6805
+ data: [
6806
+ {
6807
+ name: 'col 1',
6808
+ y: 11728
6809
+ },
6810
+ {
6811
+ name: 'col 2',
6812
+ y: 55555
6813
+ },
6814
+ {
6815
+ name: 'Others',
6816
+ y: 99382
6817
+ }
6818
+ ],
6819
+ initialName: 'row 1',
6820
+ name: 'Trend Line (row 1)',
6821
+ dataLabels: {
6822
+ style: {
6823
+ fontSize: '11',
6824
+ fontFamily: 'Poppins',
6825
+ fontWeight: 'normal'
6826
+ },
6827
+ color: '#151a41',
6828
+ allowOverlap: false,
6829
+ enabled: true,
6830
+ formatter: expect.any(Function),
6831
+ },
6832
+ color: '#ff0202',
6833
+ className: 'trendSeries',
6834
+ dashStyle: 'shortdot',
6835
+ type: 'line'
6836
+ },
6837
+ {
6838
+ data: [
6839
+ {
6840
+ name: 'col 1',
6841
+ y: 89913.5
6842
+ },
6843
+ {
6844
+ name: 'col 2',
6845
+ y: 78184
6846
+ },
6847
+ {
6848
+ name: 'Others',
6849
+ y: 66454.5
6850
+ }
6851
+ ],
6852
+ initialName: 'row 2',
6853
+ name: 'Trend Line (row 2)',
6854
+ dataLabels: {
6855
+ style: {
6856
+ fontSize: '11',
6857
+ fontFamily: 'Poppins',
6858
+ fontWeight: 'normal'
6859
+ },
6860
+ color: '#151a41',
6861
+ allowOverlap: false,
6862
+ enabled: true,
6863
+ formatter: expect.any(Function),
6864
+ },
6865
+ color: '#b3060e',
6866
+ className: 'trendSeries',
6867
+ dashStyle: 'shortdot',
6868
+ type: 'line'
6869
+ }
6870
+ ]);
6871
+ });
6872
+ it('should prepare appropriate chart series, when opts \'comboOptions\' has valid series name to process', () => {
6873
+ opts = {
6874
+ comboOptions: {
6875
+ seriesOptions: [
6876
+ {
6877
+ series: 'row 1',
6878
+ chartType: 'area-chart'
6879
+ }
6880
+ ]
6881
+ }
6882
+ };
6883
+ chartType = ['combo'];
6884
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6885
+ expect(value).toEqual([
6886
+ {
6887
+ data: [
6888
+ {
6889
+ initialName: 'col 1',
6890
+ name: 'col 1',
6891
+ y: 12345,
6892
+ drilldown: true
6893
+ },
6894
+ {
6895
+ initialName: 'col 2',
6896
+ name: 'col 2',
6897
+ y: 54321,
6898
+ drilldown: true
6899
+ },
6900
+ {
6901
+ initialName: 'Others',
6902
+ name: 'Others',
6903
+ y: 99999,
6904
+ drilldown: true
6905
+ }
6906
+ ],
6907
+ initialName: 'row 1',
6908
+ name: 'row 1',
6909
+ dataLabels: {
6910
+ style: {
6911
+ fontSize: '11',
6912
+ fontFamily: 'Poppins',
6913
+ fontWeight: 'normal'
6914
+ },
6915
+ color: '#151a41',
6916
+ allowOverlap: false,
6917
+ enabled: true,
6918
+ formatter: expect.any(Function),
6919
+ },
6920
+ color: '#ff0202',
6921
+ type: 'area'
6922
+ },
6923
+ {data: [
6924
+ {
6925
+ initialName: 'col 1',
6926
+ name: 'col 1',
6927
+ y: 123450,
6928
+ drilldown: true
6929
+ },
6930
+ {
6931
+ initialName: 'col 2',
6932
+ name: 'col 2',
6933
+ y: 11111,
6934
+ drilldown: true
6935
+ },
6936
+ {
6937
+ initialName: 'Others',
6938
+ name: 'Others',
6939
+ y: 99991,
6940
+ drilldown: true
6941
+ }
6942
+ ],
6943
+ initialName: 'row 2',
6944
+ name: 'row 2',
6945
+ dataLabels: {
6946
+ style: {
6947
+ fontSize: '11',
6948
+ fontFamily: 'Poppins',
6949
+ fontWeight: 'normal'
6950
+ },
6951
+ color: '#151a41',
6952
+ allowOverlap: false,
6953
+ enabled: true,
6954
+ formatter: expect.any(Function),
6955
+ },
6956
+ color: '#b3060e',
6957
+ type: 'line'
6958
+ }
6959
+ ]);
6960
+ });
6961
+ it('should prepare appropriate chart series for standard input', () => {
6962
+ opts = {};
6963
+ chartType = null;
6964
+ const value = highchartsRenderer.ptCreateColumnSeries(pivotDataMock, colors, onlyNumbers, isUniqueVals, isNotDrillDown, additionalOptionsMock, opts, chartOptions, chartType);
6965
+ expect(value).toEqual([
6966
+ {
6967
+ data: [
6968
+ {
6969
+ initialName: 'col 1',
6970
+ name: 'col 1',
6971
+ y: 12345,
6972
+ drilldown: true
6973
+ },
6974
+ {
6975
+ initialName: 'col 2',
6976
+ name: 'col 2',
6977
+ y: 54321,
6978
+ drilldown: true
6979
+ },
6980
+ {
6981
+ initialName: 'Others',
6982
+ name: 'Others',
6983
+ y: 99999,
6984
+ drilldown: true
6985
+ }
6986
+ ],
6987
+ initialName: 'row 1',
6988
+ name: 'row 1',
6989
+ dataLabels: {
6990
+ style: {
6991
+ fontSize: '11',
6992
+ fontFamily: 'Poppins',
6993
+ fontWeight: 'normal'
6994
+ },
6995
+ color: '#151a41',
6996
+ allowOverlap: false,
6997
+ enabled: true,
6998
+ formatter: expect.any(Function),
6999
+ },
7000
+ color: '#ff0202'
7001
+ },
7002
+ {
7003
+ data: [
7004
+ {
7005
+ initialName: 'col 1',
7006
+ name: 'col 1',
7007
+ y: 123450,
7008
+ drilldown: true
7009
+ },
7010
+ {
7011
+ initialName: 'col 2',
7012
+ name: 'col 2',
7013
+ y: 11111,
7014
+ drilldown: true
7015
+ },
7016
+ {
7017
+ initialName: 'Others',
7018
+ name: 'Others',
7019
+ y: 99991,
7020
+ drilldown: true
7021
+ }
7022
+ ],
7023
+ initialName: 'row 2',
7024
+ name: 'row 2',
7025
+ dataLabels: {
7026
+ style: {
7027
+ fontSize: '11',
7028
+ fontFamily: 'Poppins',
7029
+ fontWeight: 'normal'
7030
+ },
7031
+ color: '#151a41',
7032
+ allowOverlap: false,
7033
+ enabled: true,
7034
+ formatter: expect.any(Function),
7035
+ },
7036
+ color: '#b3060e'
7037
+ }
7038
+ ]);
7039
+ })
7040
+ });
6177
7041
  });