axidio-styleguide-library1-v2 0.2.23 → 0.2.24
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/esm2022/lib/group-chart/group-chart.component.mjs +2 -189
- package/esm2022/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.mjs +519 -1081
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +15 -220
- package/fesm2022/axidio-styleguide-library1-v2.mjs +538 -1492
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.d.ts +74 -12
- package/package.json +1 -1
|
@@ -3481,9 +3481,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3481
3481
|
var alternate_text = false;
|
|
3482
3482
|
var short_tick_length = 4;
|
|
3483
3483
|
var long_tick_length = 16;
|
|
3484
|
-
/**
|
|
3485
|
-
* longer tick length needed for weekly charts
|
|
3486
|
-
*/
|
|
3487
3484
|
var short_tick_length_bg = 5;
|
|
3488
3485
|
var long_tick_length_bg = 30;
|
|
3489
3486
|
var leftAndRightSpaces = 50;
|
|
@@ -3495,9 +3492,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3495
3492
|
data = this.chartData.data;
|
|
3496
3493
|
metaData = this.chartData.metaData;
|
|
3497
3494
|
lineData = this.chartData.lineData;
|
|
3498
|
-
// if (lineData || this.chartData.targetLineData) {
|
|
3499
|
-
// rightSvgWidth = 60;
|
|
3500
|
-
// }
|
|
3501
3495
|
if (!metaData.colorAboveTarget) {
|
|
3502
3496
|
metaData['colorAboveTarget'] = metaData.colors;
|
|
3503
3497
|
}
|
|
@@ -3534,16 +3528,10 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3534
3528
|
else
|
|
3535
3529
|
width = this.chartData.data.length * 160;
|
|
3536
3530
|
}
|
|
3537
|
-
// if (this.chartData.data.length > 8) {
|
|
3538
|
-
// width = this.chartData.data.length * 140;
|
|
3539
|
-
// }
|
|
3540
3531
|
var height = parseInt(verticalstackedcontainer.style('height')) *
|
|
3541
3532
|
(self.chartConfiguration.svgHeight / 100) -
|
|
3542
3533
|
margin.top -
|
|
3543
3534
|
margin.bottom;
|
|
3544
|
-
/**
|
|
3545
|
-
* entire height used in weekly charts as x axis needed to be displayed at the bottom of the chart
|
|
3546
|
-
*/
|
|
3547
3535
|
if (this.chartConfiguration.isFullScreen != undefined &&
|
|
3548
3536
|
this.chartConfiguration.isFullScreen) {
|
|
3549
3537
|
height =
|
|
@@ -3565,30 +3553,15 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3565
3553
|
margin.bottom -
|
|
3566
3554
|
100;
|
|
3567
3555
|
}
|
|
3568
|
-
/**
|
|
3569
|
-
* for hiding header
|
|
3570
|
-
* used by weekly charts
|
|
3571
|
-
*/
|
|
3572
3556
|
if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
3573
3557
|
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
3574
|
-
/**
|
|
3575
|
-
* for hiding legends
|
|
3576
|
-
* used by weekly charts
|
|
3577
|
-
*/
|
|
3578
3558
|
if (this.chartConfiguration.legendVisible != undefined) {
|
|
3579
3559
|
this.legendVisible = this.chartConfiguration.legendVisible;
|
|
3580
3560
|
}
|
|
3581
|
-
/**
|
|
3582
|
-
* for removing background color so that it can take parents color
|
|
3583
|
-
*
|
|
3584
|
-
*/
|
|
3585
3561
|
if (this.chartConfiguration.isTransparentBackground != undefined) {
|
|
3586
3562
|
this.isTransparentBackground =
|
|
3587
3563
|
this.chartConfiguration.isTransparentBackground;
|
|
3588
3564
|
}
|
|
3589
|
-
/**
|
|
3590
|
-
* format data values based on configuration received
|
|
3591
|
-
*/
|
|
3592
3565
|
if (this.chartConfiguration.textFormatter != undefined) {
|
|
3593
3566
|
formatFromBackend = ChartHelper.dataValueFormatter(this.chartConfiguration.textFormatter);
|
|
3594
3567
|
formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
@@ -3601,7 +3574,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3601
3574
|
.style('height', height)
|
|
3602
3575
|
.style('overflow-x', 'hidden')
|
|
3603
3576
|
.style('padding-left', `${margin.left}px`)
|
|
3604
|
-
// .call(ChartHelper.responsivefy)
|
|
3605
3577
|
.style('padding-right', `${rightSvgWidth}px`)
|
|
3606
3578
|
.style('margin-left', '15px');
|
|
3607
3579
|
var svgYAxisLeft = outerContainer
|
|
@@ -3629,10 +3601,8 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3629
3601
|
.style('overflow-x', 'auto');
|
|
3630
3602
|
var svg = innerContainer
|
|
3631
3603
|
.append('svg')
|
|
3632
|
-
// .attr('id', self.uniqueId)
|
|
3633
3604
|
.attr('width', width - rightSvgWidth)
|
|
3634
3605
|
.attr('height', height + margin.top + margin.bottom + 30)
|
|
3635
|
-
// .call(ChartHelper.responsivefy)
|
|
3636
3606
|
.append('g')
|
|
3637
3607
|
.attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
|
|
3638
3608
|
var subgroups = keyList;
|
|
@@ -3641,9 +3611,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3641
3611
|
return d.name;
|
|
3642
3612
|
})
|
|
3643
3613
|
.keys();
|
|
3644
|
-
/**
|
|
3645
|
-
* x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
|
|
3646
|
-
*/
|
|
3647
3614
|
if (this.chartConfiguration.isMultiChartGridLine != undefined) {
|
|
3648
3615
|
x = d3
|
|
3649
3616
|
.scaleBand()
|
|
@@ -3661,27 +3628,11 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3661
3628
|
.range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
3662
3629
|
.padding([0.3]);
|
|
3663
3630
|
}
|
|
3664
|
-
// x.bandwidth(96);
|
|
3665
3631
|
var xScaleFromOrigin = d3
|
|
3666
3632
|
.scaleBand()
|
|
3667
3633
|
.domain(groups)
|
|
3668
3634
|
.range([0, width - rightSvgWidth]);
|
|
3669
|
-
// .padding([0.2]);
|
|
3670
|
-
/**
|
|
3671
|
-
* draw second x axis on top
|
|
3672
|
-
*/
|
|
3673
|
-
// if (self.chartConfiguration.showXaxisTop) {
|
|
3674
|
-
// svg
|
|
3675
|
-
// .append('g')
|
|
3676
|
-
// .attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
3677
|
-
// .attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
3678
|
-
// .call(d3.axisBottom(x).tickSize(0));
|
|
3679
|
-
// }
|
|
3680
|
-
// d3.svg.axis().scale(x).orient('bottom').ticks(1).innerTickSize(-height);
|
|
3681
3635
|
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
3682
|
-
/**
|
|
3683
|
-
* normal ticks for all dashboard charts
|
|
3684
|
-
*/
|
|
3685
3636
|
svg
|
|
3686
3637
|
.append('g')
|
|
3687
3638
|
.attr('class', 'x1 axis1')
|
|
@@ -3694,7 +3645,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3694
3645
|
.selectAll('g.x1.axis1 g.tick text')
|
|
3695
3646
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
3696
3647
|
.style('fill', 'var(--chart-text-color)')
|
|
3697
|
-
.attr('y', 32);
|
|
3648
|
+
.attr('y', 32);
|
|
3698
3649
|
}
|
|
3699
3650
|
else {
|
|
3700
3651
|
svg
|
|
@@ -3702,32 +3653,14 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3702
3653
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
3703
3654
|
.style('fill', 'var(--chart-text-color)');
|
|
3704
3655
|
}
|
|
3705
|
-
// .attr('y', function () {
|
|
3706
|
-
// if (alternate_text) {
|
|
3707
|
-
// alternate_text = false;
|
|
3708
|
-
// return long_tick_length + 1;
|
|
3709
|
-
// } else {
|
|
3710
|
-
// alternate_text = true;
|
|
3711
|
-
// return short_tick_length + 1;
|
|
3712
|
-
// }
|
|
3713
|
-
// });
|
|
3714
3656
|
}
|
|
3715
3657
|
else {
|
|
3716
|
-
/**
|
|
3717
|
-
* bigger ticks for weekly charts and more space from x axis to labels
|
|
3718
|
-
*/
|
|
3719
|
-
/**
|
|
3720
|
-
* draw x axis
|
|
3721
|
-
*/
|
|
3722
3658
|
svg
|
|
3723
3659
|
.append('g')
|
|
3724
3660
|
.attr('class', 'x1 axis1')
|
|
3725
3661
|
.attr('transform', 'translate(0,' + height + ')')
|
|
3726
3662
|
.call(d3.axisBottom(x).tickSize(0))
|
|
3727
3663
|
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
3728
|
-
/**
|
|
3729
|
-
* tick line size in alternate fashion
|
|
3730
|
-
*/
|
|
3731
3664
|
svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
|
|
3732
3665
|
if (alternate_text &&
|
|
3733
3666
|
self.chartConfiguration.isNoAlternateXaxisText == undefined) {
|
|
@@ -3739,14 +3672,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3739
3672
|
return short_tick_length_bg - 4;
|
|
3740
3673
|
}
|
|
3741
3674
|
});
|
|
3742
|
-
/**
|
|
3743
|
-
* reset the flag so that values can be shown in same alternate fashion
|
|
3744
|
-
*/
|
|
3745
3675
|
alternate_text = false;
|
|
3746
|
-
/**
|
|
3747
|
-
* print x-axis label texts
|
|
3748
|
-
* used by weekly charts
|
|
3749
|
-
*/
|
|
3750
3676
|
svg
|
|
3751
3677
|
.selectAll('g.x1.axis1 g.tick text')
|
|
3752
3678
|
.attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
@@ -3795,7 +3721,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3795
3721
|
return '';
|
|
3796
3722
|
});
|
|
3797
3723
|
}
|
|
3798
|
-
/**y scale for left y axis */
|
|
3799
3724
|
var y = d3.scaleLinear().rangeRound([height, 0]);
|
|
3800
3725
|
var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
|
|
3801
3726
|
if (maxValue == 0) {
|
|
@@ -3806,27 +3731,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3806
3731
|
maxValue = 100;
|
|
3807
3732
|
}
|
|
3808
3733
|
}
|
|
3809
|
-
if (self.chartConfiguration.yAxisGrid) {
|
|
3810
|
-
// svg
|
|
3811
|
-
// .append('g')
|
|
3812
|
-
// .attr('class', 'grid')
|
|
3813
|
-
// .call(
|
|
3814
|
-
// d3
|
|
3815
|
-
// .axisLeft(y)
|
|
3816
|
-
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
3817
|
-
// .tickSize(-width)
|
|
3818
|
-
// .tickFormat('')
|
|
3819
|
-
// )
|
|
3820
|
-
// // .style('stroke-dasharray', '5 5')
|
|
3821
|
-
// .style('color', '#B9B9B9')
|
|
3822
|
-
// .style('opacity', '0.5')
|
|
3823
|
-
// .call((g) => g.select('.domain').remove());
|
|
3824
|
-
}
|
|
3825
3734
|
if (this.chartConfiguration.customYscale) {
|
|
3826
|
-
/**
|
|
3827
|
-
* increase y-scale so that values wont cross or exceed out of range
|
|
3828
|
-
* used in weekly charts
|
|
3829
|
-
*/
|
|
3830
3735
|
maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
3831
3736
|
}
|
|
3832
3737
|
if (this.chartData.targetLineData &&
|
|
@@ -3864,10 +3769,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3864
3769
|
.tickSize(0)
|
|
3865
3770
|
.tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
3866
3771
|
}
|
|
3867
|
-
/**
|
|
3868
|
-
* show x-axis grid between labels
|
|
3869
|
-
* used by weekly charts
|
|
3870
|
-
*/
|
|
3871
3772
|
if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
3872
3773
|
svg
|
|
3873
3774
|
.append('g')
|
|
@@ -3879,9 +3780,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3879
3780
|
.call((g) => g.select('.domain').remove());
|
|
3880
3781
|
}
|
|
3881
3782
|
if (this.chartConfiguration.yAxisGrid) {
|
|
3882
|
-
/**
|
|
3883
|
-
* draw y axis
|
|
3884
|
-
*/
|
|
3885
3783
|
svg
|
|
3886
3784
|
.append('g')
|
|
3887
3785
|
.call(d3
|
|
@@ -3905,22 +3803,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3905
3803
|
xSubgroup.range([0, x.bandwidth()]);
|
|
3906
3804
|
}
|
|
3907
3805
|
else {
|
|
3908
|
-
/**
|
|
3909
|
-
* used to make grouped bars with lesser width as we are not using padding for width
|
|
3910
|
-
* used by weekly charts
|
|
3911
|
-
*/
|
|
3912
3806
|
xSubgroup.range([0, x.bandwidth()]);
|
|
3913
3807
|
}
|
|
3914
|
-
// if (this.chartConfiguration.isDrilldownChart) {
|
|
3915
|
-
// }
|
|
3916
3808
|
var color = d3
|
|
3917
3809
|
.scaleOrdinal()
|
|
3918
3810
|
.domain(subgroups)
|
|
3919
3811
|
.range(Object.values(metaData.colors));
|
|
3920
|
-
// var colorAboveTarget = d3
|
|
3921
|
-
// .scaleOrdinal()
|
|
3922
|
-
// .domain(subgroups)
|
|
3923
|
-
// .range(Object.values(metaData.colorAboveTarget));
|
|
3924
3812
|
var state = svg
|
|
3925
3813
|
.append('g')
|
|
3926
3814
|
.selectAll('.state')
|
|
@@ -3935,10 +3823,8 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3935
3823
|
.data(function (d) {
|
|
3936
3824
|
let newList = [];
|
|
3937
3825
|
subgroups.map(function (key) {
|
|
3938
|
-
// if (key !== "group") {
|
|
3939
3826
|
let obj = { key: key, value: d[key], name: d.name };
|
|
3940
3827
|
newList.push(obj);
|
|
3941
|
-
// }
|
|
3942
3828
|
});
|
|
3943
3829
|
return newList;
|
|
3944
3830
|
})
|
|
@@ -3951,7 +3837,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3951
3837
|
!metaData.barWithoutClick.length ||
|
|
3952
3838
|
(!metaData.barWithoutClick.includes(d?.name) &&
|
|
3953
3839
|
!metaData.barWithoutClick.includes(d?.key)))
|
|
3954
|
-
// self.handleClick(d.data.name);
|
|
3955
3840
|
self.handleClick(d);
|
|
3956
3841
|
}
|
|
3957
3842
|
})
|
|
@@ -3968,14 +3853,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3968
3853
|
0 + (x.bandwidth() - 200) / 2,
|
|
3969
3854
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
3970
3855
|
]);
|
|
3971
|
-
// .padding(0.05);
|
|
3972
3856
|
}
|
|
3973
3857
|
else
|
|
3974
3858
|
tempScale.range([
|
|
3975
3859
|
0 + (x.bandwidth() - 300) / 2,
|
|
3976
3860
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
3977
3861
|
]);
|
|
3978
|
-
// .padding(0.05);
|
|
3979
3862
|
}
|
|
3980
3863
|
else
|
|
3981
3864
|
tempScale.range([
|
|
@@ -3994,7 +3877,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3994
3877
|
})
|
|
3995
3878
|
.attr('width', function (d) {
|
|
3996
3879
|
if (self.chartConfiguration.isDrilldownChart) {
|
|
3997
|
-
// var tempScale;
|
|
3998
3880
|
data.map((indiv) => {
|
|
3999
3881
|
if (indiv.name == d.name) {
|
|
4000
3882
|
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
@@ -4007,14 +3889,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4007
3889
|
0 + (x.bandwidth() - 200) / 2,
|
|
4008
3890
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4009
3891
|
]);
|
|
4010
|
-
// .padding(0.05);
|
|
4011
3892
|
}
|
|
4012
3893
|
else
|
|
4013
3894
|
tempScale.range([
|
|
4014
3895
|
0 + (x.bandwidth() - 300) / 2,
|
|
4015
3896
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4016
3897
|
]);
|
|
4017
|
-
// .padding(0.05);
|
|
4018
3898
|
}
|
|
4019
3899
|
else
|
|
4020
3900
|
tempScale.range([
|
|
@@ -4036,7 +3916,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4036
3916
|
return height - y(d.value);
|
|
4037
3917
|
return height - y(0);
|
|
4038
3918
|
})
|
|
4039
|
-
// .style('cursor', 'pointer')
|
|
4040
3919
|
.style('cursor', function (d) {
|
|
4041
3920
|
if (metaData.hasDrillDown && !isria)
|
|
4042
3921
|
return 'pointer';
|
|
@@ -4051,9 +3930,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4051
3930
|
return self.chartData.metaData.colorAboveTarget[d.key];
|
|
4052
3931
|
return self.chartData.metaData.colors[d.key];
|
|
4053
3932
|
});
|
|
4054
|
-
/**
|
|
4055
|
-
* display angled texts on the bars
|
|
4056
|
-
*/
|
|
4057
3933
|
if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
|
|
4058
3934
|
state
|
|
4059
3935
|
.selectAll('text')
|
|
@@ -4114,14 +3990,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4114
3990
|
0 + (x.bandwidth() - 200) / 2,
|
|
4115
3991
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4116
3992
|
]);
|
|
4117
|
-
// .padding(0.05);
|
|
4118
3993
|
}
|
|
4119
3994
|
else
|
|
4120
3995
|
tempScale.range([
|
|
4121
3996
|
0 + (x.bandwidth() - 300) / 2,
|
|
4122
3997
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4123
3998
|
]);
|
|
4124
|
-
// .padding(0.05);
|
|
4125
3999
|
}
|
|
4126
4000
|
else
|
|
4127
4001
|
tempScale.range([
|
|
@@ -4131,16 +4005,9 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4131
4005
|
}
|
|
4132
4006
|
}
|
|
4133
4007
|
});
|
|
4134
|
-
/**
|
|
4135
|
-
* if set, then all texts ll be horizontal
|
|
4136
|
-
*/
|
|
4137
4008
|
if (self.chartConfiguration.textAlwaysHorizontal) {
|
|
4138
4009
|
return ('translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')');
|
|
4139
4010
|
}
|
|
4140
|
-
/**
|
|
4141
|
-
* rotate texts having more than one digits
|
|
4142
|
-
*/
|
|
4143
|
-
// if (d.value > 9)
|
|
4144
4011
|
if (!isNaN(tempScale(d.key)))
|
|
4145
4012
|
return ('translate(' +
|
|
4146
4013
|
(tempScale(d.key) + tempScale.bandwidth() * 0.55) +
|
|
@@ -4148,14 +4015,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4148
4015
|
(y(0) - 10) +
|
|
4149
4016
|
') rotate(270)');
|
|
4150
4017
|
return 'translate(0,0)';
|
|
4151
|
-
// else
|
|
4152
|
-
// return (
|
|
4153
|
-
// 'translate(' +
|
|
4154
|
-
// (tempScale(d.key) + tempScale.bandwidth() / 2) +
|
|
4155
|
-
// ',' +
|
|
4156
|
-
// y(0) +
|
|
4157
|
-
// ')'
|
|
4158
|
-
// );
|
|
4159
4018
|
})
|
|
4160
4019
|
.on('click', function (d) {
|
|
4161
4020
|
if (!metaData.barWithoutClick ||
|
|
@@ -4184,7 +4043,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4184
4043
|
svg
|
|
4185
4044
|
.append('foreignObject')
|
|
4186
4045
|
.attr('x', function () {
|
|
4187
|
-
// var tempScale;
|
|
4188
4046
|
var elementsCounter;
|
|
4189
4047
|
data.map((indiv) => {
|
|
4190
4048
|
if (indiv.name == d.name) {
|
|
@@ -4198,14 +4056,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4198
4056
|
0 + (x.bandwidth() - 200) / 2,
|
|
4199
4057
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4200
4058
|
]);
|
|
4201
|
-
// .padding(0.05);
|
|
4202
4059
|
}
|
|
4203
4060
|
else
|
|
4204
4061
|
tempScale.range([
|
|
4205
4062
|
0 + (x.bandwidth() - 300) / 2,
|
|
4206
4063
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4207
4064
|
]);
|
|
4208
|
-
// .padding(0.05);
|
|
4209
4065
|
}
|
|
4210
4066
|
else
|
|
4211
4067
|
tempScale.range([
|
|
@@ -4235,7 +4091,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4235
4091
|
return d.class;
|
|
4236
4092
|
})
|
|
4237
4093
|
.attr('width', function () {
|
|
4238
|
-
// var tempScale;
|
|
4239
4094
|
data.map((indiv) => {
|
|
4240
4095
|
if (indiv.name == d.name) {
|
|
4241
4096
|
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
@@ -4247,14 +4102,12 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4247
4102
|
0 + (x.bandwidth() - 200) / 2,
|
|
4248
4103
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4249
4104
|
]);
|
|
4250
|
-
// .padding(0.05);
|
|
4251
4105
|
}
|
|
4252
4106
|
else
|
|
4253
4107
|
tempScale.range([
|
|
4254
4108
|
0 + (x.bandwidth() - 300) / 2,
|
|
4255
4109
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4256
4110
|
]);
|
|
4257
|
-
// .padding(0.05);
|
|
4258
4111
|
}
|
|
4259
4112
|
else
|
|
4260
4113
|
tempScale.range([
|
|
@@ -4341,35 +4194,18 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4341
4194
|
.attr('transform', 'translate(0,0)')
|
|
4342
4195
|
.call(y)
|
|
4343
4196
|
.style('display', 'none');
|
|
4344
|
-
/**
|
|
4345
|
-
* hide x axis labels
|
|
4346
|
-
* config is there for future use
|
|
4347
|
-
* used by weekly charts
|
|
4348
|
-
*/
|
|
4349
4197
|
if (this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
4350
4198
|
this.chartConfiguration.isXaxisLabelHidden) {
|
|
4351
4199
|
d3.selectAll('g.lib-line-x-axis-text > g > text').attr('class', 'lib-display-hidden');
|
|
4352
4200
|
}
|
|
4353
|
-
/**
|
|
4354
|
-
* hide y axis labels
|
|
4355
|
-
* used by weekly charts
|
|
4356
|
-
*/
|
|
4357
4201
|
if (this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
4358
4202
|
this.chartConfiguration.isYaxisLabelHidden) {
|
|
4359
4203
|
d3.selectAll('.yaxis-dashed > g > text').attr('class', 'lib-display-hidden');
|
|
4360
4204
|
}
|
|
4361
|
-
/**
|
|
4362
|
-
* hide y axis labels
|
|
4363
|
-
* config is there for future use
|
|
4364
|
-
*/
|
|
4365
4205
|
if (this.chartConfiguration.isYaxisHidden != undefined &&
|
|
4366
4206
|
this.chartConfiguration.isYaxisHidden) {
|
|
4367
4207
|
d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
|
|
4368
4208
|
}
|
|
4369
|
-
/**
|
|
4370
|
-
* dashed y axis
|
|
4371
|
-
* used by weekly charts
|
|
4372
|
-
*/
|
|
4373
4209
|
if (this.chartConfiguration.isYaxisDashed != undefined &&
|
|
4374
4210
|
this.chartConfiguration.isYaxisDashed) {
|
|
4375
4211
|
d3.selectAll('.yaxis-dashed')
|
|
@@ -4386,17 +4222,11 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4386
4222
|
.call(yLineAxis);
|
|
4387
4223
|
}
|
|
4388
4224
|
}
|
|
4389
|
-
/**
|
|
4390
|
-
* used to display y label
|
|
4391
|
-
*/
|
|
4392
4225
|
if (this.isZoomedOut) {
|
|
4393
4226
|
svg
|
|
4394
4227
|
.selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
4395
4228
|
.attr('class', 'lib-display-hidden');
|
|
4396
4229
|
}
|
|
4397
|
-
/**
|
|
4398
|
-
* used to write y labels based on configuration
|
|
4399
|
-
*/
|
|
4400
4230
|
if (metaData.yLabel) {
|
|
4401
4231
|
svgYAxisLeft
|
|
4402
4232
|
.append('text')
|
|
@@ -4415,9 +4245,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4415
4245
|
.text(metaData.yLabel);
|
|
4416
4246
|
}
|
|
4417
4247
|
else {
|
|
4418
|
-
/**
|
|
4419
|
-
* used by weekly charts
|
|
4420
|
-
*/
|
|
4421
4248
|
svg
|
|
4422
4249
|
.selectAll('.lib-axis-group-label')
|
|
4423
4250
|
.attr('class', 'lib-ylabel-weeklyCharts')
|
|
@@ -4458,13 +4285,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4458
4285
|
.attr('y2', yZero)
|
|
4459
4286
|
.style('stroke-dasharray', '5 5')
|
|
4460
4287
|
.style('stroke', this.chartData.targetLineData.color);
|
|
4461
|
-
// svgYAxisRight
|
|
4462
|
-
// .append('line')
|
|
4463
|
-
// .attr('x1', 0)
|
|
4464
|
-
// .attr('x2', rightSvgWidth)
|
|
4465
|
-
// .attr('y1', yZero)
|
|
4466
|
-
// .attr('y2', yZero)
|
|
4467
|
-
// .style('stroke', this.chartData.targetLineData.color);
|
|
4468
4288
|
svgYAxisRight
|
|
4469
4289
|
.append('foreignObject')
|
|
4470
4290
|
.attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
|
|
@@ -4492,13 +4312,6 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4492
4312
|
});
|
|
4493
4313
|
}
|
|
4494
4314
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
4495
|
-
/**
|
|
4496
|
-
* used by drilldown charts
|
|
4497
|
-
*/
|
|
4498
|
-
// svg
|
|
4499
|
-
// .selectAll('.lib-axis-group-label')
|
|
4500
|
-
// .attr('class', 'lib-ylabel-drilldowncharts')
|
|
4501
|
-
// .text(metaData.yLabel.toLowerCase());
|
|
4502
4315
|
svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
|
|
4503
4316
|
}
|
|
4504
4317
|
if (metaData.lineyLabel) {
|
|
@@ -6825,6 +6638,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6825
6638
|
this.isTopCaptionVisible = true;
|
|
6826
6639
|
this.uniqueId = this.getUniqueId();
|
|
6827
6640
|
this.isTransparentBackground = false;
|
|
6641
|
+
this.isCC = false;
|
|
6642
|
+
this.isZoomedOut = true;
|
|
6643
|
+
this.TICK_LENGTHS = {
|
|
6644
|
+
short: 4,
|
|
6645
|
+
long: 16,
|
|
6646
|
+
shortBg: 5,
|
|
6647
|
+
longBg: 30,
|
|
6648
|
+
};
|
|
6649
|
+
this.SPACING = {
|
|
6650
|
+
rightSvgWidth: 60,
|
|
6651
|
+
leftAndRight: 50,
|
|
6652
|
+
};
|
|
6828
6653
|
this.defaultConfiguration = {
|
|
6829
6654
|
margin: { top: 20, right: 20, bottom: 20, left: 40 },
|
|
6830
6655
|
svgHeight: 70,
|
|
@@ -6840,83 +6665,38 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6840
6665
|
forComparison: true,
|
|
6841
6666
|
headerMenuOptions: HeaderConfigHelper.headerConfig.headerMenuOptions,
|
|
6842
6667
|
yAxisGrid: false,
|
|
6843
|
-
isHeaderVisible: undefined,
|
|
6844
|
-
isTransparentBackground: undefined,
|
|
6845
|
-
isTopCaptionVisible: undefined,
|
|
6846
|
-
isMultiChartGridLine: undefined,
|
|
6847
|
-
isFullScreen: undefined,
|
|
6848
|
-
customYscale: undefined,
|
|
6849
|
-
isXaxisLabelHidden: undefined,
|
|
6850
|
-
isYaxisLabelHidden: undefined,
|
|
6851
|
-
isYaxisHidden: undefined,
|
|
6852
|
-
isYaxisDashed: undefined,
|
|
6853
|
-
isXaxisColor: undefined,
|
|
6854
|
-
textFormatter: undefined,
|
|
6855
|
-
showTotalOnTop: undefined,
|
|
6856
|
-
backendFormatterHasPriority: undefined,
|
|
6857
|
-
showAngledLabels: undefined,
|
|
6858
|
-
isNoAlternateXaxisText: undefined,
|
|
6859
|
-
isXgridBetweenLabels: undefined,
|
|
6860
|
-
showXaxisTop: undefined,
|
|
6861
|
-
xAxisGrid: undefined,
|
|
6862
|
-
xLabelsOnSameLine: undefined,
|
|
6863
|
-
hideXaxisTick: undefined,
|
|
6864
|
-
isDrilldownChart: undefined,
|
|
6865
|
-
isTargetLine: undefined,
|
|
6866
|
-
displayTitleOnTop: undefined,
|
|
6867
|
-
isToggleVisible: undefined,
|
|
6868
|
-
isTitleHidden: undefined,
|
|
6869
6668
|
};
|
|
6870
|
-
|
|
6871
|
-
|
|
6669
|
+
}
|
|
6670
|
+
ngOnInit() { }
|
|
6671
|
+
ngOnChanges(changes) {
|
|
6672
|
+
this.redrawChart();
|
|
6673
|
+
}
|
|
6674
|
+
onResized(event) {
|
|
6675
|
+
setTimeout(() => this.redrawChart(), 10);
|
|
6872
6676
|
}
|
|
6873
6677
|
isZoomOutSelected(isZoomOut) {
|
|
6874
6678
|
this.isZoomedOut = isZoomOut;
|
|
6875
|
-
this.
|
|
6679
|
+
this.redrawChart();
|
|
6876
6680
|
}
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
d3.select('#' + self.uniqueId).remove();
|
|
6681
|
+
redrawChart() {
|
|
6682
|
+
d3.select('#' + this.uniqueId).remove();
|
|
6880
6683
|
this.initializeStackedChart();
|
|
6881
6684
|
}
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6685
|
+
getDeviceBreakpoints() {
|
|
6686
|
+
const width = window.innerWidth;
|
|
6687
|
+
return {
|
|
6688
|
+
isMobile: width < 576,
|
|
6689
|
+
isTablet: width >= 576 && width < 992,
|
|
6690
|
+
isDesktop: width >= 992,
|
|
6691
|
+
};
|
|
6888
6692
|
}
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
var self = this;
|
|
6892
|
-
let data = [];
|
|
6893
|
-
let metaData = null;
|
|
6894
|
-
let keyList = null;
|
|
6895
|
-
let lineData = null;
|
|
6896
|
-
let colors = null;
|
|
6897
|
-
var alternate_text = false;
|
|
6898
|
-
var alternate_label = false;
|
|
6899
|
-
var short_tick_length = 4;
|
|
6900
|
-
var long_tick_length = 16;
|
|
6901
|
-
var short_tick_length_bg = 5;
|
|
6902
|
-
var long_tick_length_bg = 30;
|
|
6903
|
-
var formatFromBackend;
|
|
6904
|
-
var formatForHugeNumbers;
|
|
6905
|
-
var tempObjectHolder = {};
|
|
6906
|
-
var rightSvgWidth = 60;
|
|
6907
|
-
var leftAndRightSpaces = 50;
|
|
6908
|
-
let isria = this.customChartConfiguration.isRia;
|
|
6909
|
-
// Responsive breakpoints
|
|
6910
|
-
const isMobile = window.innerWidth < 576;
|
|
6911
|
-
const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
|
|
6912
|
-
const isDesktop = window.innerWidth >= 992;
|
|
6913
|
-
// Adjust margins and font sizes based on device
|
|
6914
|
-
if (isMobile) {
|
|
6693
|
+
applyResponsiveConfig(device) {
|
|
6694
|
+
if (device.isMobile) {
|
|
6915
6695
|
this.chartConfiguration.margin = { top: 20, right: 10, bottom: 40, left: 30 };
|
|
6916
6696
|
this.chartConfiguration.numberOfYTicks = 4;
|
|
6917
6697
|
this.chartConfiguration.svgHeight = 60;
|
|
6918
6698
|
}
|
|
6919
|
-
else if (isTablet) {
|
|
6699
|
+
else if (device.isTablet) {
|
|
6920
6700
|
this.chartConfiguration.margin = { top: 25, right: 20, bottom: 45, left: 40 };
|
|
6921
6701
|
this.chartConfiguration.numberOfYTicks = 6;
|
|
6922
6702
|
this.chartConfiguration.svgHeight = 70;
|
|
@@ -6926,102 +6706,199 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6926
6706
|
this.chartConfiguration.numberOfYTicks = 7;
|
|
6927
6707
|
this.chartConfiguration.svgHeight = 80;
|
|
6928
6708
|
}
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6709
|
+
}
|
|
6710
|
+
mergeConfigurations() {
|
|
6711
|
+
Object.keys(this.defaultConfiguration).forEach((key) => {
|
|
6712
|
+
this.chartConfiguration[key] = ChartHelper.getValueByConfigurationType(key, this.defaultConfiguration, this.customChartConfiguration);
|
|
6713
|
+
});
|
|
6714
|
+
}
|
|
6715
|
+
prepareMetaData(metaData) {
|
|
6716
|
+
if (!metaData.unit)
|
|
6935
6717
|
metaData.unit = '';
|
|
6936
|
-
if (metaData.isCC)
|
|
6718
|
+
if (metaData.isCC)
|
|
6937
6719
|
this.isCC = metaData.isCC;
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
metaData.barWithoutClick = metaData.barWithoutClick.map((ele) => ele.toLowerCase());
|
|
6720
|
+
if (metaData.barWithoutClick?.length) {
|
|
6721
|
+
metaData.barWithoutClick = metaData.barWithoutClick.map(el => el.toLowerCase());
|
|
6941
6722
|
}
|
|
6942
6723
|
else {
|
|
6943
6724
|
metaData.barWithoutClick = [];
|
|
6944
6725
|
}
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
if (
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6726
|
+
return metaData;
|
|
6727
|
+
}
|
|
6728
|
+
parseTargetValue(targetLineData) {
|
|
6729
|
+
if (!targetLineData?.target)
|
|
6730
|
+
return null;
|
|
6731
|
+
const parsedNum = parseFloat(String(targetLineData.target));
|
|
6732
|
+
if (isNaN(parsedNum))
|
|
6733
|
+
return null;
|
|
6734
|
+
return Number.isInteger(parsedNum)
|
|
6735
|
+
? parseInt(String(targetLineData.target))
|
|
6736
|
+
: parsedNum;
|
|
6737
|
+
}
|
|
6738
|
+
calculateDimensions(containerWidth, containerHeight, margin, device) {
|
|
6739
|
+
let width = containerWidth - margin.left - margin.right;
|
|
6740
|
+
let height = containerHeight * (this.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
|
|
6741
|
+
// Adjust width for zoom levels
|
|
6742
|
+
const dataLength = this.chartData.data.length;
|
|
6743
|
+
if (dataLength > 30 && this.isZoomedOut) {
|
|
6744
|
+
const minWidth = dataLength * (device.isMobile ? 15 : 25);
|
|
6745
|
+
width = Math.max(width, minWidth);
|
|
6746
|
+
}
|
|
6747
|
+
if (dataLength > 8 && !this.isZoomedOut) {
|
|
6748
|
+
width = dataLength * (device.isMobile ? 60 : 130);
|
|
6749
|
+
}
|
|
6750
|
+
// Apply special height configurations
|
|
6751
|
+
if (this.chartConfiguration.isFullScreen && this.chartConfiguration.svgHeight !== 80) {
|
|
6752
|
+
height = this.chartConfiguration.svgHeight;
|
|
6753
|
+
}
|
|
6754
|
+
else if (this.chartConfiguration.isFullScreen) {
|
|
6755
|
+
height = containerHeight;
|
|
6958
6756
|
}
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
var containerWidth = chartContainer.node().getBoundingClientRect().width;
|
|
6962
|
-
var containerHeight = verticalstackedcontainer.node().getBoundingClientRect().height;
|
|
6963
|
-
var width = containerWidth - margin.left - margin.right;
|
|
6964
|
-
var height = containerHeight * (self.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
|
|
6965
|
-
// Adjust width for large datasets and zoom
|
|
6966
|
-
if (this.chartData.data.length > 30 && this.isZoomedOut) {
|
|
6967
|
-
width = width > this.chartData.data.length * (isMobile ? 15 : 25)
|
|
6968
|
-
? width
|
|
6969
|
-
: this.chartData.data.length * (isMobile ? 15 : 25);
|
|
6757
|
+
if (this.chartConfiguration.isDrilldownChart) {
|
|
6758
|
+
height = containerHeight - margin.top - margin.bottom - (device.isMobile ? 60 : 130);
|
|
6970
6759
|
}
|
|
6971
|
-
|
|
6972
|
-
|
|
6760
|
+
return { width, height };
|
|
6761
|
+
}
|
|
6762
|
+
calculateBarDimensions(width, dataLength, device) {
|
|
6763
|
+
let barWidth;
|
|
6764
|
+
let barPadding;
|
|
6765
|
+
let requiredSvgWidth;
|
|
6766
|
+
if (device.isMobile) {
|
|
6767
|
+
const minBarWidth = 32;
|
|
6768
|
+
barWidth = minBarWidth;
|
|
6769
|
+
barPadding = 12;
|
|
6770
|
+
requiredSvgWidth = Math.max(width - this.SPACING.rightSvgWidth, (barWidth + barPadding) * dataLength + this.SPACING.leftAndRight * 2 +
|
|
6771
|
+
this.SPACING.rightSvgWidth - barPadding);
|
|
6973
6772
|
}
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
: containerHeight;
|
|
6773
|
+
else {
|
|
6774
|
+
barWidth = Math.max(40, (width - this.SPACING.rightSvgWidth - this.SPACING.leftAndRight * 2) / dataLength);
|
|
6775
|
+
barPadding = 0;
|
|
6776
|
+
requiredSvgWidth = width - this.SPACING.rightSvgWidth;
|
|
6979
6777
|
}
|
|
6980
|
-
|
|
6981
|
-
|
|
6778
|
+
return { barWidth, barPadding, requiredSvgWidth };
|
|
6779
|
+
}
|
|
6780
|
+
createScales(data, height, width, device) {
|
|
6781
|
+
const xScale = d3
|
|
6782
|
+
.scaleBand()
|
|
6783
|
+
.rangeRound([
|
|
6784
|
+
this.SPACING.leftAndRight,
|
|
6785
|
+
width - this.SPACING.rightSvgWidth - this.SPACING.leftAndRight
|
|
6786
|
+
])
|
|
6787
|
+
.domain(data.map(d => d.name).reverse())
|
|
6788
|
+
.padding(device.isMobile ? 0.2 : 0.5);
|
|
6789
|
+
const yScale = d3.scaleLinear().rangeRound([height, 0]);
|
|
6790
|
+
return { xScale, yScale };
|
|
6791
|
+
}
|
|
6792
|
+
calculateYScaleDomain(layers, targetValue) {
|
|
6793
|
+
let maxValue = d3.max(layers, (d) => d3.max(d, (d) => d[1])) || 0;
|
|
6794
|
+
if (maxValue === 0) {
|
|
6795
|
+
maxValue = targetValue ? targetValue + 20 : 100;
|
|
6982
6796
|
}
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6797
|
+
if (this.chartConfiguration.customYscale) {
|
|
6798
|
+
maxValue *= this.chartConfiguration.customYscale;
|
|
6799
|
+
}
|
|
6800
|
+
if (targetValue && maxValue < targetValue) {
|
|
6801
|
+
maxValue = maxValue < 10 && targetValue < 10
|
|
6802
|
+
? targetValue + 3
|
|
6803
|
+
: targetValue + 20;
|
|
6804
|
+
}
|
|
6805
|
+
return maxValue;
|
|
6806
|
+
}
|
|
6807
|
+
shouldShowTargetLineColor(d, targetValue) {
|
|
6808
|
+
return !!(!isNaN(d[0]) &&
|
|
6809
|
+
!isNaN(d[1]) &&
|
|
6810
|
+
this.chartData.targetLineData &&
|
|
6811
|
+
targetValue &&
|
|
6812
|
+
parseFloat(d[1]) - parseFloat(d[0]) >= targetValue);
|
|
6813
|
+
}
|
|
6814
|
+
getBarFillColor(d, key, metaData, targetValue) {
|
|
6815
|
+
if (this.shouldShowTargetLineColor(d, targetValue)) {
|
|
6816
|
+
return this.chartData.targetLineData?.barAboveTargetColor || metaData.colors[key];
|
|
6817
|
+
}
|
|
6818
|
+
return metaData.colors[key];
|
|
6819
|
+
}
|
|
6820
|
+
isAcronym(label) {
|
|
6821
|
+
const alphaOnly = label.replace(/[^A-Za-z]/g, '');
|
|
6822
|
+
return (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
|
|
6823
|
+
(label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
6824
|
+
}
|
|
6825
|
+
formatAxisLabel(text) {
|
|
6826
|
+
const isAcr = this.isAcronym(text);
|
|
6827
|
+
return {
|
|
6828
|
+
formatted: isAcr ? text.toUpperCase() : text.toLowerCase(),
|
|
6829
|
+
isAcronym: isAcr
|
|
6830
|
+
};
|
|
6831
|
+
}
|
|
6832
|
+
initializeStackedChart() {
|
|
6833
|
+
const device = this.getDeviceBreakpoints();
|
|
6834
|
+
this.applyResponsiveConfig(device);
|
|
6835
|
+
this.mergeConfigurations();
|
|
6836
|
+
const { data, metaData, lineData } = this.chartData;
|
|
6837
|
+
const preparedMetaData = this.prepareMetaData(metaData);
|
|
6838
|
+
const targetValue = this.parseTargetValue(this.chartData.targetLineData);
|
|
6839
|
+
const chartContainer = d3.select(this.containerElt.nativeElement);
|
|
6840
|
+
const verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
|
|
6841
|
+
const margin = this.chartConfiguration.margin;
|
|
6842
|
+
const containerWidth = chartContainer.node().getBoundingClientRect().width;
|
|
6843
|
+
const containerHeight = verticalstackedcontainer.node().getBoundingClientRect().height;
|
|
6844
|
+
const { width, height } = this.calculateDimensions(containerWidth, containerHeight, margin, device);
|
|
6845
|
+
// Apply visibility configurations
|
|
6846
|
+
if (this.chartConfiguration.isHeaderVisible !== undefined) {
|
|
6989
6847
|
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
6990
6848
|
}
|
|
6991
|
-
|
|
6992
|
-
* for hiding legends
|
|
6993
|
-
* used by weekly charts
|
|
6994
|
-
*/
|
|
6995
|
-
if (this.chartConfiguration.isTopCaptionVisible != undefined) {
|
|
6996
|
-
//UPDATENAME
|
|
6849
|
+
if (this.chartConfiguration.isTopCaptionVisible !== undefined) {
|
|
6997
6850
|
this.isTopCaptionVisible = this.chartConfiguration.isTopCaptionVisible;
|
|
6998
6851
|
}
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
this.
|
|
7005
|
-
|
|
6852
|
+
if (this.chartConfiguration.isTransparentBackground !== undefined) {
|
|
6853
|
+
this.isTransparentBackground = this.chartConfiguration.isTransparentBackground;
|
|
6854
|
+
}
|
|
6855
|
+
// Create formatters
|
|
6856
|
+
const formatFromBackend = this.chartConfiguration.textFormatter
|
|
6857
|
+
? ChartHelper.dataValueFormatter(this.chartConfiguration.textFormatter)
|
|
6858
|
+
: null;
|
|
6859
|
+
const formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
6860
|
+
// Create SVG containers
|
|
6861
|
+
const { barWidth, barPadding, requiredSvgWidth } = this.calculateBarDimensions(width, data.length, device);
|
|
6862
|
+
const outerContainer = this.createOuterContainer(chartContainer, height, margin);
|
|
6863
|
+
const { svgYAxisLeft, svgYAxisRight } = this.createAxisContainers(outerContainer, height, margin);
|
|
6864
|
+
const { innerContainer, svg } = this.createInnerContainer(outerContainer, requiredSvgWidth, height, margin, device);
|
|
6865
|
+
// Create scales
|
|
6866
|
+
const { xScale, yScale } = this.createScales(data, height, width, device);
|
|
6867
|
+
// Stack data
|
|
6868
|
+
const stack = d3
|
|
6869
|
+
.stack()
|
|
6870
|
+
.keys(preparedMetaData.keyList)
|
|
6871
|
+
.offset(d3.stackOffsetNone);
|
|
6872
|
+
const layers = stack(data);
|
|
6873
|
+
// Set Y scale domain
|
|
6874
|
+
const maxValue = this.calculateYScaleDomain(layers, targetValue || undefined);
|
|
6875
|
+
yScale.domain([0, maxValue]).nice();
|
|
6876
|
+
// Render chart elements
|
|
6877
|
+
this.renderGrids(svg, xScale, yScale, height, width);
|
|
6878
|
+
this.renderBars(svg, layers, xScale, yScale, preparedMetaData, device, barWidth, barPadding, targetValue, formatFromBackend, formatForHugeNumbers);
|
|
6879
|
+
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, xScale, yScale, data, height, width, device);
|
|
6880
|
+
this.renderLabels(svg, svgYAxisLeft, preparedMetaData, height, width, margin);
|
|
6881
|
+
if (this.chartData.targetLineData && targetValue) {
|
|
6882
|
+
this.renderTargetLine(svg, svgYAxisRight, yScale, width, targetValue, preparedMetaData);
|
|
7006
6883
|
}
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
*/
|
|
7010
|
-
if (this.chartConfiguration.textFormatter != undefined) {
|
|
7011
|
-
formatFromBackend = ChartHelper.dataValueFormatter(this.chartConfiguration.textFormatter);
|
|
7012
|
-
formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
6884
|
+
if (lineData) {
|
|
6885
|
+
this.renderLineChart(svg, lineData, xScale, height, preparedMetaData.colors);
|
|
7013
6886
|
}
|
|
7014
|
-
|
|
6887
|
+
}
|
|
6888
|
+
createOuterContainer(chartContainer, height, margin) {
|
|
6889
|
+
return chartContainer
|
|
7015
6890
|
.append('div')
|
|
7016
|
-
.attr('id',
|
|
6891
|
+
.attr('id', this.uniqueId)
|
|
7017
6892
|
.attr('class', 'outer-container')
|
|
7018
6893
|
.style('width', '100%')
|
|
7019
6894
|
.style('height', height)
|
|
7020
6895
|
.style('overflow-x', 'hidden')
|
|
7021
6896
|
.style('padding-left', `${margin.left}px`)
|
|
7022
6897
|
.style('margin-left', '10px')
|
|
7023
|
-
.style('padding-right', `${rightSvgWidth}px`);
|
|
7024
|
-
|
|
6898
|
+
.style('padding-right', `${this.SPACING.rightSvgWidth}px`);
|
|
6899
|
+
}
|
|
6900
|
+
createAxisContainers(outerContainer, height, margin) {
|
|
6901
|
+
const svgYAxisLeft = outerContainer
|
|
7025
6902
|
.append('svg')
|
|
7026
6903
|
.attr('width', '80')
|
|
7027
6904
|
.attr('height', height + margin.top + margin.bottom)
|
|
@@ -7029,1039 +6906,414 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7029
6906
|
.style('left', '0')
|
|
7030
6907
|
.style('z-index', 1)
|
|
7031
6908
|
.append('g')
|
|
7032
|
-
.attr('transform',
|
|
7033
|
-
|
|
6909
|
+
.attr('transform', `translate(${margin.left + 10},${margin.top})`);
|
|
6910
|
+
const svgYAxisRight = outerContainer
|
|
7034
6911
|
.append('svg')
|
|
7035
|
-
.attr('width', rightSvgWidth)
|
|
6912
|
+
.attr('width', this.SPACING.rightSvgWidth)
|
|
7036
6913
|
.attr('height', height + margin.top + margin.bottom)
|
|
7037
6914
|
.style('position', 'absolute')
|
|
7038
6915
|
.style('right', '2px')
|
|
7039
6916
|
.style('z-index', 1)
|
|
7040
6917
|
.append('g')
|
|
7041
|
-
.attr('transform',
|
|
7042
|
-
|
|
6918
|
+
.attr('transform', `translate(0,${margin.top})`);
|
|
6919
|
+
return { svgYAxisLeft, svgYAxisRight };
|
|
6920
|
+
}
|
|
6921
|
+
createInnerContainer(outerContainer, requiredSvgWidth, height, margin, device) {
|
|
6922
|
+
const innerContainer = outerContainer
|
|
7043
6923
|
.append('div')
|
|
7044
6924
|
.attr('class', 'inner-container')
|
|
7045
6925
|
.style('width', '100%')
|
|
7046
|
-
.style('overflow-x', 'auto');
|
|
7047
|
-
|
|
7048
|
-
let barWidth;
|
|
7049
|
-
let barPadding = 12; // px, space between bars on mobile
|
|
7050
|
-
let requiredSvgWidth;
|
|
7051
|
-
if (isMobile) {
|
|
7052
|
-
// Use a minimum width per bar and add padding between bars
|
|
7053
|
-
const minBarWidth = 32; // px, can adjust as needed
|
|
7054
|
-
barWidth = minBarWidth;
|
|
7055
|
-
requiredSvgWidth = Math.max(width - rightSvgWidth, (barWidth + barPadding) * data.length + leftAndRightSpaces * 2 + rightSvgWidth - barPadding // no padding after last bar
|
|
7056
|
-
);
|
|
7057
|
-
innerContainer.style('overflow-x', 'auto');
|
|
7058
|
-
}
|
|
7059
|
-
else {
|
|
7060
|
-
barWidth = Math.max(40, (width - rightSvgWidth - leftAndRightSpaces * 2) / data.length);
|
|
7061
|
-
barPadding = 0;
|
|
7062
|
-
requiredSvgWidth = width - rightSvgWidth;
|
|
7063
|
-
}
|
|
7064
|
-
var svg = innerContainer
|
|
6926
|
+
.style('overflow-x', device.isMobile ? 'auto' : 'auto');
|
|
6927
|
+
const svg = innerContainer
|
|
7065
6928
|
.append('svg')
|
|
7066
6929
|
.attr('width', requiredSvgWidth)
|
|
7067
6930
|
.attr('height', height + margin.top + margin.bottom + 30)
|
|
7068
6931
|
.append('g')
|
|
7069
|
-
.attr('transform',
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
/*.order(d3.stackOrder)*/
|
|
7075
|
-
.offset(d3.stackOffsetNone);
|
|
7076
|
-
var layers = stack(data);
|
|
7077
|
-
data.sort(function (a, b) {
|
|
7078
|
-
return b.total - a.total;
|
|
7079
|
-
});
|
|
7080
|
-
let lineYscale;
|
|
7081
|
-
if (lineData != null) {
|
|
7082
|
-
lineYscale = d3
|
|
7083
|
-
.scaleLinear()
|
|
7084
|
-
.domain([
|
|
7085
|
-
0,
|
|
7086
|
-
d3.max(lineData, function (d) {
|
|
7087
|
-
return +d.value;
|
|
7088
|
-
}),
|
|
7089
|
-
])
|
|
7090
|
-
.range([height, 0]);
|
|
7091
|
-
}
|
|
7092
|
-
// Calculate bar width for mobile to avoid overlap
|
|
7093
|
-
// ...barWidth is now calculated above, remove duplicate...
|
|
7094
|
-
var xScale = d3
|
|
7095
|
-
.scaleBand()
|
|
7096
|
-
.rangeRound([
|
|
7097
|
-
leftAndRightSpaces,
|
|
7098
|
-
width - rightSvgWidth - leftAndRightSpaces
|
|
7099
|
-
])
|
|
7100
|
-
.domain(data.map(function (d) {
|
|
7101
|
-
return d.name;
|
|
7102
|
-
}).reverse())
|
|
7103
|
-
.padding(isMobile ? 0.2 : 0.5);
|
|
7104
|
-
var xScaleFromOrigin = d3
|
|
7105
|
-
.scaleBand()
|
|
7106
|
-
.rangeRound([width - rightSvgWidth, 0])
|
|
7107
|
-
.domain(data.map(function (d) {
|
|
7108
|
-
return d.name;
|
|
7109
|
-
}).reverse());
|
|
7110
|
-
// ...existing code...
|
|
7111
|
-
/**
|
|
7112
|
-
* draw second x axis on top
|
|
7113
|
-
*/
|
|
7114
|
-
if (self.chartConfiguration.showXaxisTop) {
|
|
7115
|
-
svg
|
|
7116
|
-
.append('g')
|
|
7117
|
-
.attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
7118
|
-
.attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
7119
|
-
.call(d3.axisBottom(xScale).tickSize(0));
|
|
7120
|
-
svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
7121
|
-
}
|
|
7122
|
-
/**
|
|
7123
|
-
* draw second x axis on top
|
|
7124
|
-
*/
|
|
7125
|
-
// if (self.chartConfiguration.showXaxisAtTarget) {
|
|
7126
|
-
// svg
|
|
7127
|
-
// .append('g')
|
|
7128
|
-
// .attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
7129
|
-
// .attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
7130
|
-
// .call(d3.axisBottom(xScale).tickSize(0));
|
|
7131
|
-
// svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
7132
|
-
// }
|
|
7133
|
-
if (this.chartConfiguration.xAxisGrid) {
|
|
7134
|
-
for (var j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
|
|
7135
|
-
svg
|
|
7136
|
-
.append('g')
|
|
7137
|
-
.attr('class', `x${j + 2} axis${j + 2}`)
|
|
7138
|
-
.style('color', 'var(--chart-grid-color)') // Use CSS variable instead of hardcoded
|
|
7139
|
-
.attr('transform', 'translate(0,' + height * this.chartConfiguration.xAxisGrid[j] + ')')
|
|
7140
|
-
.call(d3.axisBottom(xScale).tickSize(0).ticks(5).tickFormat(''))
|
|
7141
|
-
.style('fill', 'var(--chart-text-color)');
|
|
7142
|
-
}
|
|
7143
|
-
}
|
|
7144
|
-
let yScale = d3.scaleLinear().rangeRound([height, 0]);
|
|
7145
|
-
/**
|
|
7146
|
-
* update max vakues so that the vakue wont exceed the max limit
|
|
7147
|
-
* used by weekly charts
|
|
7148
|
-
*/
|
|
7149
|
-
var maxValue = d3.max(layers, (d) => d3.max(d, (d) => d[1]));
|
|
7150
|
-
if (maxValue == 0) {
|
|
7151
|
-
if (this.chartData.targetLineData) {
|
|
7152
|
-
maxValue = this.chartData.targetLineData.target + 20;
|
|
7153
|
-
}
|
|
7154
|
-
else {
|
|
7155
|
-
maxValue = 100;
|
|
7156
|
-
}
|
|
7157
|
-
}
|
|
7158
|
-
if (this.chartConfiguration.customYscale) {
|
|
7159
|
-
maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
7160
|
-
}
|
|
7161
|
-
if (this.chartData.targetLineData &&
|
|
7162
|
-
maxValue < this.chartData.targetLineData.target) {
|
|
7163
|
-
maxValue =
|
|
7164
|
-
maxValue < 10 && this.chartData.targetLineData.target < 10
|
|
7165
|
-
? this.chartData.targetLineData.target + 3
|
|
7166
|
-
: this.chartData.targetLineData.target + 20;
|
|
7167
|
-
}
|
|
7168
|
-
yScale.domain([0, maxValue]).nice();
|
|
7169
|
-
let xAxis = d3
|
|
7170
|
-
.axisBottom(xScale)
|
|
7171
|
-
.tickSize(0)
|
|
7172
|
-
.tickFormat(self.chartConfiguration.xAxisLabelFomatter);
|
|
7173
|
-
let yAxis = d3
|
|
7174
|
-
.axisLeft(yScale)
|
|
7175
|
-
.ticks(self.chartConfiguration.numberOfYTicks)
|
|
7176
|
-
.tickSize(0)
|
|
7177
|
-
.tickFormat(self.chartConfiguration.yAxisLabelFomatter);
|
|
7178
|
-
let yLineAxis;
|
|
7179
|
-
if (lineYscale != null) {
|
|
7180
|
-
yLineAxis = d3
|
|
7181
|
-
.axisRight(lineYscale)
|
|
7182
|
-
.ticks(self.chartConfiguration.numberOfYTicks)
|
|
7183
|
-
.tickSize(0)
|
|
7184
|
-
.tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
7185
|
-
}
|
|
7186
|
-
/**
|
|
7187
|
-
* between x-axis label used by weekly charts
|
|
7188
|
-
* isXgridBetweenLabels will be undefined for dashboard charts
|
|
7189
|
-
*/
|
|
7190
|
-
if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
6932
|
+
.attr('transform', `translate(0,${margin.top})`);
|
|
6933
|
+
return { innerContainer, svg };
|
|
6934
|
+
}
|
|
6935
|
+
renderGrids(svg, xScale, yScale, height, width) {
|
|
6936
|
+
if (this.chartConfiguration.isXgridBetweenLabels) {
|
|
7191
6937
|
svg
|
|
7192
6938
|
.append('g')
|
|
7193
6939
|
.attr('class', 'grid')
|
|
7194
|
-
.attr('transform',
|
|
6940
|
+
.attr('transform', `translate(${xScale.bandwidth() / 2},${height})`)
|
|
7195
6941
|
.call(d3.axisBottom(xScale).tickSize(-height).tickFormat(''))
|
|
7196
6942
|
.style('stroke-dasharray', '5 5')
|
|
7197
6943
|
.style('color', '#999999')
|
|
7198
|
-
// .style("opacity", "0.5")
|
|
7199
6944
|
.call((g) => g.select('.domain').remove());
|
|
7200
6945
|
}
|
|
7201
|
-
|
|
7202
|
-
* used to draw y-axis grid
|
|
7203
|
-
*/
|
|
7204
|
-
if (self.chartConfiguration.yAxisGrid) {
|
|
6946
|
+
if (this.chartConfiguration.yAxisGrid) {
|
|
7205
6947
|
svg
|
|
7206
6948
|
.append('g')
|
|
7207
6949
|
.attr('class', 'grid')
|
|
7208
6950
|
.call(d3
|
|
7209
6951
|
.axisLeft(yScale)
|
|
7210
|
-
.ticks(
|
|
6952
|
+
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
7211
6953
|
.tickSize(-width)
|
|
7212
6954
|
.tickFormat(''))
|
|
7213
|
-
// Remove hardcoded colors and use CSS variables
|
|
7214
6955
|
.style('color', 'var(--chart-grid-color)')
|
|
7215
6956
|
.style('opacity', '1');
|
|
7216
|
-
// .call((g) => g.select('.domain').remove());
|
|
7217
6957
|
}
|
|
7218
|
-
|
|
6958
|
+
if (this.chartConfiguration.xAxisGrid) {
|
|
6959
|
+
this.chartConfiguration.xAxisGrid.forEach((gridPos, index) => {
|
|
6960
|
+
svg
|
|
6961
|
+
.append('g')
|
|
6962
|
+
.attr('class', `x${index + 2} axis${index + 2}`)
|
|
6963
|
+
.style('color', 'var(--chart-grid-color)')
|
|
6964
|
+
.attr('transform', `translate(0,${height * gridPos})`)
|
|
6965
|
+
.call(d3.axisBottom(xScale).tickSize(0).ticks(5).tickFormat(''))
|
|
6966
|
+
.style('fill', 'var(--chart-text-color)');
|
|
6967
|
+
});
|
|
6968
|
+
}
|
|
6969
|
+
}
|
|
6970
|
+
renderBars(svg, layers, xScale, yScale, metaData, device, barWidth, barPadding, targetValue, formatFromBackend, formatForHugeNumbers) {
|
|
6971
|
+
const layer = svg
|
|
7219
6972
|
.selectAll('.layer')
|
|
7220
6973
|
.data(layers)
|
|
7221
6974
|
.enter()
|
|
7222
6975
|
.append('g')
|
|
7223
6976
|
.attr('class', 'layer')
|
|
7224
|
-
.style('fill',
|
|
7225
|
-
|
|
7226
|
-
});
|
|
7227
|
-
var rect = layer
|
|
7228
|
-
.selectAll('rect')
|
|
7229
|
-
.data(function (d) {
|
|
7230
|
-
return d;
|
|
7231
|
-
})
|
|
7232
|
-
.enter();
|
|
6977
|
+
.style('fill', (d) => metaData.colors[d.key]);
|
|
6978
|
+
const rect = layer.selectAll('rect').data((d) => d).enter();
|
|
7233
6979
|
rect
|
|
7234
6980
|
.append('rect')
|
|
7235
|
-
.on('click',
|
|
7236
|
-
if (!lineData ||
|
|
7237
|
-
if (!metaData.barWithoutClick
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
self.handleClick(d.data.name);
|
|
6981
|
+
.on('click', (d) => {
|
|
6982
|
+
if (!this.chartData.lineData || this.chartConfiguration.forComparison) {
|
|
6983
|
+
if (!metaData.barWithoutClick?.includes(d.data.name.toLowerCase())) {
|
|
6984
|
+
this.handleClick(d.data.name);
|
|
6985
|
+
}
|
|
7241
6986
|
}
|
|
7242
6987
|
})
|
|
7243
|
-
.attr('y',
|
|
6988
|
+
.attr('y', (d) => {
|
|
7244
6989
|
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
7245
6990
|
const actualHeight = yScale(d[0]) - yScale(d[1]);
|
|
7246
6991
|
return actualHeight < 3 ? yScale(d[0]) - 3 : yScale(d[1]);
|
|
7247
6992
|
}
|
|
7248
6993
|
return 0;
|
|
7249
6994
|
})
|
|
7250
|
-
.attr('x',
|
|
7251
|
-
if (isMobile) {
|
|
7252
|
-
|
|
7253
|
-
return leftAndRightSpaces + i * (barWidth + barPadding);
|
|
6995
|
+
.attr('x', (d, i) => {
|
|
6996
|
+
if (device.isMobile) {
|
|
6997
|
+
return this.SPACING.leftAndRight + i * (barWidth + barPadding);
|
|
7254
6998
|
}
|
|
7255
|
-
if (
|
|
6999
|
+
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
7256
7000
|
return xScale(d.data.name);
|
|
7257
7001
|
}
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
self.chartData.data.length <= 3) {
|
|
7261
|
-
return xScale(d.data.name) + xScale.bandwidth() / 2 - 35;
|
|
7262
|
-
}
|
|
7263
|
-
return xScale(d.data.name) + xScale.bandwidth() * 0.1;
|
|
7002
|
+
if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
|
|
7003
|
+
return xScale(d.data.name) + xScale.bandwidth() / 2 - 35;
|
|
7264
7004
|
}
|
|
7005
|
+
return xScale(d.data.name) + xScale.bandwidth() * 0.1;
|
|
7265
7006
|
})
|
|
7266
|
-
.attr('height',
|
|
7007
|
+
.attr('height', (d) => {
|
|
7267
7008
|
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
7268
7009
|
const actualHeight = yScale(d[0]) - yScale(d[1]);
|
|
7269
7010
|
return actualHeight < 3 ? 3 : actualHeight;
|
|
7270
7011
|
}
|
|
7271
7012
|
return 0;
|
|
7272
7013
|
})
|
|
7273
|
-
.attr('width',
|
|
7274
|
-
|
|
7275
|
-
if (isMobile) {
|
|
7014
|
+
.attr('width', (d) => {
|
|
7015
|
+
if (device.isMobile)
|
|
7276
7016
|
return barWidth;
|
|
7017
|
+
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
7018
|
+
return xScale.bandwidth();
|
|
7277
7019
|
}
|
|
7278
|
-
return
|
|
7279
|
-
?
|
|
7280
|
-
:
|
|
7281
|
-
self.chartData.data.length <= 3
|
|
7282
|
-
? 70
|
|
7283
|
-
: xScale.bandwidth() * 0.8;
|
|
7020
|
+
return this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3
|
|
7021
|
+
? 70
|
|
7022
|
+
: xScale.bandwidth() * 0.8;
|
|
7284
7023
|
})
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
if (metaData.hasDrillDown) {
|
|
7288
|
-
if (metaData.barWithoutClick.length > 0 &&
|
|
7289
|
-
metaData.barWithoutClick.includes(d.data.name.toLowerCase())) {
|
|
7290
|
-
return 'default';
|
|
7291
|
-
}
|
|
7292
|
-
return 'pointer';
|
|
7293
|
-
}
|
|
7294
|
-
else
|
|
7024
|
+
.style('cursor', (d) => {
|
|
7025
|
+
if (!metaData.hasDrillDown)
|
|
7295
7026
|
return 'default';
|
|
7027
|
+
if (metaData.barWithoutClick?.includes(d.data.name.toLowerCase())) {
|
|
7028
|
+
return 'default';
|
|
7029
|
+
}
|
|
7030
|
+
return 'pointer';
|
|
7296
7031
|
})
|
|
7297
|
-
.style('fill',
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
7302
|
-
parseFloat(self.chartData.targetLineData.target))
|
|
7303
|
-
return self.chartData?.targetLineData?.barAboveTargetColor;
|
|
7304
|
-
return metaData.colors[d.key];
|
|
7305
|
-
});
|
|
7306
|
-
/**
|
|
7307
|
-
* do not show valus on hover as its alreay dislayed
|
|
7308
|
-
*/
|
|
7309
|
-
if (!this.isCC && !self.chartConfiguration.isMultiChartGridLine) {
|
|
7310
|
-
rect
|
|
7311
|
-
.append('svg:title') // TITLE APPENDED HERE
|
|
7312
|
-
.text(function (d) {
|
|
7313
|
-
return d[1] - d[0];
|
|
7314
|
-
});
|
|
7032
|
+
.style('fill', (d) => this.getBarFillColor(d, d.key, metaData, targetValue || undefined));
|
|
7033
|
+
// Add tooltips and labels
|
|
7034
|
+
if (!this.isCC && !this.chartConfiguration.isMultiChartGridLine) {
|
|
7035
|
+
rect.append('svg:title').text((d) => d[1] - d[0]);
|
|
7315
7036
|
}
|
|
7316
|
-
|
|
7037
|
+
this.addBarLabels(rect, xScale, yScale, metaData, formatFromBackend, formatForHugeNumbers);
|
|
7038
|
+
}
|
|
7039
|
+
addBarLabels(rect, xScale, yScale, metaData, formatFromBackend, formatForHugeNumbers) {
|
|
7040
|
+
if (this.chartConfiguration.showTotalOnTop) {
|
|
7317
7041
|
rect
|
|
7318
7042
|
.append('text')
|
|
7319
|
-
.attr('x',
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
.
|
|
7323
|
-
if (!d[0]) {
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
return 'start';
|
|
7328
|
-
}
|
|
7329
|
-
})
|
|
7330
|
-
.attr('class', 'verticalbar__text')
|
|
7331
|
-
.attr('y', function (d) {
|
|
7332
|
-
if (!d[0]) {
|
|
7333
|
-
return yScale(d[1]);
|
|
7334
|
-
}
|
|
7335
|
-
else {
|
|
7336
|
-
return yScale(d[1]) - 7;
|
|
7337
|
-
}
|
|
7338
|
-
})
|
|
7339
|
-
// .attr("y", function (d) { return yScale(d[0]) - yScale(d[1]); })
|
|
7340
|
-
.attr('dy', function (d) {
|
|
7341
|
-
return d.class;
|
|
7342
|
-
})
|
|
7343
|
-
.text(function (d) {
|
|
7344
|
-
if (!d[0]) {
|
|
7345
|
-
if (!isNaN(d[1] - d[0])) {
|
|
7346
|
-
return Math.round((d[1] - d[0]) * 100) / 100;
|
|
7347
|
-
}
|
|
7348
|
-
else
|
|
7349
|
-
return;
|
|
7350
|
-
}
|
|
7351
|
-
else {
|
|
7352
|
-
if (!isNaN(d[1])) {
|
|
7353
|
-
return Math.round(d[1] * 100) / 100;
|
|
7354
|
-
}
|
|
7355
|
-
else
|
|
7356
|
-
return;
|
|
7043
|
+
.attr('x', (d) => xScale(d.data.name) + xScale.bandwidth() / 2)
|
|
7044
|
+
.attr('class', 'lib-verticalstack-labels-ontop-weklycharts')
|
|
7045
|
+
.attr('y', (d) => yScale(d[1]) - 3)
|
|
7046
|
+
.text((d) => {
|
|
7047
|
+
if (!isNaN(d[1] - d[0]) && d[1] - d[0] !== 0) {
|
|
7048
|
+
const value = d[1] - d[0];
|
|
7049
|
+
const formatter = value <= 999 ? formatFromBackend : formatForHugeNumbers;
|
|
7050
|
+
return metaData.unit ? metaData.unit + formatter(value) : formatter(value);
|
|
7357
7051
|
}
|
|
7358
7052
|
});
|
|
7359
7053
|
}
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
.
|
|
7364
|
-
.
|
|
7365
|
-
.
|
|
7366
|
-
|
|
7367
|
-
.
|
|
7368
|
-
.
|
|
7369
|
-
|
|
7370
|
-
|
|
7371
|
-
|
|
7372
|
-
|
|
7373
|
-
|
|
7374
|
-
if (!self.chartConfiguration.displayTitleOnTop) {
|
|
7375
|
-
return;
|
|
7376
|
-
}
|
|
7377
|
-
svg
|
|
7378
|
-
.selectAll('rect')
|
|
7379
|
-
.filter(function (data) {
|
|
7380
|
-
return data == d;
|
|
7381
|
-
})
|
|
7382
|
-
.style('fill', function (d) {
|
|
7383
|
-
if (!isNaN(d[0]) &&
|
|
7384
|
-
!isNaN(d[1]) &&
|
|
7385
|
-
self.chartData.targetLineData &&
|
|
7386
|
-
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
7387
|
-
parseFloat(self.chartData.targetLineData.target))
|
|
7388
|
-
return self.chartData.targetLineData.barAboveTargetHoverColor
|
|
7389
|
-
? self.chartData.targetLineData.barAboveTargetHoverColor
|
|
7390
|
-
: self.chartData?.targetLineData?.barAboveTargetColor
|
|
7391
|
-
? self.chartData?.targetLineData?.barAboveTargetColor
|
|
7392
|
-
: '';
|
|
7393
|
-
return metaData.hoverColor ? metaData.hoverColor : '';
|
|
7394
|
-
});
|
|
7395
|
-
svg
|
|
7396
|
-
.append('foreignObject')
|
|
7397
|
-
.attr('x', function () {
|
|
7398
|
-
if (xScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
7399
|
-
return (xScale(d.data.name) -
|
|
7400
|
-
leftAndRightSpaces +
|
|
7401
|
-
(xScale.bandwidth() + leftAndRightSpaces * 2 - 180) / 2);
|
|
7402
|
-
}
|
|
7403
|
-
return xScale(d.data.name) - leftAndRightSpaces;
|
|
7404
|
-
})
|
|
7405
|
-
.attr('class', 'lib-verticalstack-title-ontop')
|
|
7406
|
-
.attr('y', function () {
|
|
7407
|
-
// Increase the gap between the bar and the tooltip (was -1 - 40)
|
|
7408
|
-
return yScale(d[1]) - 1 - 50; // 10px more gap
|
|
7409
|
-
})
|
|
7410
|
-
.attr('dy', function () {
|
|
7411
|
-
return d.class;
|
|
7412
|
-
})
|
|
7413
|
-
.attr('width', function () {
|
|
7414
|
-
if (d.data.name && /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)) {
|
|
7415
|
-
return '250px'; // increase for week + date
|
|
7416
|
-
}
|
|
7417
|
-
if (xScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
7418
|
-
return '180px';
|
|
7419
|
-
}
|
|
7420
|
-
return xScale.bandwidth() + leftAndRightSpaces * 2;
|
|
7421
|
-
})
|
|
7422
|
-
.attr('height', 40)
|
|
7423
|
-
.append('xhtml:div')
|
|
7424
|
-
.attr('class', 'title')
|
|
7425
|
-
.style('z-index', 99)
|
|
7426
|
-
.html(function () {
|
|
7427
|
-
// Tooltip content without any arrow mark
|
|
7428
|
-
if (!isNaN(d[1] - d[0])) {
|
|
7429
|
-
if (d[1] - d[0] === 0) {
|
|
7430
|
-
return '<span class="title-top-text">0</span>';
|
|
7431
|
-
}
|
|
7432
|
-
var dataType = metaData.dataType ? metaData.dataType : '';
|
|
7433
|
-
var desiredText = '';
|
|
7434
|
-
// Always show the full x-axis label (category name) in the tooltip
|
|
7435
|
-
desiredText =
|
|
7436
|
-
'<span class="title-bar-name">' +
|
|
7437
|
-
(d.data.name ? d.data.name : '') +
|
|
7438
|
-
'</span>';
|
|
7439
|
-
desiredText += metaData.unit
|
|
7440
|
-
? '<span class="title-top-text">' +
|
|
7441
|
-
metaData.unit +
|
|
7442
|
-
(d[1] - d[0]) + ' ' +
|
|
7443
|
-
dataType +
|
|
7444
|
-
'</span>'
|
|
7445
|
-
: '<span class="title-top-text">' +
|
|
7446
|
-
(d[1] - d[0]) + ' ' +
|
|
7447
|
-
dataType +
|
|
7448
|
-
'</span>';
|
|
7449
|
-
// No arrow mark or arrow HTML/CSS in tooltip
|
|
7450
|
-
return desiredText;
|
|
7451
|
-
}
|
|
7452
|
-
else
|
|
7453
|
-
return;
|
|
7454
|
-
});
|
|
7054
|
+
}
|
|
7055
|
+
renderAxes(svg, svgYAxisLeft, svgYAxisRight, xScale, yScale, data, height, width, device) {
|
|
7056
|
+
const xAxis = d3
|
|
7057
|
+
.axisBottom(xScale)
|
|
7058
|
+
.tickSize(0)
|
|
7059
|
+
.tickFormat(this.chartConfiguration.xAxisLabelFomatter);
|
|
7060
|
+
const yAxis = d3
|
|
7061
|
+
.axisLeft(yScale)
|
|
7062
|
+
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
7063
|
+
.tickSize(0)
|
|
7064
|
+
.tickFormat(this.chartConfiguration.yAxisLabelFomatter);
|
|
7065
|
+
// Render based on chart type
|
|
7066
|
+
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
7067
|
+
this.renderStandardAxes(svg, xAxis, yAxis, data, height, device);
|
|
7455
7068
|
}
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
return;
|
|
7459
|
-
}
|
|
7460
|
-
// svg.selectAll('rect').style('fill', metaData.colors[d.key]);
|
|
7461
|
-
svg.selectAll('rect').style('fill', function (d) {
|
|
7462
|
-
if (!isNaN(d[0]) &&
|
|
7463
|
-
!isNaN(d[1]) &&
|
|
7464
|
-
self.chartData.targetLineData &&
|
|
7465
|
-
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
7466
|
-
parseFloat(self.chartData.targetLineData.target))
|
|
7467
|
-
return self.chartData?.targetLineData?.barAboveTargetColor;
|
|
7468
|
-
return metaData.colors[d.key];
|
|
7469
|
-
});
|
|
7470
|
-
svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
7069
|
+
else if (this.chartConfiguration.isDrilldownChart) {
|
|
7070
|
+
this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, xAxis, yAxis, height);
|
|
7471
7071
|
}
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
* need to be used by bar charts only(one bar should contain one value)
|
|
7475
|
-
* used by weekly charts
|
|
7476
|
-
*/
|
|
7477
|
-
if (this.chartConfiguration.showTotalOnTop != undefined) {
|
|
7478
|
-
rect
|
|
7479
|
-
.append('text')
|
|
7480
|
-
.attr('x', function (d) {
|
|
7481
|
-
return xScale(d.data.name) + xScale.bandwidth() / 2;
|
|
7482
|
-
})
|
|
7483
|
-
.attr('class', 'lib-verticalstack-labels-ontop-weklycharts')
|
|
7484
|
-
.attr('y', function (d) {
|
|
7485
|
-
return yScale(d[1]) - 3;
|
|
7486
|
-
})
|
|
7487
|
-
.attr('dy', function (d) {
|
|
7488
|
-
return d.class;
|
|
7489
|
-
})
|
|
7490
|
-
.text(function (d) {
|
|
7491
|
-
if (!isNaN(d[1] - d[0])) {
|
|
7492
|
-
if (d[1] - d[0] == 0) {
|
|
7493
|
-
return;
|
|
7494
|
-
}
|
|
7495
|
-
if (d[1] - d[0] <= 999)
|
|
7496
|
-
return metaData.unit
|
|
7497
|
-
? metaData.unit + formatFromBackend(d[1] - d[0])
|
|
7498
|
-
: formatFromBackend(d[1] - d[0]);
|
|
7499
|
-
else
|
|
7500
|
-
return metaData.unit
|
|
7501
|
-
? metaData.unit + formatForHugeNumbers(d[1] - d[0])
|
|
7502
|
-
: formatForHugeNumbers(d[1] - d[0]);
|
|
7503
|
-
}
|
|
7504
|
-
else
|
|
7505
|
-
return;
|
|
7506
|
-
});
|
|
7507
|
-
}
|
|
7508
|
-
/**
|
|
7509
|
-
* used to show angled values on top of the bars
|
|
7510
|
-
* used by weekly charts
|
|
7511
|
-
*/
|
|
7512
|
-
if (this.chartConfiguration.showAngledLabels != undefined) {
|
|
7513
|
-
rect
|
|
7514
|
-
.append('text')
|
|
7515
|
-
.attr('x', 0)
|
|
7516
|
-
.attr('fill', function (d, i) {
|
|
7517
|
-
return metaData.colors[d.key];
|
|
7518
|
-
})
|
|
7519
|
-
.attr('class', 'lib-data-labels-angled-weeklycharts')
|
|
7520
|
-
.attr('y', 0)
|
|
7521
|
-
.attr('dy', function (d) {
|
|
7522
|
-
return d.class;
|
|
7523
|
-
})
|
|
7524
|
-
.text(function (d) {
|
|
7525
|
-
if (!isNaN(d[1] - d[0]) && d[1] - d[0] > 0) {
|
|
7526
|
-
if (d[1] - d[0] <= 999)
|
|
7527
|
-
return metaData.unit
|
|
7528
|
-
? metaData.unit + formatFromBackend(d[1] - d[0])
|
|
7529
|
-
: formatFromBackend(d[1] - d[0]);
|
|
7530
|
-
else
|
|
7531
|
-
return metaData.unit + formatForHugeNumbers(d[1] - d[0]);
|
|
7532
|
-
}
|
|
7533
|
-
else
|
|
7534
|
-
return;
|
|
7535
|
-
})
|
|
7536
|
-
.attr('transform', function (d) {
|
|
7537
|
-
if (!isNaN(d[1] - d[0]) && d[1] - d[0] > 0) {
|
|
7538
|
-
var total = 0;
|
|
7539
|
-
var incrementer = 1;
|
|
7540
|
-
metaData.keyList.forEach((key) => {
|
|
7541
|
-
if (d.data[key])
|
|
7542
|
-
total = total + d.data[key];
|
|
7543
|
-
else
|
|
7544
|
-
incrementer = 2;
|
|
7545
|
-
});
|
|
7546
|
-
if (tempObjectHolder[d.data.name] == undefined) {
|
|
7547
|
-
tempObjectHolder[d.data.name] = 1;
|
|
7548
|
-
}
|
|
7549
|
-
else {
|
|
7550
|
-
tempObjectHolder[d.data.name] =
|
|
7551
|
-
tempObjectHolder[d.data.name] + incrementer;
|
|
7552
|
-
}
|
|
7553
|
-
switch (tempObjectHolder[d.data.name]) {
|
|
7554
|
-
case 1:
|
|
7555
|
-
return ('translate(' +
|
|
7556
|
-
(xScale(d.data.name) + xScale.bandwidth() / 3) +
|
|
7557
|
-
',' +
|
|
7558
|
-
(yScale(total) - 3) +
|
|
7559
|
-
') rotate(270)');
|
|
7560
|
-
case 2:
|
|
7561
|
-
return ('translate(' +
|
|
7562
|
-
(xScale(d.data.name) + xScale.bandwidth() / 2 + 2) +
|
|
7563
|
-
',' +
|
|
7564
|
-
(yScale(total) - 3) +
|
|
7565
|
-
') rotate(270)');
|
|
7566
|
-
default:
|
|
7567
|
-
return ('translate(' +
|
|
7568
|
-
(xScale(d.data.name) + (xScale.bandwidth() * 3) / 4) +
|
|
7569
|
-
',' +
|
|
7570
|
-
(yScale(total) - 3) +
|
|
7571
|
-
') rotate(270)');
|
|
7572
|
-
}
|
|
7573
|
-
}
|
|
7574
|
-
return 'rotate(0)';
|
|
7575
|
-
});
|
|
7576
|
-
}
|
|
7577
|
-
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
7578
|
-
if (isMobile) {
|
|
7579
|
-
// Custom x-axis label rendering for mobile: evenly distribute under each bar
|
|
7580
|
-
svg.selectAll('.custom-x-label').remove();
|
|
7581
|
-
data.forEach(function (d, i) {
|
|
7582
|
-
const xVal = leftAndRightSpaces + i * (barWidth + barPadding) + barWidth / 2;
|
|
7583
|
-
svg.append('text')
|
|
7584
|
-
.attr('class', 'custom-x-label')
|
|
7585
|
-
.attr('x', 0)
|
|
7586
|
-
.attr('y', height + 18)
|
|
7587
|
-
.attr('text-anchor', 'middle')
|
|
7588
|
-
.attr('transform', 'translate(' + (xVal + 20) + ',0)') // current value + 20
|
|
7589
|
-
.style('font-size', '10px')
|
|
7590
|
-
.style('fill', 'var(--chart-text-color)')
|
|
7591
|
-
.style('writing-mode', 'sideways-lr') // writing mode for mobile
|
|
7592
|
-
.text(d.name.substring(0, 3));
|
|
7593
|
-
});
|
|
7594
|
-
}
|
|
7595
|
-
else {
|
|
7596
|
-
svg
|
|
7597
|
-
.append('g')
|
|
7598
|
-
.attr('transform', 'translate(0,' + height + ')')
|
|
7599
|
-
.attr('class', 'lib-stacked-x-axis-text')
|
|
7600
|
-
.call(xAxis)
|
|
7601
|
-
.selectAll('text')
|
|
7602
|
-
.style('fill', 'var(--chart-text-color)')
|
|
7603
|
-
.style('font-size', '12px')
|
|
7604
|
-
.attr('text-anchor', 'middle')
|
|
7605
|
-
.attr('dx', '0')
|
|
7606
|
-
.attr('dy', '0.71em')
|
|
7607
|
-
.attr('transform', null)
|
|
7608
|
-
.text(function (d) {
|
|
7609
|
-
return d;
|
|
7610
|
-
});
|
|
7611
|
-
}
|
|
7612
|
-
svg
|
|
7613
|
-
.append('g')
|
|
7614
|
-
.attr('class', 'lib-stacked-y-axis-text')
|
|
7615
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
7616
|
-
.attr('transform', 'translate(0,0)')
|
|
7617
|
-
.call(yAxis)
|
|
7618
|
-
.selectAll('text')
|
|
7619
|
-
.style('fill', 'var(--chart-text-color)');
|
|
7072
|
+
else {
|
|
7073
|
+
this.renderMultiChartAxes(svg, xAxis, yAxis, height);
|
|
7620
7074
|
}
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
.call(xAxis)
|
|
7627
|
-
.style('display', 'none');
|
|
7628
|
-
svgYAxisLeft
|
|
7629
|
-
.append('g')
|
|
7630
|
-
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
7631
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
7632
|
-
.attr('transform', 'translate(0,0)')
|
|
7633
|
-
.call(yAxis)
|
|
7634
|
-
.selectAll('text')
|
|
7635
|
-
.style('fill', 'var(--chart-text-color)');
|
|
7636
|
-
svgYAxisRight
|
|
7637
|
-
.append('g')
|
|
7638
|
-
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
7639
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
7640
|
-
.attr('transform', 'translate(0,0)')
|
|
7641
|
-
.call(yAxis)
|
|
7642
|
-
.style('display', 'none');
|
|
7075
|
+
this.styleAxisDomains(svg, svgYAxisLeft, svgYAxisRight);
|
|
7076
|
+
}
|
|
7077
|
+
renderStandardAxes(svg, xAxis, yAxis, data, height, device) {
|
|
7078
|
+
if (device.isMobile) {
|
|
7079
|
+
this.renderMobileXAxis(svg, data, height, device);
|
|
7643
7080
|
}
|
|
7644
7081
|
else {
|
|
7645
7082
|
svg
|
|
7646
7083
|
.append('g')
|
|
7647
|
-
.attr('transform',
|
|
7648
|
-
.attr('class', 'lib-stacked-x-axis-text
|
|
7649
|
-
.attr('transform', 'translate(0,' + height + ')')
|
|
7084
|
+
.attr('transform', `translate(0,${height})`)
|
|
7085
|
+
.attr('class', 'lib-stacked-x-axis-text')
|
|
7650
7086
|
.call(xAxis)
|
|
7651
7087
|
.selectAll('text')
|
|
7652
|
-
.style('fill', 'var(--chart-text-color)');
|
|
7653
|
-
svg
|
|
7654
|
-
.append('g')
|
|
7655
|
-
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
7656
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
7657
|
-
.attr('transform', 'translate(0,0)')
|
|
7658
|
-
.call(yAxis)
|
|
7659
|
-
.selectAll('text')
|
|
7660
|
-
.style('fill', 'var(--chart-text-color)');
|
|
7661
|
-
}
|
|
7662
|
-
/**
|
|
7663
|
-
* for existing charts, place xaxis labels nearer to xaxis
|
|
7664
|
-
* used by existing charts
|
|
7665
|
-
*/
|
|
7666
|
-
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
7667
|
-
d3.selectAll('g.lib-stacked-x-axis-text g.tick text').attr('y', function () {
|
|
7668
|
-
if (alternate_text) {
|
|
7669
|
-
alternate_text = false;
|
|
7670
|
-
return long_tick_length + 1;
|
|
7671
|
-
}
|
|
7672
|
-
else {
|
|
7673
|
-
alternate_text = true;
|
|
7674
|
-
return short_tick_length + 1;
|
|
7675
|
-
}
|
|
7676
|
-
});
|
|
7677
|
-
}
|
|
7678
|
-
else {
|
|
7679
|
-
d3.selectAll('.multichart > g > text').attr('class', 'lib-display-hidden');
|
|
7680
|
-
}
|
|
7681
|
-
/**
|
|
7682
|
-
* based of the flag, hide or show xaxis texts
|
|
7683
|
-
* used by weekly charts
|
|
7684
|
-
*/
|
|
7685
|
-
if (this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
7686
|
-
this.chartConfiguration.isXaxisLabelHidden) {
|
|
7687
|
-
d3.selectAll('.multichart > g > text').attr('class', 'lib-display-hidden');
|
|
7688
|
-
}
|
|
7689
|
-
else if (this.chartConfiguration.isXaxisLabelHidden != undefined) {
|
|
7690
|
-
svg
|
|
7691
|
-
.append('g')
|
|
7692
|
-
.attr('class', 'x1 axis1')
|
|
7693
|
-
.attr('transform', 'translate(0,' + height + ')')
|
|
7694
|
-
.style('color', '#000')
|
|
7695
|
-
.call(d3.axisBottom(xScale).tickSize(0))
|
|
7696
|
-
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7697
|
-
svg
|
|
7698
|
-
.append('g')
|
|
7699
|
-
.attr('class', 'x2 axis2')
|
|
7700
|
-
.attr('transform', 'translate(0,' + height + ')')
|
|
7701
|
-
.style('color', '#000')
|
|
7702
|
-
.call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
7703
|
-
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7704
|
-
svg.selectAll('.axis2 > g > text').attr('class', 'lib-display-hidden');
|
|
7705
|
-
// svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
7706
|
-
svg.selectAll('.x1.axis1 .tick line').attr('y2', function () {
|
|
7707
|
-
if (self.chartConfiguration.hideXaxisTick) {
|
|
7708
|
-
return 0;
|
|
7709
|
-
}
|
|
7710
|
-
/**
|
|
7711
|
-
* isNoAlternateXaxisText is used to prevent x-axis label to be displayed in alternate fashion
|
|
7712
|
-
* for future use
|
|
7713
|
-
*/
|
|
7714
|
-
if (alternate_text &&
|
|
7715
|
-
self.chartConfiguration.isNoAlternateXaxisText == undefined) {
|
|
7716
|
-
alternate_text = false;
|
|
7717
|
-
return long_tick_length_bg - 7;
|
|
7718
|
-
}
|
|
7719
|
-
else {
|
|
7720
|
-
alternate_text = true;
|
|
7721
|
-
return short_tick_length_bg - 4;
|
|
7722
|
-
}
|
|
7723
|
-
});
|
|
7724
|
-
/**
|
|
7725
|
-
* reset the flag so that texts also follow the pattern of ticks
|
|
7726
|
-
* used by weekly charts
|
|
7727
|
-
*/
|
|
7728
|
-
alternate_text = false;
|
|
7729
|
-
svg
|
|
7730
|
-
.selectAll('g.x1.axis1 g.tick text')
|
|
7731
|
-
// .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
7732
|
-
.attr('class', function () {
|
|
7733
|
-
if (self.chartConfiguration.isDrilldownChart) {
|
|
7734
|
-
if (data && data.length > 8) {
|
|
7735
|
-
return 'lib-xaxis-labels-texts-drilldown-alt';
|
|
7736
|
-
}
|
|
7737
|
-
return 'lib-xaxis-labels-texts-drilldown';
|
|
7738
|
-
}
|
|
7739
|
-
else
|
|
7740
|
-
return 'lib-xaxis-labels-texts-weeklycharts';
|
|
7741
|
-
})
|
|
7742
|
-
.attr('y', function () {
|
|
7743
|
-
if (alternate_text) {
|
|
7744
|
-
alternate_text = false;
|
|
7745
|
-
return long_tick_length_bg;
|
|
7746
|
-
}
|
|
7747
|
-
else {
|
|
7748
|
-
alternate_text = true;
|
|
7749
|
-
return short_tick_length_bg;
|
|
7750
|
-
}
|
|
7751
|
-
});
|
|
7752
|
-
}
|
|
7753
|
-
if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
7754
|
-
svg
|
|
7755
|
-
.selectAll('g.x1.axis1 g.tick text')
|
|
7756
|
-
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7757
|
-
.attr('y', short_tick_length_bg)
|
|
7758
|
-
.text(function (d, i) {
|
|
7759
|
-
if (isMobile) {
|
|
7760
|
-
// If label has more than one word, show only first 3 letters of first word
|
|
7761
|
-
var firstWord = d.split(' ')[0];
|
|
7762
|
-
return firstWord.substring(0, 3);
|
|
7763
|
-
}
|
|
7764
|
-
if (d.trim().indexOf(' ') > -1) {
|
|
7765
|
-
return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
7766
|
-
}
|
|
7767
|
-
return d.toLowerCase();
|
|
7768
|
-
})
|
|
7769
|
-
.attr('transform', function (d, i) {
|
|
7770
|
-
if (isMobile) {
|
|
7771
|
-
var totalBars = 0;
|
|
7772
|
-
if (this.parentNode && this.parentNode.parentNode) {
|
|
7773
|
-
totalBars = d3.select(this.parentNode.parentNode).selectAll('g.tick').size();
|
|
7774
|
-
}
|
|
7775
|
-
if (totalBars === 2) {
|
|
7776
|
-
return 'translate(0,0)';
|
|
7777
|
-
}
|
|
7778
|
-
else {
|
|
7779
|
-
return 'translate(' + (i * 30) + ',0)';
|
|
7780
|
-
}
|
|
7781
|
-
}
|
|
7782
|
-
return null;
|
|
7783
|
-
});
|
|
7784
|
-
svg
|
|
7785
|
-
.selectAll('g.x1.axis1 g.tick')
|
|
7786
|
-
.append('text')
|
|
7787
|
-
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7788
|
-
.attr('y', long_tick_length_bg)
|
|
7789
|
-
.attr('fill', 'currentColor')
|
|
7790
|
-
.text(function (d) {
|
|
7791
|
-
// For mobile, do not print the second word at all
|
|
7792
|
-
if (isMobile) {
|
|
7793
|
-
return '';
|
|
7794
|
-
}
|
|
7795
|
-
if (d.trim().indexOf(' ') > -1) {
|
|
7796
|
-
return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
|
|
7797
|
-
}
|
|
7798
|
-
return '';
|
|
7799
|
-
})
|
|
7800
|
-
.attr('transform', function (d, i) {
|
|
7801
|
-
if (isMobile && i === 0) {
|
|
7802
|
-
return 'translate(20,0)';
|
|
7803
|
-
}
|
|
7804
|
-
return null;
|
|
7805
|
-
});
|
|
7806
|
-
}
|
|
7807
|
-
/**
|
|
7808
|
-
* hide yaxis values
|
|
7809
|
-
* used by weekly charts
|
|
7810
|
-
*/
|
|
7811
|
-
if (this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
7812
|
-
this.chartConfiguration.isYaxisLabelHidden) {
|
|
7813
|
-
svg
|
|
7814
|
-
.selectAll('.yaxis-dashed > g > text')
|
|
7815
|
-
.attr('class', 'lib-display-hidden');
|
|
7816
|
-
}
|
|
7817
|
-
/** hide y axis labels
|
|
7818
|
-
* config is there for future use
|
|
7819
|
-
*/
|
|
7820
|
-
if (this.chartConfiguration.isYaxisHidden != undefined &&
|
|
7821
|
-
this.chartConfiguration.isYaxisHidden) {
|
|
7822
|
-
d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
|
|
7823
|
-
}
|
|
7824
|
-
/**
|
|
7825
|
-
* dashed y axis
|
|
7826
|
-
* used by weekly charts
|
|
7827
|
-
*/
|
|
7828
|
-
if (this.chartConfiguration.isYaxisDashed != undefined &&
|
|
7829
|
-
this.chartConfiguration.isYaxisDashed) {
|
|
7830
|
-
d3.selectAll('.yaxis-dashed')
|
|
7831
|
-
.style('stroke-dasharray', '5 5')
|
|
7832
|
-
.style('color', 'var(--chart-grid-color)'); // Use CSS variable
|
|
7833
|
-
}
|
|
7834
|
-
/**
|
|
7835
|
-
* x axis color
|
|
7836
|
-
* used by weekly charts
|
|
7837
|
-
*/
|
|
7838
|
-
if (this.chartConfiguration.isXaxisColor != undefined) {
|
|
7839
|
-
d3.selectAll('.multichart').style('color', this.chartConfiguration.isXaxisColor || 'var(--chart-text-color)');
|
|
7840
|
-
}
|
|
7841
|
-
/**
|
|
7842
|
-
* used to display y label
|
|
7843
|
-
*/
|
|
7844
|
-
if (this.isZoomedOut && this.chartData.data.length > 9) {
|
|
7845
|
-
svg
|
|
7846
|
-
.selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
7847
|
-
.attr('transform', 'rotate(-90)')
|
|
7848
|
-
.attr('text-anchor', 'end')
|
|
7849
|
-
.attr('x', '-5')
|
|
7850
|
-
.attr('dy', null);
|
|
7851
|
-
}
|
|
7852
|
-
function styleAxisDomain() {
|
|
7853
|
-
svg.selectAll('.domain')
|
|
7854
|
-
.style('stroke', 'var(--chart-axis-color)')
|
|
7855
|
-
.style('stroke-width', '1px');
|
|
7856
|
-
svgYAxisLeft.selectAll('.domain')
|
|
7857
|
-
.style('stroke', 'var(--chart-axis-color)')
|
|
7858
|
-
.style('stroke-width', '1px');
|
|
7859
|
-
svgYAxisRight.selectAll('.domain')
|
|
7860
|
-
.style('stroke', 'var(--chart-axis-color)')
|
|
7861
|
-
.style('stroke-width', '1px');
|
|
7862
|
-
}
|
|
7863
|
-
styleAxisDomain();
|
|
7864
|
-
if (metaData.yLabel) {
|
|
7865
|
-
svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
|
|
7866
|
-
function isAcronym(label) {
|
|
7867
|
-
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
7868
|
-
}
|
|
7869
|
-
const yLabelText = metaData.yLabel;
|
|
7870
|
-
const isAcr = isAcronym(yLabelText.replace(/[^A-Za-z]/g, ''));
|
|
7871
|
-
const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
|
|
7872
|
-
svgYAxisLeft
|
|
7873
|
-
.append('text')
|
|
7874
|
-
.attr('class', function () {
|
|
7875
|
-
let baseClass = 'lib-axis-group-label font-size-1';
|
|
7876
|
-
if (self.chartConfiguration.isDrilldownChart)
|
|
7877
|
-
return baseClass + ' lib-ylabel-drilldowncharts';
|
|
7878
|
-
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
7879
|
-
return baseClass + ' lib-ylabel-weeklyCharts';
|
|
7880
|
-
return baseClass + ' lib-axis-waterfall-label';
|
|
7881
|
-
})
|
|
7882
|
-
.attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
7883
|
-
.attr('transform', 'rotate(-90)')
|
|
7884
|
-
.attr('y', yPosition)
|
|
7885
|
-
.attr('x', 0 - height / 2)
|
|
7886
|
-
.attr('dy', '1em')
|
|
7887
|
-
.style('text-anchor', 'middle')
|
|
7888
7088
|
.style('fill', 'var(--chart-text-color)')
|
|
7889
|
-
.style('
|
|
7890
|
-
.text
|
|
7891
|
-
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
7892
|
-
}
|
|
7893
|
-
if (this.chartData.targetLineData) {
|
|
7894
|
-
const yZero = yScale(parsedNum);
|
|
7895
|
-
svg
|
|
7896
|
-
.append('line')
|
|
7897
|
-
.attr('x1', 0)
|
|
7898
|
-
.attr('x2', width)
|
|
7899
|
-
.attr('y1', yZero)
|
|
7900
|
-
.attr('y2', yZero)
|
|
7901
|
-
.style('stroke-dasharray', '5 5')
|
|
7902
|
-
.style('stroke', this.chartData.targetLineData.color);
|
|
7903
|
-
// svgYAxisRight
|
|
7904
|
-
// .append('line')
|
|
7905
|
-
// .attr('x1', 0)
|
|
7906
|
-
// .attr('x2', rightSvgWidth)
|
|
7907
|
-
// .attr('y1', yZero)
|
|
7908
|
-
// .attr('y2', yZero)
|
|
7909
|
-
// .style('stroke', this.chartData.targetLineData.color);
|
|
7910
|
-
svgYAxisRight
|
|
7911
|
-
.append('foreignObject')
|
|
7912
|
-
// .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
|
|
7913
|
-
.attr('transform', 'translate(' + 0 + ',' + (yZero - 13) + ')')
|
|
7914
|
-
.attr('width', rightSvgWidth)
|
|
7915
|
-
.attr('height', 50)
|
|
7916
|
-
.append('xhtml:div')
|
|
7917
|
-
.attr('class', 'target-display')
|
|
7918
|
-
.style('color', 'var(--chart-text-color)')
|
|
7919
|
-
.html(function (d, i) {
|
|
7920
|
-
let dataTypeTemp = '';
|
|
7921
|
-
let targetLineName = 'target';
|
|
7922
|
-
if (metaData.dataType) {
|
|
7923
|
-
dataTypeTemp = metaData.dataType;
|
|
7924
|
-
}
|
|
7925
|
-
if (self.chartData.targetLineData &&
|
|
7926
|
-
self.chartData.targetLineData.targetName) {
|
|
7927
|
-
targetLineName = self.chartData.targetLineData.targetName;
|
|
7928
|
-
}
|
|
7929
|
-
return (`<div>${targetLineName}</div>` +
|
|
7930
|
-
'<div>' +
|
|
7931
|
-
self.chartData.targetLineData.target +
|
|
7932
|
-
'' +
|
|
7933
|
-
dataTypeTemp +
|
|
7934
|
-
'</div>');
|
|
7935
|
-
});
|
|
7089
|
+
.style('font-size', '12px')
|
|
7090
|
+
.attr('text-anchor', 'middle');
|
|
7936
7091
|
}
|
|
7937
|
-
|
|
7938
|
-
.
|
|
7939
|
-
.
|
|
7940
|
-
.
|
|
7941
|
-
|
|
7092
|
+
svg
|
|
7093
|
+
.append('g')
|
|
7094
|
+
.attr('class', 'lib-stacked-y-axis-text')
|
|
7095
|
+
.call(yAxis)
|
|
7096
|
+
.selectAll('text')
|
|
7097
|
+
.style('fill', 'var(--chart-text-color)');
|
|
7098
|
+
}
|
|
7099
|
+
renderMobileXAxis(svg, data, height, device) {
|
|
7100
|
+
const barWidth = 32;
|
|
7101
|
+
const barPadding = 12;
|
|
7102
|
+
svg.selectAll('.custom-x-label').remove();
|
|
7103
|
+
data.forEach((d, i) => {
|
|
7104
|
+
const xVal = this.SPACING.leftAndRight + i * (barWidth + barPadding) + barWidth / 2;
|
|
7942
7105
|
svg
|
|
7943
7106
|
.append('text')
|
|
7944
|
-
.attr('class', '
|
|
7945
|
-
.attr('
|
|
7946
|
-
.attr('
|
|
7947
|
-
.attr('
|
|
7948
|
-
.attr('
|
|
7949
|
-
.
|
|
7950
|
-
.style('
|
|
7951
|
-
.
|
|
7107
|
+
.attr('class', 'custom-x-label')
|
|
7108
|
+
.attr('x', 0)
|
|
7109
|
+
.attr('y', height + 18)
|
|
7110
|
+
.attr('text-anchor', 'middle')
|
|
7111
|
+
.attr('transform', `translate(${xVal + 20},0)`)
|
|
7112
|
+
.style('font-size', '10px')
|
|
7113
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7114
|
+
.style('writing-mode', 'sideways-lr')
|
|
7115
|
+
.text(d.name.substring(0, 3));
|
|
7116
|
+
});
|
|
7117
|
+
}
|
|
7118
|
+
renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, xAxis, yAxis, height) {
|
|
7119
|
+
svg
|
|
7120
|
+
.append('g')
|
|
7121
|
+
.attr('transform', `translate(0,${height})`)
|
|
7122
|
+
.attr('class', 'lib-stacked-x-axis-text multichart1')
|
|
7123
|
+
.call(xAxis)
|
|
7124
|
+
.style('display', 'none');
|
|
7125
|
+
svgYAxisLeft
|
|
7126
|
+
.append('g')
|
|
7127
|
+
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
7128
|
+
.call(yAxis)
|
|
7129
|
+
.selectAll('text')
|
|
7130
|
+
.style('fill', 'var(--chart-text-color)');
|
|
7131
|
+
svgYAxisRight
|
|
7132
|
+
.append('g')
|
|
7133
|
+
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
7134
|
+
.call(yAxis)
|
|
7135
|
+
.style('display', 'none');
|
|
7136
|
+
}
|
|
7137
|
+
renderMultiChartAxes(svg, xAxis, yAxis, height) {
|
|
7138
|
+
svg
|
|
7139
|
+
.append('g')
|
|
7140
|
+
.attr('transform', `translate(0,${height})`)
|
|
7141
|
+
.attr('class', 'lib-stacked-x-axis-text multichart')
|
|
7142
|
+
.call(xAxis)
|
|
7143
|
+
.selectAll('text')
|
|
7144
|
+
.style('fill', 'var(--chart-text-color)');
|
|
7145
|
+
svg
|
|
7146
|
+
.append('g')
|
|
7147
|
+
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
7148
|
+
.call(yAxis)
|
|
7149
|
+
.selectAll('text')
|
|
7150
|
+
.style('fill', 'var(--chart-text-color)');
|
|
7151
|
+
}
|
|
7152
|
+
styleAxisDomains(svg, svgYAxisLeft, svgYAxisRight) {
|
|
7153
|
+
const axisStyle = {
|
|
7154
|
+
stroke: 'var(--chart-axis-color)',
|
|
7155
|
+
'stroke-width': '1px'
|
|
7156
|
+
};
|
|
7157
|
+
[svg, svgYAxisLeft, svgYAxisRight].forEach(element => {
|
|
7158
|
+
element.selectAll('.domain')
|
|
7159
|
+
.style('stroke', axisStyle.stroke)
|
|
7160
|
+
.style('stroke-width', axisStyle['stroke-width']);
|
|
7161
|
+
});
|
|
7162
|
+
}
|
|
7163
|
+
renderLabels(svg, svgYAxisLeft, metaData, height, width, margin) {
|
|
7164
|
+
if (metaData.yLabel) {
|
|
7165
|
+
this.renderYAxisLabel(svgYAxisLeft, metaData.yLabel, height, margin);
|
|
7952
7166
|
}
|
|
7953
7167
|
if (metaData.xLabel) {
|
|
7954
|
-
|
|
7955
|
-
return ((label.length <= 4 && /^[A-Z]+$/.test(label)) ||
|
|
7956
|
-
(label === label.toUpperCase() && /[A-Z]/.test(label)));
|
|
7957
|
-
}
|
|
7958
|
-
const xLabelText = metaData.xLabel;
|
|
7959
|
-
const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
7960
|
-
const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 10);
|
|
7961
|
-
svg
|
|
7962
|
-
.append('text')
|
|
7963
|
-
.attr('class', function () {
|
|
7964
|
-
let baseClass = 'lib-axis-group-label font-size-1';
|
|
7965
|
-
if (self.chartConfiguration.isDrilldownChart)
|
|
7966
|
-
return baseClass + ' lib-xlabel-drilldowncharts';
|
|
7967
|
-
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
7968
|
-
return baseClass + ' lib-xlabel-weeklyCharts';
|
|
7969
|
-
return baseClass + ' lib-axis-waterfall-label';
|
|
7970
|
-
})
|
|
7971
|
-
.attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
7972
|
-
.attr('transform', 'translate(' + width / 2 + ' ,' + xPosition + ')')
|
|
7973
|
-
.style('text-anchor', 'middle')
|
|
7974
|
-
.style('fill', 'var(--chart-text-color)')
|
|
7975
|
-
.text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
7976
|
-
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
7168
|
+
this.renderXAxisLabel(svg, metaData.xLabel, height, width, margin);
|
|
7977
7169
|
}
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
|
|
7981
|
-
|
|
7982
|
-
|
|
7170
|
+
}
|
|
7171
|
+
renderYAxisLabel(svgYAxisLeft, yLabel, height, margin) {
|
|
7172
|
+
svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
|
|
7173
|
+
const { formatted, isAcronym } = this.formatAxisLabel(yLabel);
|
|
7174
|
+
const isRia = this.customChartConfiguration?.isRia;
|
|
7175
|
+
const yPosition = isRia ? -margin.left / 2 - 30 : -margin.left / 2 - 40;
|
|
7176
|
+
let labelClass = 'lib-axis-group-label font-size-1';
|
|
7177
|
+
if (this.chartConfiguration.isDrilldownChart) {
|
|
7178
|
+
labelClass += ' lib-ylabel-drilldowncharts';
|
|
7179
|
+
}
|
|
7180
|
+
else if (this.chartConfiguration.isMultiChartGridLine !== undefined) {
|
|
7181
|
+
labelClass += ' lib-ylabel-weeklyCharts';
|
|
7182
|
+
}
|
|
7183
|
+
else {
|
|
7184
|
+
labelClass += ' lib-axis-waterfall-label';
|
|
7185
|
+
}
|
|
7186
|
+
svgYAxisLeft
|
|
7187
|
+
.append('text')
|
|
7188
|
+
.attr('class', labelClass)
|
|
7189
|
+
.attr('style', this.chartConfiguration.yAxisCustomlabelStyles)
|
|
7190
|
+
.attr('transform', 'rotate(-90)')
|
|
7191
|
+
.attr('y', yPosition)
|
|
7192
|
+
.attr('x', -height / 2)
|
|
7193
|
+
.attr('dy', '1em')
|
|
7194
|
+
.style('text-anchor', 'middle')
|
|
7195
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7196
|
+
.text(formatted)
|
|
7197
|
+
.style('text-transform', isAcronym ? 'none' : 'capitalize');
|
|
7198
|
+
}
|
|
7199
|
+
renderXAxisLabel(svg, xLabel, height, width, margin) {
|
|
7200
|
+
const { formatted, isAcronym } = this.formatAxisLabel(xLabel);
|
|
7201
|
+
const isRia = this.customChartConfiguration?.isRia;
|
|
7202
|
+
const xPosition = isRia
|
|
7203
|
+
? height + margin.top + margin.bottom
|
|
7204
|
+
: height + margin.top + margin.bottom + 10;
|
|
7205
|
+
let labelClass = 'lib-axis-group-label font-size-1';
|
|
7206
|
+
if (this.chartConfiguration.isDrilldownChart) {
|
|
7207
|
+
labelClass += ' lib-xlabel-drilldowncharts';
|
|
7208
|
+
}
|
|
7209
|
+
else if (this.chartConfiguration.isMultiChartGridLine !== undefined) {
|
|
7210
|
+
labelClass += ' lib-xlabel-weeklyCharts';
|
|
7211
|
+
}
|
|
7212
|
+
else {
|
|
7213
|
+
labelClass += ' lib-axis-waterfall-label';
|
|
7214
|
+
}
|
|
7215
|
+
svg
|
|
7216
|
+
.append('text')
|
|
7217
|
+
.attr('class', labelClass)
|
|
7218
|
+
.attr('style', this.chartConfiguration.xAxisCustomlabelStyles)
|
|
7219
|
+
.attr('transform', `translate(${width / 2},${xPosition})`)
|
|
7220
|
+
.style('text-anchor', 'middle')
|
|
7221
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7222
|
+
.text(formatted)
|
|
7223
|
+
.style('text-transform', isAcronym ? 'none' : 'capitalize');
|
|
7224
|
+
}
|
|
7225
|
+
renderTargetLine(svg, svgYAxisRight, yScale, width, targetValue, metaData) {
|
|
7226
|
+
const yZero = yScale(targetValue);
|
|
7227
|
+
// Draw target line
|
|
7228
|
+
svg
|
|
7229
|
+
.append('line')
|
|
7230
|
+
.attr('x1', 0)
|
|
7231
|
+
.attr('x2', width)
|
|
7232
|
+
.attr('y1', yZero)
|
|
7233
|
+
.attr('y2', yZero)
|
|
7234
|
+
.style('stroke-dasharray', '5 5')
|
|
7235
|
+
.style('stroke', this.chartData.targetLineData.color);
|
|
7236
|
+
// Add target label
|
|
7237
|
+
const targetLineName = this.chartData.targetLineData?.targetName || 'target';
|
|
7238
|
+
const dataType = metaData.dataType || '';
|
|
7239
|
+
svgYAxisRight
|
|
7240
|
+
.append('foreignObject')
|
|
7241
|
+
.attr('transform', `translate(0,${yZero - 13})`)
|
|
7242
|
+
.attr('width', this.SPACING.rightSvgWidth)
|
|
7243
|
+
.attr('height', 50)
|
|
7244
|
+
.append('xhtml:div')
|
|
7245
|
+
.attr('class', 'target-display')
|
|
7246
|
+
.style('color', 'var(--chart-text-color)')
|
|
7247
|
+
.html(`
|
|
7248
|
+
<div>${targetLineName}</div>
|
|
7249
|
+
<div>${targetValue}${dataType}</div>
|
|
7250
|
+
`);
|
|
7251
|
+
}
|
|
7252
|
+
renderLineChart(svg, lineData, xScale, height, colors) {
|
|
7253
|
+
const lineYscale = d3
|
|
7254
|
+
.scaleLinear()
|
|
7255
|
+
.domain([0, d3.max(lineData, (d) => +d.value) || 0])
|
|
7256
|
+
.range([height, 0]);
|
|
7257
|
+
const dataGroup = d3
|
|
7258
|
+
.nest()
|
|
7259
|
+
.key((d) => d.category)
|
|
7260
|
+
.entries(lineData);
|
|
7261
|
+
const lineGen = d3
|
|
7262
|
+
.line()
|
|
7263
|
+
.x((d) => xScale(d.name) + xScale.bandwidth() / 2)
|
|
7264
|
+
.y((d) => lineYscale(d.value));
|
|
7265
|
+
dataGroup.forEach((group) => {
|
|
7266
|
+
// Draw line
|
|
7267
|
+
svg
|
|
7268
|
+
.append('path')
|
|
7269
|
+
.datum(group.values)
|
|
7270
|
+
.attr('fill', 'none')
|
|
7271
|
+
.attr('stroke', (d) => {
|
|
7272
|
+
if (d[0] && 'category' in d[0]) {
|
|
7273
|
+
return colors[d[0].category];
|
|
7274
|
+
}
|
|
7275
|
+
return this.chartConfiguration.lineGraphColor;
|
|
7983
7276
|
})
|
|
7984
|
-
.
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7277
|
+
.attr('stroke-width', 2.5)
|
|
7278
|
+
.attr('d', lineGen(group.values));
|
|
7279
|
+
// Draw dots
|
|
7280
|
+
const dot = svg
|
|
7281
|
+
.selectAll('myCircles')
|
|
7282
|
+
.data(group.values)
|
|
7283
|
+
.enter()
|
|
7284
|
+
.append('g')
|
|
7285
|
+
.on('click', (d) => this.handleClick(d));
|
|
7286
|
+
dot
|
|
7287
|
+
.append('circle')
|
|
7288
|
+
.attr('fill', (d) => {
|
|
7289
|
+
if ('category' in d) {
|
|
7290
|
+
return colors[d.category];
|
|
7291
|
+
}
|
|
7292
|
+
return this.chartConfiguration.lineGraphColor;
|
|
7989
7293
|
})
|
|
7990
|
-
.
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
return lineYscale(d.value);
|
|
7998
|
-
};
|
|
7999
|
-
dataGroup.forEach(function (d, i) {
|
|
8000
|
-
svg
|
|
8001
|
-
.append('path')
|
|
8002
|
-
.datum(d.values)
|
|
8003
|
-
.attr('fill', 'none')
|
|
8004
|
-
.attr('stroke', function (d) {
|
|
8005
|
-
if ('category' in d[0]) {
|
|
8006
|
-
return colors[d[0].category];
|
|
8007
|
-
}
|
|
8008
|
-
else {
|
|
8009
|
-
return self.chartConfiguration.lineGraphColor;
|
|
8010
|
-
}
|
|
8011
|
-
})
|
|
8012
|
-
.attr('stroke-width', 2.5) /**line thinkness */
|
|
8013
|
-
.attr('d', lineGen(d.values));
|
|
8014
|
-
var dot = svg
|
|
8015
|
-
.selectAll('myCircles')
|
|
8016
|
-
.data(d.values)
|
|
8017
|
-
.enter()
|
|
8018
|
-
.append('g')
|
|
8019
|
-
.on('click', function (d) {
|
|
8020
|
-
self.handleClick(d);
|
|
8021
|
-
});
|
|
7294
|
+
.attr('stroke', 'none')
|
|
7295
|
+
.attr('cx', (d) => xScale(d.name) + xScale.bandwidth() / 2)
|
|
7296
|
+
.attr('cy', (d) => lineYscale(d.value))
|
|
7297
|
+
.attr('r', 3)
|
|
7298
|
+
.style('cursor', 'pointer');
|
|
7299
|
+
// Add labels if configured
|
|
7300
|
+
if (this.chartConfiguration.lineGraphColor) {
|
|
8022
7301
|
dot
|
|
8023
|
-
.append('
|
|
8024
|
-
.attr('
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
.attr('cx', function (d, i) {
|
|
8034
|
-
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
8035
|
-
})
|
|
8036
|
-
.attr('cy', function (d, i) {
|
|
8037
|
-
return lineYscale(d.value);
|
|
8038
|
-
})
|
|
8039
|
-
.attr('r', 3) /**radius of circle=5 */
|
|
8040
|
-
.style('cursor', 'pointer');
|
|
8041
|
-
if (self.chartConfiguration.lineGraphColor) {
|
|
8042
|
-
dot
|
|
8043
|
-
.append('text')
|
|
8044
|
-
.attr('class', 'dots')
|
|
8045
|
-
.attr('fill', self.chartConfiguration.lineGraphColor)
|
|
8046
|
-
.attr('style', 'font-size: ' + '.85em;' + 'font-weight:' + 'bold')
|
|
8047
|
-
.attr('x', function (d, i) {
|
|
8048
|
-
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
8049
|
-
})
|
|
8050
|
-
.attr('y', function (d, i) {
|
|
8051
|
-
return lineYscale(d.value);
|
|
8052
|
-
})
|
|
8053
|
-
.attr('dy', '-1em')
|
|
8054
|
-
.text(function (d, i) {
|
|
8055
|
-
return self.chartConfiguration.labelFormatter(d.value);
|
|
8056
|
-
});
|
|
8057
|
-
}
|
|
8058
|
-
});
|
|
8059
|
-
}
|
|
8060
|
-
// svg.attr('width', 150).style('max-width', 150).style('overflow-x', 'auto');
|
|
7302
|
+
.append('text')
|
|
7303
|
+
.attr('class', 'dots')
|
|
7304
|
+
.attr('fill', this.chartConfiguration.lineGraphColor)
|
|
7305
|
+
.attr('style', 'font-size: 0.85em; font-weight: bold')
|
|
7306
|
+
.attr('x', (d) => xScale(d.name) + xScale.bandwidth() / 2)
|
|
7307
|
+
.attr('y', (d) => lineYscale(d.value))
|
|
7308
|
+
.attr('dy', '-1em')
|
|
7309
|
+
.text((d) => this.chartConfiguration.labelFormatter(d.value));
|
|
7310
|
+
}
|
|
7311
|
+
});
|
|
8061
7312
|
}
|
|
8062
|
-
handleClick(
|
|
8063
|
-
if (this.chartData?.metaData?.hasDrillDown ||
|
|
8064
|
-
this.clickEvent.emit(
|
|
7313
|
+
handleClick(data) {
|
|
7314
|
+
if (this.chartData?.metaData?.hasDrillDown || data?.toggleFrom) {
|
|
7315
|
+
this.clickEvent.emit(data);
|
|
7316
|
+
}
|
|
8065
7317
|
}
|
|
8066
7318
|
handleHeaderMenuClick(id) {
|
|
8067
7319
|
this.headerMenuclickEvent.emit(id);
|
|
@@ -8070,15 +7322,14 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8070
7322
|
this.clickEvent.emit(event);
|
|
8071
7323
|
}
|
|
8072
7324
|
handleZoominZoomoutClick({ isZoomOut, event }) {
|
|
8073
|
-
// this.isZoomOutSelected(isZoomOut, event);
|
|
8074
7325
|
this.isZoomOutSelected(isZoomOut);
|
|
8075
7326
|
}
|
|
8076
7327
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8077
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <!-- <span *ngIf=\"chartConfiguration.isComparebyDropdownVisible\">\r\n <lib-dropdown></lib-dropdown>\r\n </span> -->\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:1.2em}.lib-axis-group-label{font-size:.85em;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:12px;line-height:14.52px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title-top-text{color:var(--font-color)!important;font-size:14px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:17px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:12px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}@media (max-width: 575px){.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr}}@media screen and (min-width: 1024px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1366px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1920px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 2560px) and (min-height: 500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
7328
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:1.2em}.lib-axis-group-label{font-size:.85em;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:12px;line-height:14.52px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title-top-text{color:var(--font-color)!important;font-size:14px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:17px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:12px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}@media (max-width: 575px){.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr}}@media screen and (min-width: 1024px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1366px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1920px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 2560px) and (min-height: 500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
8078
7329
|
}
|
|
8079
7330
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
|
|
8080
7331
|
type: Component,
|
|
8081
|
-
args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <!-- <span *ngIf=\"chartConfiguration.isComparebyDropdownVisible\">\r\n <lib-dropdown></lib-dropdown>\r\n </span> -->\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:1.2em}.lib-axis-group-label{font-size:.85em;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:12px;line-height:14.52px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title-top-text{color:var(--font-color)!important;font-size:14px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:17px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:12px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}@media (max-width: 575px){.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr}}@media screen and (min-width: 1024px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1366px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1920px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 2560px) and (min-height: 500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
|
|
7332
|
+
args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:1.2em}.lib-axis-group-label{font-size:.85em;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:12px;line-height:14.52px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title-top-text{color:var(--font-color)!important;font-size:14px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:17px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:12px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}@media (max-width: 575px){.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr}}@media screen and (min-width: 1024px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1024px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.dots{font-size:10px!important}}@media screen and (min-width: 1366px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1366px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.dots{font-size:12px!important}}@media screen and (min-width: 1920px) and (min-height: 400px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 1920px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.dots{font-size:14px!important}}@media screen and (min-width: 2560px) and (min-height: 500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1000px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.dots{font-size:16px!important}}@media screen and (min-width: 2560px) and (min-height: 1500px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
|
|
8082
7333
|
}], ctorParameters: () => [], propDecorators: { containerElt: [{
|
|
8083
7334
|
type: ViewChild,
|
|
8084
7335
|
args: ['verticalstackedchartcontainer', { static: true }]
|
|
@@ -8204,9 +7455,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8204
7455
|
var alternate_text = false;
|
|
8205
7456
|
var short_tick_length = 4;
|
|
8206
7457
|
var long_tick_length = 16;
|
|
8207
|
-
/**
|
|
8208
|
-
* longer tick length needed for weekly charts
|
|
8209
|
-
*/
|
|
8210
7458
|
var short_tick_length_bg = 5;
|
|
8211
7459
|
var long_tick_length_bg = 30;
|
|
8212
7460
|
var leftAndRightSpaces = 50;
|
|
@@ -8218,9 +7466,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8218
7466
|
data = this.chartData.data;
|
|
8219
7467
|
metaData = this.chartData.metaData;
|
|
8220
7468
|
lineData = this.chartData.lineData;
|
|
8221
|
-
// if (lineData || this.chartData.targetLineData) {
|
|
8222
|
-
// rightSvgWidth = 60;
|
|
8223
|
-
// }
|
|
8224
7469
|
if (!metaData.colorAboveTarget) {
|
|
8225
7470
|
metaData['colorAboveTarget'] = metaData.colors;
|
|
8226
7471
|
}
|
|
@@ -8257,16 +7502,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8257
7502
|
else
|
|
8258
7503
|
width = this.chartData.data.length * 160;
|
|
8259
7504
|
}
|
|
8260
|
-
// if (this.chartData.data.length > 8) {
|
|
8261
|
-
// width = this.chartData.data.length * 140;
|
|
8262
|
-
// }
|
|
8263
7505
|
var height = parseInt(verticalstackedcontainer.style('height')) *
|
|
8264
7506
|
(self.chartConfiguration.svgHeight / 100) -
|
|
8265
7507
|
margin.top -
|
|
8266
7508
|
margin.bottom;
|
|
8267
|
-
/**
|
|
8268
|
-
* entire height used in weekly charts as x axis needed to be displayed at the bottom of the chart
|
|
8269
|
-
*/
|
|
8270
7509
|
if (this.chartConfiguration.isFullScreen != undefined &&
|
|
8271
7510
|
this.chartConfiguration.isFullScreen) {
|
|
8272
7511
|
height =
|
|
@@ -8288,30 +7527,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8288
7527
|
margin.bottom -
|
|
8289
7528
|
100;
|
|
8290
7529
|
}
|
|
8291
|
-
/**
|
|
8292
|
-
* for hiding header
|
|
8293
|
-
* used by weekly charts
|
|
8294
|
-
*/
|
|
8295
7530
|
if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
8296
7531
|
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
8297
|
-
/**
|
|
8298
|
-
* for hiding legends
|
|
8299
|
-
* used by weekly charts
|
|
8300
|
-
*/
|
|
8301
7532
|
if (this.chartConfiguration.legendVisible != undefined) {
|
|
8302
7533
|
this.legendVisible = this.chartConfiguration.legendVisible;
|
|
8303
7534
|
}
|
|
8304
|
-
/**
|
|
8305
|
-
* for removing background color so that it can take parents color
|
|
8306
|
-
*
|
|
8307
|
-
*/
|
|
8308
7535
|
if (this.chartConfiguration.isTransparentBackground != undefined) {
|
|
8309
7536
|
this.isTransparentBackground =
|
|
8310
7537
|
this.chartConfiguration.isTransparentBackground;
|
|
8311
7538
|
}
|
|
8312
|
-
/**
|
|
8313
|
-
* format data values based on configuration received
|
|
8314
|
-
*/
|
|
8315
7539
|
if (this.chartConfiguration.textFormatter != undefined) {
|
|
8316
7540
|
formatFromBackend = ChartHelper.dataValueFormatter(this.chartConfiguration.textFormatter);
|
|
8317
7541
|
formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
@@ -8324,7 +7548,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8324
7548
|
.style('height', height)
|
|
8325
7549
|
.style('overflow-x', 'hidden')
|
|
8326
7550
|
.style('padding-left', `${margin.left}px`)
|
|
8327
|
-
// .call(ChartHelper.responsivefy)
|
|
8328
7551
|
.style('padding-right', `${rightSvgWidth}px`)
|
|
8329
7552
|
.style('margin-left', '15px');
|
|
8330
7553
|
var svgYAxisLeft = outerContainer
|
|
@@ -8352,10 +7575,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8352
7575
|
.style('overflow-x', 'auto');
|
|
8353
7576
|
var svg = innerContainer
|
|
8354
7577
|
.append('svg')
|
|
8355
|
-
// .attr('id', self.uniqueId)
|
|
8356
7578
|
.attr('width', width - rightSvgWidth)
|
|
8357
7579
|
.attr('height', height + margin.top + margin.bottom + 60)
|
|
8358
|
-
// .call(ChartHelper.responsivefy)
|
|
8359
7580
|
.append('g')
|
|
8360
7581
|
.attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
|
|
8361
7582
|
var subgroups = keyList;
|
|
@@ -8364,9 +7585,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8364
7585
|
return d.name;
|
|
8365
7586
|
})
|
|
8366
7587
|
.keys();
|
|
8367
|
-
/**
|
|
8368
|
-
* x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
|
|
8369
|
-
*/
|
|
8370
7588
|
if (this.chartConfiguration.isMultiChartGridLine != undefined) {
|
|
8371
7589
|
x = d3
|
|
8372
7590
|
.scaleBand()
|
|
@@ -8384,27 +7602,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8384
7602
|
.range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
8385
7603
|
.padding([0.3]);
|
|
8386
7604
|
}
|
|
8387
|
-
// x.bandwidth(96);
|
|
8388
7605
|
var xScaleFromOrigin = d3
|
|
8389
7606
|
.scaleBand()
|
|
8390
7607
|
.domain(groups)
|
|
8391
7608
|
.range([0, width - rightSvgWidth]);
|
|
8392
|
-
// .padding([0.2]);
|
|
8393
|
-
/**
|
|
8394
|
-
* draw second x axis on top
|
|
8395
|
-
*/
|
|
8396
|
-
// if (self.chartConfiguration.showXaxisTop) {
|
|
8397
|
-
// svg
|
|
8398
|
-
// .append('g')
|
|
8399
|
-
// .attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
8400
|
-
// .attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
8401
|
-
// .call(d3.axisBottom(x).tickSize(0));
|
|
8402
|
-
// }
|
|
8403
|
-
// d3.svg.axis().scale(x).orient('bottom').ticks(1).innerTickSize(-height);
|
|
8404
7609
|
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
8405
|
-
/**
|
|
8406
|
-
* normal ticks for all dashboard charts
|
|
8407
|
-
*/
|
|
8408
7610
|
svg
|
|
8409
7611
|
.append('g')
|
|
8410
7612
|
.attr('class', 'x1 axis1')
|
|
@@ -8412,13 +7614,12 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8412
7614
|
.call(d3.axisBottom(x))
|
|
8413
7615
|
.call((g) => g.select('.domain').remove());
|
|
8414
7616
|
svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
8415
|
-
// Only move x-axis labels further down for grouped charts if there is no xLabel
|
|
8416
7617
|
if (subgroups.length > 1 && !metaData.xLabel) {
|
|
8417
7618
|
svg
|
|
8418
7619
|
.selectAll('g.x1.axis1 g.tick text')
|
|
8419
7620
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
8420
7621
|
.style('fill', 'var(--chart-text-color)')
|
|
8421
|
-
.attr('y', 32);
|
|
7622
|
+
.attr('y', 32);
|
|
8422
7623
|
}
|
|
8423
7624
|
else {
|
|
8424
7625
|
svg
|
|
@@ -8426,32 +7627,14 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8426
7627
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
8427
7628
|
.style('fill', 'var(--chart-text-color)');
|
|
8428
7629
|
}
|
|
8429
|
-
// .attr('y', function () {
|
|
8430
|
-
// if (alternate_text) {
|
|
8431
|
-
// alternate_text = false;
|
|
8432
|
-
// return long_tick_length + 1;
|
|
8433
|
-
// } else {
|
|
8434
|
-
// alternate_text = true;
|
|
8435
|
-
// return short_tick_length + 1;
|
|
8436
|
-
// }
|
|
8437
|
-
// });
|
|
8438
7630
|
}
|
|
8439
7631
|
else {
|
|
8440
|
-
/**
|
|
8441
|
-
* bigger ticks for weekly charts and more space from x axis to labels
|
|
8442
|
-
*/
|
|
8443
|
-
/**
|
|
8444
|
-
* draw x axis
|
|
8445
|
-
*/
|
|
8446
7632
|
svg
|
|
8447
7633
|
.append('g')
|
|
8448
7634
|
.attr('class', 'x1 axis1')
|
|
8449
7635
|
.attr('transform', 'translate(0,' + height + ')')
|
|
8450
7636
|
.call(d3.axisBottom(x).tickSize(0))
|
|
8451
7637
|
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
8452
|
-
/**
|
|
8453
|
-
* tick line size in alternate fashion
|
|
8454
|
-
*/
|
|
8455
7638
|
svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
|
|
8456
7639
|
if (alternate_text &&
|
|
8457
7640
|
self.chartConfiguration.isNoAlternateXaxisText == undefined) {
|
|
@@ -8463,19 +7646,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8463
7646
|
return short_tick_length_bg - 4;
|
|
8464
7647
|
}
|
|
8465
7648
|
});
|
|
8466
|
-
/**
|
|
8467
|
-
* reset the flag so that values can be shown in same alternate fashion
|
|
8468
|
-
*/
|
|
8469
7649
|
alternate_text = false;
|
|
8470
|
-
/**
|
|
8471
|
-
* print x-axis label texts
|
|
8472
|
-
* used by weekly charts
|
|
8473
|
-
*/
|
|
8474
7650
|
svg
|
|
8475
7651
|
.selectAll('g.x1.axis1 g.tick text')
|
|
8476
7652
|
.attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
8477
7653
|
.attr('y', function () {
|
|
8478
|
-
// Minimize gap in maximized (fullscreen) view for weekly charts
|
|
8479
7654
|
if (self.chartConfiguration.isFullScreen) {
|
|
8480
7655
|
return short_tick_length_bg;
|
|
8481
7656
|
}
|
|
@@ -8496,7 +7671,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8496
7671
|
.style('font-size', this.isHeaderVisible ? '18px' : '14px')
|
|
8497
7672
|
.attr('text-anchor', 'middle')
|
|
8498
7673
|
.attr('y', function (d) {
|
|
8499
|
-
// For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
|
|
8500
7674
|
if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
8501
7675
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8502
7676
|
if (self.chartConfiguration.isFullScreen) {
|
|
@@ -8504,16 +7678,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8504
7678
|
}
|
|
8505
7679
|
return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
8506
7680
|
}
|
|
8507
|
-
// For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
8508
7681
|
if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
8509
7682
|
const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
|
|
8510
7683
|
if (self.chartConfiguration.isFullScreen) {
|
|
8511
|
-
// Reduce extra gap in maximized view
|
|
8512
7684
|
return short_tick_length_bg + 2;
|
|
8513
7685
|
}
|
|
8514
7686
|
return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
|
|
8515
7687
|
}
|
|
8516
|
-
// Default/fallback logic for other cases
|
|
8517
7688
|
let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
|
|
8518
7689
|
if (subgroups.length > 1 &&
|
|
8519
7690
|
!metaData.xLabel &&
|
|
@@ -8523,7 +7694,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8523
7694
|
if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
|
|
8524
7695
|
baseY += 4;
|
|
8525
7696
|
}
|
|
8526
|
-
// In maximized view, reduce baseY slightly for grouped bars
|
|
8527
7697
|
if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
|
|
8528
7698
|
baseY = Math.max(short_tick_length_bg, baseY - 10);
|
|
8529
7699
|
}
|
|
@@ -8531,9 +7701,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8531
7701
|
})
|
|
8532
7702
|
.attr('x', function (d) {
|
|
8533
7703
|
if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
8534
|
-
return 1;
|
|
7704
|
+
return 1;
|
|
8535
7705
|
}
|
|
8536
|
-
return 0;
|
|
7706
|
+
return 0;
|
|
8537
7707
|
})
|
|
8538
7708
|
.text(function (d) {
|
|
8539
7709
|
var isValueToBeIgnored = false;
|
|
@@ -8551,13 +7721,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8551
7721
|
if (isValueToBeIgnored) {
|
|
8552
7722
|
return '';
|
|
8553
7723
|
}
|
|
8554
|
-
// Always add space before and after hyphen for date range labels, even when header is visible and label is single line
|
|
8555
|
-
// Apply for grouped bar charts and single bar charts, header visible, single line
|
|
8556
7724
|
const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
8557
7725
|
if (dateRangeRegex.test(d.trim())) {
|
|
8558
7726
|
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8559
7727
|
}
|
|
8560
|
-
// Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
|
|
8561
7728
|
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
8562
7729
|
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8563
7730
|
if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
|
|
@@ -8565,7 +7732,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8565
7732
|
var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
8566
7733
|
return first + '\n' + second;
|
|
8567
7734
|
}
|
|
8568
|
-
// Also keep previous logic for minimized view
|
|
8569
7735
|
if (isDateLabel) {
|
|
8570
7736
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
8571
7737
|
var first = d.substring(0, d.indexOf(' '));
|
|
@@ -8580,9 +7746,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8580
7746
|
return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
8581
7747
|
}
|
|
8582
7748
|
return d.toLowerCase();
|
|
8583
|
-
// If label looks like a date (contains digits and - or /)
|
|
8584
7749
|
const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
|
|
8585
|
-
// Only split date/week labels if there are many grouped bars and header is not visible
|
|
8586
7750
|
if (isDateLabel) {
|
|
8587
7751
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
8588
7752
|
var first = d.substring(0, d.indexOf(' '));
|
|
@@ -8598,9 +7762,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8598
7762
|
}
|
|
8599
7763
|
return d.toLowerCase();
|
|
8600
7764
|
});
|
|
8601
|
-
// Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
|
|
8602
7765
|
xAxisLabels.each(function (d) {
|
|
8603
|
-
// Only apply writing-mode for exact date labels, not those containing 'week' or similar
|
|
8604
7766
|
const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
8605
7767
|
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8606
7768
|
if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
@@ -8611,7 +7773,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8611
7773
|
svg
|
|
8612
7774
|
.selectAll('g.x1.axis1 g.tick')
|
|
8613
7775
|
.filter(function (d) {
|
|
8614
|
-
return !/\d{2,4}[-\/]/.test(d);
|
|
7776
|
+
return !/\d{2,4}[-\/]/.test(d);
|
|
8615
7777
|
})
|
|
8616
7778
|
.append('text')
|
|
8617
7779
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
@@ -8619,9 +7781,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8619
7781
|
.attr('fill', 'var(--chart-text-color)')
|
|
8620
7782
|
.attr('x', function (d) {
|
|
8621
7783
|
if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
8622
|
-
return 1;
|
|
7784
|
+
return 1;
|
|
8623
7785
|
}
|
|
8624
|
-
return 0;
|
|
7786
|
+
return 0;
|
|
8625
7787
|
})
|
|
8626
7788
|
.text(function (d) {
|
|
8627
7789
|
if (d.trim().indexOf(' ') > -1) {
|
|
@@ -8648,7 +7810,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8648
7810
|
.selectAll('g.x1.axis1 g.tick text')
|
|
8649
7811
|
.classed('mobile-xaxis-override', true);
|
|
8650
7812
|
}
|
|
8651
|
-
/**y scale for left y axis */
|
|
8652
7813
|
var y = d3.scaleLinear().rangeRound([height, 0]);
|
|
8653
7814
|
var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
|
|
8654
7815
|
if (maxValue == 0) {
|
|
@@ -8659,27 +7820,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8659
7820
|
maxValue = 100;
|
|
8660
7821
|
}
|
|
8661
7822
|
}
|
|
8662
|
-
if (self.chartConfiguration.yAxisGrid) {
|
|
8663
|
-
// svg
|
|
8664
|
-
// .append('g')
|
|
8665
|
-
// .attr('class', 'grid')
|
|
8666
|
-
// .call(
|
|
8667
|
-
// d3
|
|
8668
|
-
// .axisLeft(y)
|
|
8669
|
-
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
8670
|
-
// .tickSize(-width)
|
|
8671
|
-
// .tickFormat('')
|
|
8672
|
-
// )
|
|
8673
|
-
// // .style('stroke-dasharray', '5 5')
|
|
8674
|
-
// .style('color', '#B9B9B9')
|
|
8675
|
-
// .style('opacity', '0.5')
|
|
8676
|
-
// .call((g) => g.select('.domain').remove());
|
|
8677
|
-
}
|
|
8678
7823
|
if (this.chartConfiguration.customYscale) {
|
|
8679
|
-
/**
|
|
8680
|
-
* increase y-scale so that values wont cross or exceed out of range
|
|
8681
|
-
* used in weekly charts
|
|
8682
|
-
*/
|
|
8683
7824
|
maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
8684
7825
|
}
|
|
8685
7826
|
if (this.chartData.targetLineData &&
|
|
@@ -8717,10 +7858,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8717
7858
|
.tickSize(0)
|
|
8718
7859
|
.tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
8719
7860
|
}
|
|
8720
|
-
/**
|
|
8721
|
-
* show x-axis grid between labels
|
|
8722
|
-
* used by weekly charts
|
|
8723
|
-
*/
|
|
8724
7861
|
if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
8725
7862
|
svg
|
|
8726
7863
|
.append('g')
|
|
@@ -8728,7 +7865,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8728
7865
|
.attr('transform', 'translate(' + x.bandwidth() / 2 + ',' + height + ')')
|
|
8729
7866
|
.call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
|
|
8730
7867
|
.style('stroke-dasharray', '5 5')
|
|
8731
|
-
.style('color', 'var(--chart-grid-color, #999999)')
|
|
7868
|
+
.style('color', 'var(--chart-grid-color, #999999)')
|
|
8732
7869
|
.call((g) => g.select('.domain').remove());
|
|
8733
7870
|
}
|
|
8734
7871
|
if (this.chartConfiguration.yAxisGrid) {
|
|
@@ -8743,7 +7880,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8743
7880
|
.call((g) => {
|
|
8744
7881
|
g.select('.domain')
|
|
8745
7882
|
.remove()
|
|
8746
|
-
.style('stroke', 'var(--chart-domain-color, #000000)');
|
|
7883
|
+
.style('stroke', 'var(--chart-domain-color, #000000)');
|
|
8747
7884
|
});
|
|
8748
7885
|
}
|
|
8749
7886
|
else {
|
|
@@ -8754,36 +7891,27 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8754
7891
|
.style('opacity', '0.5')
|
|
8755
7892
|
.call((g) => {
|
|
8756
7893
|
g.select('.domain')
|
|
8757
|
-
.style('stroke', 'var(--chart-domain-color, #000000)')
|
|
8758
|
-
.style('stroke-width', '1px');
|
|
7894
|
+
.style('stroke', 'var(--chart-domain-color, #000000)')
|
|
7895
|
+
.style('stroke-width', '1px');
|
|
8759
7896
|
});
|
|
8760
7897
|
}
|
|
8761
7898
|
var xSubgroup = d3.scaleBand().domain(subgroups);
|
|
8762
7899
|
if (subgroups.length > 1 && !this.isZoomedOut) {
|
|
8763
|
-
// For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
|
|
8764
7900
|
xSubgroup.range([0, x.bandwidth()]);
|
|
8765
7901
|
}
|
|
8766
7902
|
else if (subgroups.length === 1 && !this.isZoomedOut) {
|
|
8767
|
-
// For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
|
|
8768
7903
|
xSubgroup.range([0, 100]);
|
|
8769
7904
|
}
|
|
8770
7905
|
else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
8771
7906
|
xSubgroup.range([0, x.bandwidth()]);
|
|
8772
7907
|
}
|
|
8773
7908
|
else {
|
|
8774
|
-
// used to make grouped bars with lesser width as we are not using padding for width
|
|
8775
7909
|
xSubgroup.range([0, x.bandwidth()]);
|
|
8776
7910
|
}
|
|
8777
|
-
// if (this.chartConfiguration.isDrilldownChart) {
|
|
8778
|
-
// }
|
|
8779
7911
|
var color = d3
|
|
8780
7912
|
.scaleOrdinal()
|
|
8781
7913
|
.domain(subgroups)
|
|
8782
7914
|
.range(Object.values(metaData.colors));
|
|
8783
|
-
// var colorAboveTarget = d3
|
|
8784
|
-
// .scaleOrdinal()
|
|
8785
|
-
// .domain(subgroups)
|
|
8786
|
-
// .range(Object.values(metaData.colorAboveTarget));
|
|
8787
7915
|
var state = svg
|
|
8788
7916
|
.append('g')
|
|
8789
7917
|
.selectAll('.state')
|
|
@@ -8798,10 +7926,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8798
7926
|
.data(function (d) {
|
|
8799
7927
|
let newList = [];
|
|
8800
7928
|
subgroups.map(function (key) {
|
|
8801
|
-
// if (key !== "group") {
|
|
8802
7929
|
let obj = { key: key, value: d[key], name: d.name };
|
|
8803
7930
|
newList.push(obj);
|
|
8804
|
-
// }
|
|
8805
7931
|
});
|
|
8806
7932
|
return newList;
|
|
8807
7933
|
})
|
|
@@ -8814,7 +7940,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8814
7940
|
!metaData.barWithoutClick.length ||
|
|
8815
7941
|
(!metaData.barWithoutClick.includes(d?.name) &&
|
|
8816
7942
|
!metaData.barWithoutClick.includes(d?.key)))
|
|
8817
|
-
// self.handleClick(d.data.name);
|
|
8818
7943
|
self.handleClick(d);
|
|
8819
7944
|
}
|
|
8820
7945
|
})
|
|
@@ -8825,7 +7950,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8825
7950
|
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8826
7951
|
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8827
7952
|
if (x.bandwidth() > 100) {
|
|
8828
|
-
// Increase bar width a bit in zoom-in view
|
|
8829
7953
|
let reducedBarWidth = 60;
|
|
8830
7954
|
if (!self.isZoomedOut) {
|
|
8831
7955
|
reducedBarWidth = 30;
|
|
@@ -8867,23 +7991,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8867
7991
|
return y(0);
|
|
8868
7992
|
})
|
|
8869
7993
|
.attr('width', function (d) {
|
|
8870
|
-
// For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
|
|
8871
7994
|
if (subgroups.length > 1 && !self.isZoomedOut) {
|
|
8872
7995
|
return 50;
|
|
8873
7996
|
}
|
|
8874
|
-
// For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
8875
7997
|
if (subgroups.length === 1 && !self.isZoomedOut) {
|
|
8876
7998
|
return 80;
|
|
8877
7999
|
}
|
|
8878
8000
|
let tempScale = d3.scaleBand().domain([]).range([0, 0]);
|
|
8879
|
-
// Default logic for other chart types
|
|
8880
8001
|
if (self.chartConfiguration.isDrilldownChart) {
|
|
8881
8002
|
data.map((indiv) => {
|
|
8882
8003
|
if (indiv.name == d.name) {
|
|
8883
8004
|
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8884
8005
|
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8885
8006
|
if (x.bandwidth() > 100) {
|
|
8886
|
-
// Increase bar width a bit in zoom-in view
|
|
8887
8007
|
let reducedBarWidth = 60;
|
|
8888
8008
|
if (!self.isZoomedOut) {
|
|
8889
8009
|
reducedBarWidth = 100;
|
|
@@ -8951,9 +8071,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8951
8071
|
}
|
|
8952
8072
|
return self.chartData.metaData.colors[d.key];
|
|
8953
8073
|
});
|
|
8954
|
-
/**
|
|
8955
|
-
* display angled texts on the bars
|
|
8956
|
-
*/
|
|
8957
8074
|
if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
|
|
8958
8075
|
state
|
|
8959
8076
|
.selectAll('text')
|
|
@@ -8988,7 +8105,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8988
8105
|
.style('font-weight', 'bold')
|
|
8989
8106
|
.style('font-size', function (d) {
|
|
8990
8107
|
if (self.isZoomedOut) {
|
|
8991
|
-
return '9px';
|
|
8108
|
+
return '9px';
|
|
8992
8109
|
}
|
|
8993
8110
|
if (self.chartConfiguration.isDrilldownChart) {
|
|
8994
8111
|
if (window.innerWidth > 1900) {
|
|
@@ -9018,14 +8135,12 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9018
8135
|
0 + (x.bandwidth() - 200) / 2,
|
|
9019
8136
|
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
9020
8137
|
]);
|
|
9021
|
-
// .padding(0.05);
|
|
9022
8138
|
}
|
|
9023
8139
|
else
|
|
9024
8140
|
tempScale.range([
|
|
9025
8141
|
0 + (x.bandwidth() - 300) / 2,
|
|
9026
8142
|
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
9027
8143
|
]);
|
|
9028
|
-
// .padding(0.05);
|
|
9029
8144
|
}
|
|
9030
8145
|
else
|
|
9031
8146
|
tempScale.range([
|
|
@@ -9035,16 +8150,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9035
8150
|
}
|
|
9036
8151
|
}
|
|
9037
8152
|
});
|
|
9038
|
-
/**
|
|
9039
|
-
* if set, then all texts ll be horizontal
|
|
9040
|
-
*/
|
|
9041
8153
|
if (self.chartConfiguration.textAlwaysHorizontal) {
|
|
9042
8154
|
return ('translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')');
|
|
9043
8155
|
}
|
|
9044
|
-
/**
|
|
9045
|
-
* rotate texts having more than one digits
|
|
9046
|
-
*/
|
|
9047
|
-
// if (d.value > 9)
|
|
9048
8156
|
if (!isNaN(tempScale(d.key)))
|
|
9049
8157
|
return ('translate(' +
|
|
9050
8158
|
(tempScale(d.key) + tempScale.bandwidth() * 0.55) +
|
|
@@ -9052,14 +8160,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9052
8160
|
(y(0) - 10) +
|
|
9053
8161
|
') rotate(270)');
|
|
9054
8162
|
return 'translate(0,0)';
|
|
9055
|
-
// else
|
|
9056
|
-
// return (
|
|
9057
|
-
// 'translate(' +
|
|
9058
|
-
// (tempScale(d.key) + tempScale.bandwidth() / 2) +
|
|
9059
|
-
// ',' +
|
|
9060
|
-
// y(0) +
|
|
9061
|
-
// ')'
|
|
9062
|
-
// );
|
|
9063
8163
|
})
|
|
9064
8164
|
.on('click', function (d) {
|
|
9065
8165
|
if (!metaData.barWithoutClick ||
|
|
@@ -9089,7 +8189,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9089
8189
|
svg
|
|
9090
8190
|
.append('foreignObject')
|
|
9091
8191
|
.attr('x', function () {
|
|
9092
|
-
// ...existing code for tempScale calculation...
|
|
9093
8192
|
var elementsCounter;
|
|
9094
8193
|
data.map((indiv) => {
|
|
9095
8194
|
if (indiv.name == d.name) {
|
|
@@ -9198,7 +8297,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9198
8297
|
.append('g')
|
|
9199
8298
|
.attr('class', 'x2 axis2')
|
|
9200
8299
|
.attr('transform', 'translate(0,' + height + ')')
|
|
9201
|
-
.style('color', 'var(--chart-axis-color, #000)')
|
|
8300
|
+
.style('color', 'var(--chart-axis-color, #000)')
|
|
9202
8301
|
.call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
9203
8302
|
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
9204
8303
|
svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
@@ -9226,7 +8325,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9226
8325
|
return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
|
|
9227
8326
|
}))
|
|
9228
8327
|
.call((g) => {
|
|
9229
|
-
// Style the domain line for theme support
|
|
9230
8328
|
g.select('.domain')
|
|
9231
8329
|
.style('stroke', 'var(--chart-domain-color, #000000)')
|
|
9232
8330
|
.style('stroke-width', '1px');
|
|
@@ -9240,40 +8338,23 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9240
8338
|
.attr('transform', 'translate(0,0)')
|
|
9241
8339
|
.call(y)
|
|
9242
8340
|
.style('display', 'none');
|
|
9243
|
-
/**
|
|
9244
|
-
* hide x axis labels
|
|
9245
|
-
* config is there for future use
|
|
9246
|
-
* used by weekly charts
|
|
9247
|
-
*/
|
|
9248
8341
|
if (this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
9249
8342
|
this.chartConfiguration.isXaxisLabelHidden) {
|
|
9250
8343
|
d3.selectAll('g.lib-line-x-axis-text > g > text').attr('class', 'lib-display-hidden');
|
|
9251
8344
|
}
|
|
9252
|
-
/**
|
|
9253
|
-
* hide y axis labels
|
|
9254
|
-
* used by weekly charts
|
|
9255
|
-
*/
|
|
9256
8345
|
if (this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
9257
8346
|
this.chartConfiguration.isYaxisLabelHidden) {
|
|
9258
8347
|
d3.selectAll('.yaxis-dashed > g > text').attr('class', 'lib-display-hidden');
|
|
9259
8348
|
}
|
|
9260
|
-
/**
|
|
9261
|
-
* hide y axis labels
|
|
9262
|
-
* config is there for future use
|
|
9263
|
-
*/
|
|
9264
8349
|
if (this.chartConfiguration.isYaxisHidden != undefined &&
|
|
9265
8350
|
this.chartConfiguration.isYaxisHidden) {
|
|
9266
8351
|
d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
|
|
9267
8352
|
}
|
|
9268
|
-
/**
|
|
9269
|
-
* dashed y axis
|
|
9270
|
-
* used by weekly charts
|
|
9271
|
-
*/
|
|
9272
8353
|
if (this.chartConfiguration.isYaxisDashed != undefined &&
|
|
9273
8354
|
this.chartConfiguration.isYaxisDashed) {
|
|
9274
8355
|
d3.selectAll('.yaxis-dashed')
|
|
9275
8356
|
.style('stroke-dasharray', '5 5')
|
|
9276
|
-
.style('color', 'var(--chart-axis-color, #999999)');
|
|
8357
|
+
.style('color', 'var(--chart-axis-color, #999999)');
|
|
9277
8358
|
}
|
|
9278
8359
|
if (lineData != null) {
|
|
9279
8360
|
if (lineData && self.chartConfiguration.showLineChartAxis) {
|
|
@@ -9285,28 +8366,12 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9285
8366
|
.call(yLineAxis);
|
|
9286
8367
|
}
|
|
9287
8368
|
}
|
|
9288
|
-
/**
|
|
9289
|
-
* used to display y label
|
|
9290
|
-
*/
|
|
9291
|
-
// if (this.isZoomedOut) {
|
|
9292
|
-
// svg
|
|
9293
|
-
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
9294
|
-
// .attr('class', 'lib-display-hidden');
|
|
9295
|
-
// }
|
|
9296
8369
|
if (this.isZoomedOut) {
|
|
9297
|
-
// svg
|
|
9298
|
-
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
9299
|
-
// .attr('transform', 'rotate(-30)')
|
|
9300
|
-
// .attr('text-anchor', 'end')
|
|
9301
|
-
// .attr('x', '-5')
|
|
9302
|
-
// .attr('dy', null)
|
|
9303
|
-
// .style('fill', 'var(--chart-text-color)');
|
|
9304
8370
|
svg
|
|
9305
8371
|
.selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
9306
8372
|
.each((d, i, nodes) => {
|
|
9307
8373
|
const text = d3.select(nodes[i]);
|
|
9308
8374
|
const label = text.text();
|
|
9309
|
-
// If label contains \n, split and use tspan for each line
|
|
9310
8375
|
if (label.indexOf('\n') > -1) {
|
|
9311
8376
|
const lines = label.split('\n');
|
|
9312
8377
|
text.text(null);
|
|
@@ -9318,7 +8383,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9318
8383
|
});
|
|
9319
8384
|
}
|
|
9320
8385
|
else {
|
|
9321
|
-
// Fallback: split by space for other labels
|
|
9322
8386
|
const words = label.split(' ');
|
|
9323
8387
|
text.text(null);
|
|
9324
8388
|
words.forEach((word, index) => {
|
|
@@ -9327,15 +8391,11 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9327
8391
|
}
|
|
9328
8392
|
})
|
|
9329
8393
|
.style('fill', 'var(--chart-text-color)')
|
|
9330
|
-
.attr('transform', null);
|
|
9331
|
-
// Optional: Adjust bottom margin or chart layout
|
|
8394
|
+
.attr('transform', null);
|
|
9332
8395
|
svg
|
|
9333
8396
|
.select('.x-axis')
|
|
9334
8397
|
.attr('transform', `translate(0, ${height - margin.bottom + 10})`);
|
|
9335
8398
|
}
|
|
9336
|
-
/**
|
|
9337
|
-
* used to write y labels based on configuration
|
|
9338
|
-
*/
|
|
9339
8399
|
if (metaData.yLabel) {
|
|
9340
8400
|
const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
|
|
9341
8401
|
svgYAxisLeft
|
|
@@ -9371,13 +8431,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9371
8431
|
.attr('y2', yZero)
|
|
9372
8432
|
.style('stroke-dasharray', '5 5')
|
|
9373
8433
|
.style('stroke', this.chartData.targetLineData.color);
|
|
9374
|
-
// svgYAxisRight
|
|
9375
|
-
// .append('line')
|
|
9376
|
-
// .attr('x1', 0)
|
|
9377
|
-
// .attr('x2', rightSvgWidth)
|
|
9378
|
-
// .attr('y1', yZero)
|
|
9379
|
-
// .attr('y2', yZero)
|
|
9380
|
-
// .style('stroke', this.chartData.targetLineData.color);
|
|
9381
8434
|
svgYAxisRight
|
|
9382
8435
|
.append('foreignObject')
|
|
9383
8436
|
.attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
|
|
@@ -9405,13 +8458,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
9405
8458
|
});
|
|
9406
8459
|
}
|
|
9407
8460
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
9408
|
-
/**
|
|
9409
|
-
* used by drilldown charts
|
|
9410
|
-
*/
|
|
9411
|
-
// svg
|
|
9412
|
-
// .selectAll('.lib-axis-group-label')
|
|
9413
|
-
// .attr('class', 'lib-ylabel-drilldowncharts')
|
|
9414
|
-
// .text(metaData.yLabel.toLowerCase());
|
|
9415
8461
|
svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
|
|
9416
8462
|
}
|
|
9417
8463
|
if (metaData.xLabel) {
|