axidio-styleguide-library1-v2 0.0.888 → 0.0.889
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.
|
@@ -3664,194 +3664,181 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3664
3664
|
super();
|
|
3665
3665
|
this.clickEvent = new EventEmitter();
|
|
3666
3666
|
this.headerMenuclickEvent = new EventEmitter();
|
|
3667
|
+
this.chartConfiguration = {};
|
|
3667
3668
|
this.isHeaderVisible = true;
|
|
3668
|
-
this.
|
|
3669
|
+
this.isTopCaptionVisible = true;
|
|
3670
|
+
this.uniqueId = this.getUniqueId();
|
|
3669
3671
|
this.isTransparentBackground = false;
|
|
3670
|
-
this.chartConfiguration = {};
|
|
3671
|
-
this.objectKeys = Object.keys;
|
|
3672
3672
|
this.defaultConfiguration = {
|
|
3673
3673
|
margin: { top: 20, right: 20, bottom: 20, left: 40 },
|
|
3674
|
-
labelFormatter: ChartHelper.defaultFormatter,
|
|
3675
3674
|
svgHeight: 70,
|
|
3675
|
+
legendHeight: '10%',
|
|
3676
3676
|
numberOfYTicks: 5,
|
|
3677
|
-
|
|
3678
|
-
|
|
3677
|
+
labelFormatter: ChartHelper.defaultFormatter,
|
|
3678
|
+
xAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
3679
3679
|
yAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
3680
|
+
yLineAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
3680
3681
|
lineGraphColor: '#F6D283',
|
|
3681
3682
|
showLineChartAxis: true,
|
|
3682
|
-
|
|
3683
|
+
showLegend: false,
|
|
3684
|
+
forComparison: true,
|
|
3683
3685
|
headerMenuOptions: HeaderConfigHelper.headerConfig.headerMenuOptions,
|
|
3684
|
-
xAxisGrid: undefined,
|
|
3685
3686
|
yAxisGrid: false,
|
|
3686
|
-
legendVisible: true,
|
|
3687
3687
|
isHeaderVisible: undefined,
|
|
3688
3688
|
isTransparentBackground: undefined,
|
|
3689
|
+
isTopCaptionVisible: undefined,
|
|
3689
3690
|
isMultiChartGridLine: undefined,
|
|
3690
3691
|
isFullScreen: undefined,
|
|
3691
3692
|
customYscale: undefined,
|
|
3692
|
-
textsOnBar: undefined,
|
|
3693
3693
|
isXaxisLabelHidden: undefined,
|
|
3694
|
-
isYaxisLabelHidden:
|
|
3694
|
+
isYaxisLabelHidden: undefined,
|
|
3695
3695
|
isYaxisHidden: undefined,
|
|
3696
3696
|
isYaxisDashed: undefined,
|
|
3697
|
+
isXaxisColor: undefined,
|
|
3697
3698
|
textFormatter: undefined,
|
|
3699
|
+
showTotalOnTop: undefined,
|
|
3700
|
+
backendFormatterHasPriority: undefined,
|
|
3701
|
+
showAngledLabels: undefined,
|
|
3698
3702
|
isNoAlternateXaxisText: undefined,
|
|
3699
3703
|
isXgridBetweenLabels: undefined,
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
isXaxisColor: '#999999',
|
|
3703
|
-
labelOverlapMinorFix: true,
|
|
3704
|
-
noHoverEffect: true,
|
|
3705
|
-
noHoverDisplayData: true,
|
|
3706
|
-
showXaxisTop: true,
|
|
3707
|
-
displayYaxisLabels: undefined,
|
|
3704
|
+
showXaxisTop: undefined,
|
|
3705
|
+
xAxisGrid: undefined,
|
|
3708
3706
|
xLabelsOnSameLine: undefined,
|
|
3709
|
-
|
|
3710
|
-
legendAtTopRight: undefined,
|
|
3707
|
+
hideXaxisTick: undefined,
|
|
3711
3708
|
isDrilldownChart: undefined,
|
|
3709
|
+
isTargetLine: undefined,
|
|
3712
3710
|
displayTitleOnTop: undefined,
|
|
3713
3711
|
isToggleVisible: undefined,
|
|
3714
3712
|
isTitleHidden: undefined,
|
|
3715
|
-
isDisplayBarDetailsAtBottom: undefined,
|
|
3716
|
-
howmanyBarDetailsToDisplay: 0,
|
|
3717
|
-
barVauleColor: undefined,
|
|
3718
3713
|
};
|
|
3719
|
-
this.
|
|
3714
|
+
this.isCC = false;
|
|
3720
3715
|
this.isZoomedOut = false;
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
this.
|
|
3724
|
-
|
|
3725
|
-
|
|
3716
|
+
}
|
|
3717
|
+
isZoomOutSelected(isZoomOut) {
|
|
3718
|
+
this.isZoomedOut = isZoomOut;
|
|
3719
|
+
this.ngOnChanges();
|
|
3720
|
+
}
|
|
3721
|
+
ngOnChanges() {
|
|
3722
|
+
let self = this;
|
|
3723
|
+
d3.select('#' + self.uniqueId).remove();
|
|
3724
|
+
this.initializeStackedChart();
|
|
3726
3725
|
}
|
|
3727
3726
|
onResized(event) {
|
|
3728
3727
|
let self = this;
|
|
3729
3728
|
setTimeout(function () {
|
|
3730
3729
|
d3.select('#' + self.uniqueId).remove();
|
|
3731
|
-
self.
|
|
3730
|
+
self.initializeStackedChart();
|
|
3732
3731
|
}.bind(self), 10);
|
|
3733
3732
|
}
|
|
3734
|
-
isZoomOutSelected(isZoomOut, event) {
|
|
3735
|
-
this.isZoomedOut = isZoomOut;
|
|
3736
|
-
this.onResized(event);
|
|
3737
|
-
}
|
|
3738
|
-
handleZoominZoomoutClick({ isZoomOut, event }) {
|
|
3739
|
-
this.isZoomOutSelected(isZoomOut, event);
|
|
3740
|
-
}
|
|
3741
3733
|
ngOnInit() { }
|
|
3742
|
-
|
|
3743
|
-
if (this.chartData &&
|
|
3744
|
-
this.chartData.metaData.colors &&
|
|
3745
|
-
Object.keys(this.chartData.metaData.colors).length > 1) {
|
|
3746
|
-
return true;
|
|
3747
|
-
}
|
|
3748
|
-
return false;
|
|
3749
|
-
}
|
|
3750
|
-
get isAlertEnabled() {
|
|
3751
|
-
return this.chartConfiguration?.headerMenuOptions?.some(option => option.id === 'editAlert');
|
|
3752
|
-
}
|
|
3753
|
-
initializegroupChart() {
|
|
3734
|
+
initializeStackedChart() {
|
|
3754
3735
|
var self = this;
|
|
3755
3736
|
let data = [];
|
|
3756
3737
|
let metaData = null;
|
|
3757
3738
|
let keyList = null;
|
|
3758
3739
|
let lineData = null;
|
|
3759
|
-
let
|
|
3760
|
-
var formatFromBackend;
|
|
3761
|
-
var formatForHugeNumbers;
|
|
3762
|
-
var x;
|
|
3740
|
+
let colors = null;
|
|
3763
3741
|
var alternate_text = false;
|
|
3742
|
+
var alternate_label = false;
|
|
3764
3743
|
var short_tick_length = 4;
|
|
3765
3744
|
var long_tick_length = 16;
|
|
3766
|
-
/**
|
|
3767
|
-
* longer tick length needed for weekly charts
|
|
3768
|
-
*/
|
|
3769
3745
|
var short_tick_length_bg = 5;
|
|
3770
3746
|
var long_tick_length_bg = 30;
|
|
3771
|
-
var
|
|
3747
|
+
var formatFromBackend;
|
|
3748
|
+
var formatForHugeNumbers;
|
|
3749
|
+
var tempObjectHolder = {};
|
|
3772
3750
|
var rightSvgWidth = 60;
|
|
3773
|
-
var
|
|
3751
|
+
var leftAndRightSpaces = 50;
|
|
3752
|
+
let isria = this.customChartConfiguration.isRia;
|
|
3753
|
+
// Responsive breakpoints
|
|
3754
|
+
const isMobile = window.innerWidth < 576;
|
|
3755
|
+
const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
|
|
3756
|
+
const isDesktop = window.innerWidth >= 992;
|
|
3757
|
+
// Adjust margins and font sizes based on device
|
|
3758
|
+
if (isMobile) {
|
|
3759
|
+
this.chartConfiguration.margin = { top: 20, right: 10, bottom: 40, left: 30 };
|
|
3760
|
+
this.chartConfiguration.numberOfYTicks = 4;
|
|
3761
|
+
this.chartConfiguration.svgHeight = 60;
|
|
3762
|
+
}
|
|
3763
|
+
else if (isTablet) {
|
|
3764
|
+
this.chartConfiguration.margin = { top: 25, right: 20, bottom: 45, left: 40 };
|
|
3765
|
+
this.chartConfiguration.numberOfYTicks = 6;
|
|
3766
|
+
this.chartConfiguration.svgHeight = 70;
|
|
3767
|
+
}
|
|
3768
|
+
else {
|
|
3769
|
+
this.chartConfiguration.margin = { top: 30, right: 30, bottom: 50, left: 60 };
|
|
3770
|
+
this.chartConfiguration.numberOfYTicks = 7;
|
|
3771
|
+
this.chartConfiguration.svgHeight = 80;
|
|
3772
|
+
}
|
|
3774
3773
|
for (var i in this.defaultConfiguration) {
|
|
3775
3774
|
this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(i, this.defaultConfiguration, this.customChartConfiguration);
|
|
3776
3775
|
}
|
|
3777
3776
|
data = this.chartData.data;
|
|
3778
3777
|
metaData = this.chartData.metaData;
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
if (!metaData.colorAboveTarget) {
|
|
3784
|
-
metaData['colorAboveTarget'] = metaData.colors;
|
|
3778
|
+
if (metaData.unit == undefined)
|
|
3779
|
+
metaData.unit = '';
|
|
3780
|
+
if (metaData.isCC) {
|
|
3781
|
+
this.isCC = metaData.isCC;
|
|
3785
3782
|
}
|
|
3786
|
-
|
|
3783
|
+
if (metaData.barWithoutClick && metaData.barWithoutClick.length) {
|
|
3784
|
+
metaData.barWithoutClick = metaData.barWithoutClick.map((ele) => ele.toLowerCase());
|
|
3785
|
+
}
|
|
3786
|
+
else {
|
|
3787
|
+
metaData.barWithoutClick = [];
|
|
3788
|
+
}
|
|
3789
|
+
lineData = this.chartData.lineData;
|
|
3790
|
+
colors = metaData.colors;
|
|
3787
3791
|
keyList = metaData.keyList;
|
|
3788
3792
|
var chartContainer = d3.select(this.containerElt.nativeElement);
|
|
3789
|
-
var verticalstackedcontainer = d3.select(this.
|
|
3793
|
+
var verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
|
|
3794
|
+
let parsedNum = parseFloat(this.chartData?.targetLineData?.target);
|
|
3795
|
+
if (!isNaN(parsedNum)) {
|
|
3796
|
+
if (Number.isInteger(parsedNum)) {
|
|
3797
|
+
parsedNum = parseInt(this.chartData.targetLineData.target);
|
|
3798
|
+
}
|
|
3799
|
+
else {
|
|
3800
|
+
parsedNum = parseFloat(this.chartData.targetLineData.target);
|
|
3801
|
+
}
|
|
3802
|
+
}
|
|
3790
3803
|
var margin = this.chartConfiguration.margin;
|
|
3791
|
-
|
|
3804
|
+
// Responsive width and height
|
|
3805
|
+
var containerWidth = chartContainer.node().getBoundingClientRect().width;
|
|
3806
|
+
var containerHeight = verticalstackedcontainer.node().getBoundingClientRect().height;
|
|
3807
|
+
var width = containerWidth - margin.left - margin.right;
|
|
3808
|
+
var height = containerHeight * (self.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
|
|
3809
|
+
// Adjust width for large datasets and zoom
|
|
3792
3810
|
if (this.chartData.data.length > 30 && this.isZoomedOut) {
|
|
3793
|
-
width =
|
|
3794
|
-
width
|
|
3795
|
-
|
|
3796
|
-
? this.chartData.data.length * 60
|
|
3797
|
-
: width
|
|
3798
|
-
: this.chartData.dropdownData1
|
|
3799
|
-
? this.chartData.data.length * 60
|
|
3800
|
-
: this.chartData.data.length * 40;
|
|
3801
|
-
width =
|
|
3802
|
-
width > this.chartData.data.length * 40
|
|
3803
|
-
? width
|
|
3804
|
-
: this.chartData.data.length * 40;
|
|
3805
|
-
}
|
|
3806
|
-
if (this.chartData.dropdownData2 &&
|
|
3807
|
-
width < this.chartData.data.length * 120 &&
|
|
3808
|
-
this.isZoomedOut) {
|
|
3809
|
-
width = this.chartData.data.length * 120;
|
|
3811
|
+
width = width > this.chartData.data.length * (isMobile ? 15 : 25)
|
|
3812
|
+
? width
|
|
3813
|
+
: this.chartData.data.length * (isMobile ? 15 : 25);
|
|
3810
3814
|
}
|
|
3811
3815
|
if (this.chartData.data.length > 8 && !this.isZoomedOut) {
|
|
3812
|
-
|
|
3813
|
-
width < this.chartData.data.length * 250) {
|
|
3814
|
-
width = this.chartData.data.length * 250;
|
|
3815
|
-
}
|
|
3816
|
-
else
|
|
3817
|
-
width = this.chartData.data.length * 160;
|
|
3816
|
+
width = this.chartData.data.length * (isMobile ? 60 : 130);
|
|
3818
3817
|
}
|
|
3819
|
-
//
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
margin.top -
|
|
3825
|
-
margin.bottom;
|
|
3826
|
-
/**
|
|
3827
|
-
* entire height used in weekly charts as x axis needed to be displayed at the bottom of the chart
|
|
3828
|
-
*/
|
|
3829
|
-
if (this.chartConfiguration.isFullScreen != undefined &&
|
|
3830
|
-
this.chartConfiguration.isFullScreen) {
|
|
3831
|
-
height =
|
|
3832
|
-
this.chartConfiguration.svgHeight != 70
|
|
3833
|
-
? this.chartConfiguration.svgHeight
|
|
3834
|
-
: parseInt(verticalstackedcontainer.style('height'));
|
|
3818
|
+
// Fullscreen and drilldown adjustments
|
|
3819
|
+
if (this.chartConfiguration.isFullScreen != undefined && this.chartConfiguration.isFullScreen) {
|
|
3820
|
+
height = this.chartConfiguration.svgHeight != 80
|
|
3821
|
+
? this.chartConfiguration.svgHeight
|
|
3822
|
+
: containerHeight;
|
|
3835
3823
|
}
|
|
3836
3824
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
3837
|
-
height =
|
|
3838
|
-
parseInt(verticalstackedcontainer.style('height')) -
|
|
3839
|
-
margin.top -
|
|
3840
|
-
margin.bottom -
|
|
3841
|
-
130;
|
|
3825
|
+
height = containerHeight - margin.top - margin.bottom - (isMobile ? 60 : 130);
|
|
3842
3826
|
}
|
|
3827
|
+
// ...existing code...
|
|
3843
3828
|
/**
|
|
3844
3829
|
* for hiding header
|
|
3845
3830
|
* used by weekly charts
|
|
3846
3831
|
*/
|
|
3847
|
-
if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
3832
|
+
if (this.chartConfiguration.isHeaderVisible != undefined) {
|
|
3848
3833
|
this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
3834
|
+
}
|
|
3849
3835
|
/**
|
|
3850
3836
|
* for hiding legends
|
|
3851
3837
|
* used by weekly charts
|
|
3852
3838
|
*/
|
|
3853
|
-
if (this.chartConfiguration.
|
|
3854
|
-
|
|
3839
|
+
if (this.chartConfiguration.isTopCaptionVisible != undefined) {
|
|
3840
|
+
//UPDATENAME
|
|
3841
|
+
this.isTopCaptionVisible = this.chartConfiguration.isTopCaptionVisible;
|
|
3855
3842
|
}
|
|
3856
3843
|
/**
|
|
3857
3844
|
* for removing background color so that it can take parents color
|
|
@@ -3876,24 +3863,23 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3876
3863
|
.style('height', height)
|
|
3877
3864
|
.style('overflow-x', 'hidden')
|
|
3878
3865
|
.style('padding-left', `${margin.left}px`)
|
|
3879
|
-
|
|
3880
|
-
.style('padding-right', `${rightSvgWidth}px`)
|
|
3881
|
-
.style('margin-left', '15px');
|
|
3866
|
+
.style('margin-left', '10px')
|
|
3867
|
+
.style('padding-right', `${rightSvgWidth}px`);
|
|
3882
3868
|
var svgYAxisLeft = outerContainer
|
|
3883
3869
|
.append('svg')
|
|
3884
|
-
.attr('width', '
|
|
3885
|
-
.attr('height', height + margin.top + margin.bottom
|
|
3870
|
+
.attr('width', '80')
|
|
3871
|
+
.attr('height', height + margin.top + margin.bottom)
|
|
3886
3872
|
.style('position', 'absolute')
|
|
3887
3873
|
.style('left', '0')
|
|
3888
3874
|
.style('z-index', 1)
|
|
3889
3875
|
.append('g')
|
|
3890
|
-
.attr('transform', 'translate(' + (margin.left +
|
|
3876
|
+
.attr('transform', 'translate(' + (margin.left + 10) + ',' + margin.top + ')');
|
|
3891
3877
|
var svgYAxisRight = outerContainer
|
|
3892
3878
|
.append('svg')
|
|
3893
3879
|
.attr('width', rightSvgWidth)
|
|
3894
|
-
.attr('height', height + margin.top + margin.bottom
|
|
3880
|
+
.attr('height', height + margin.top + margin.bottom)
|
|
3895
3881
|
.style('position', 'absolute')
|
|
3896
|
-
.style('right', '
|
|
3882
|
+
.style('right', '2px')
|
|
3897
3883
|
.style('z-index', 1)
|
|
3898
3884
|
.append('g')
|
|
3899
3885
|
.attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
|
|
@@ -3902,165 +3888,109 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3902
3888
|
.attr('class', 'inner-container')
|
|
3903
3889
|
.style('width', '100%')
|
|
3904
3890
|
.style('overflow-x', 'auto');
|
|
3891
|
+
// Calculate bar width and padding for mobile to avoid overlap and add space between bars
|
|
3892
|
+
let barWidth;
|
|
3893
|
+
let barPadding = 12; // px, space between bars on mobile
|
|
3894
|
+
let requiredSvgWidth;
|
|
3895
|
+
if (isMobile) {
|
|
3896
|
+
// Use a minimum width per bar and add padding between bars
|
|
3897
|
+
const minBarWidth = 32; // px, can adjust as needed
|
|
3898
|
+
barWidth = minBarWidth;
|
|
3899
|
+
requiredSvgWidth = Math.max(width - rightSvgWidth, (barWidth + barPadding) * data.length + leftAndRightSpaces * 2 + rightSvgWidth - barPadding // no padding after last bar
|
|
3900
|
+
);
|
|
3901
|
+
innerContainer.style('overflow-x', 'auto');
|
|
3902
|
+
}
|
|
3903
|
+
else {
|
|
3904
|
+
barWidth = Math.max(40, (width - rightSvgWidth - leftAndRightSpaces * 2) / data.length);
|
|
3905
|
+
barPadding = 0;
|
|
3906
|
+
requiredSvgWidth = width - rightSvgWidth;
|
|
3907
|
+
}
|
|
3905
3908
|
var svg = innerContainer
|
|
3906
3909
|
.append('svg')
|
|
3907
|
-
|
|
3908
|
-
.attr('width', width - rightSvgWidth)
|
|
3910
|
+
.attr('width', requiredSvgWidth)
|
|
3909
3911
|
.attr('height', height + margin.top + margin.bottom + 30)
|
|
3910
|
-
// .call(ChartHelper.responsivefy)
|
|
3911
3912
|
.append('g')
|
|
3912
3913
|
.attr('transform', 'translate(' + 0 + ',' + margin.top + ')');
|
|
3913
|
-
|
|
3914
|
-
var
|
|
3915
|
-
.
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
.
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
.
|
|
3927
|
-
.domain(
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
.
|
|
3934
|
-
.domain(groups)
|
|
3935
|
-
.range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
3936
|
-
.padding([0.2]);
|
|
3914
|
+
let stackKey = keyList;
|
|
3915
|
+
var stack = d3
|
|
3916
|
+
.stack()
|
|
3917
|
+
.keys(stackKey)
|
|
3918
|
+
/*.order(d3.stackOrder)*/
|
|
3919
|
+
.offset(d3.stackOffsetNone);
|
|
3920
|
+
var layers = stack(data);
|
|
3921
|
+
data.sort(function (a, b) {
|
|
3922
|
+
return b.total - a.total;
|
|
3923
|
+
});
|
|
3924
|
+
let lineYscale;
|
|
3925
|
+
if (lineData != null) {
|
|
3926
|
+
lineYscale = d3
|
|
3927
|
+
.scaleLinear()
|
|
3928
|
+
.domain([
|
|
3929
|
+
0,
|
|
3930
|
+
d3.max(lineData, function (d) {
|
|
3931
|
+
return +d.value;
|
|
3932
|
+
}),
|
|
3933
|
+
])
|
|
3934
|
+
.range([height, 0]);
|
|
3937
3935
|
}
|
|
3938
|
-
//
|
|
3936
|
+
// Calculate bar width for mobile to avoid overlap
|
|
3937
|
+
// ...barWidth is now calculated above, remove duplicate...
|
|
3938
|
+
var xScale = d3
|
|
3939
|
+
.scaleBand()
|
|
3940
|
+
.rangeRound([
|
|
3941
|
+
leftAndRightSpaces,
|
|
3942
|
+
width - rightSvgWidth - leftAndRightSpaces
|
|
3943
|
+
])
|
|
3944
|
+
.domain(data.map(function (d) {
|
|
3945
|
+
return d.name;
|
|
3946
|
+
}))
|
|
3947
|
+
.padding(isMobile ? 0.2 : 0.5);
|
|
3939
3948
|
var xScaleFromOrigin = d3
|
|
3940
3949
|
.scaleBand()
|
|
3941
|
-
.
|
|
3942
|
-
.
|
|
3943
|
-
|
|
3950
|
+
.rangeRound([width - rightSvgWidth, 0])
|
|
3951
|
+
.domain(data.map(function (d) {
|
|
3952
|
+
return d.name;
|
|
3953
|
+
}));
|
|
3954
|
+
// ...existing code...
|
|
3944
3955
|
/**
|
|
3945
3956
|
* draw second x axis on top
|
|
3946
3957
|
*/
|
|
3947
|
-
|
|
3958
|
+
if (self.chartConfiguration.showXaxisTop) {
|
|
3959
|
+
svg
|
|
3960
|
+
.append('g')
|
|
3961
|
+
.attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
3962
|
+
.attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
3963
|
+
.call(d3.axisBottom(xScale).tickSize(0));
|
|
3964
|
+
svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
3965
|
+
}
|
|
3966
|
+
/**
|
|
3967
|
+
* draw second x axis on top
|
|
3968
|
+
*/
|
|
3969
|
+
// if (self.chartConfiguration.showXaxisAtTarget) {
|
|
3948
3970
|
// svg
|
|
3949
3971
|
// .append('g')
|
|
3950
3972
|
// .attr('class', 'lib-line-axis-text lib-line-x-axis-text x-axis')
|
|
3951
3973
|
// .attr('style', self.chartConfiguration.xAxisCustomTextStyles)
|
|
3952
|
-
// .call(d3.axisBottom(
|
|
3974
|
+
// .call(d3.axisBottom(xScale).tickSize(0));
|
|
3975
|
+
// svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
3953
3976
|
// }
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
.call((g) => g.select('.domain').remove());
|
|
3965
|
-
svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
3966
|
-
svg.selectAll('g.x1.axis1 g.tick text')
|
|
3967
|
-
.attr('class', 'lib-xaxis-labels-texts-drilldown');
|
|
3968
|
-
// .attr('y', function () {
|
|
3969
|
-
// if (alternate_text) {
|
|
3970
|
-
// alternate_text = false;
|
|
3971
|
-
// return long_tick_length + 1;
|
|
3972
|
-
// } else {
|
|
3973
|
-
// alternate_text = true;
|
|
3974
|
-
// return short_tick_length + 1;
|
|
3975
|
-
// }
|
|
3976
|
-
// });
|
|
3977
|
-
}
|
|
3978
|
-
else {
|
|
3979
|
-
/**
|
|
3980
|
-
* bigger ticks for weekly charts and more space from x axis to labels
|
|
3981
|
-
*/
|
|
3982
|
-
/**
|
|
3983
|
-
* draw x axis
|
|
3984
|
-
*/
|
|
3985
|
-
svg
|
|
3986
|
-
.append('g')
|
|
3987
|
-
.attr('class', 'x1 axis1')
|
|
3988
|
-
.attr('transform', 'translate(-25,' + height + ')')
|
|
3989
|
-
.call(d3.axisBottom(x).tickSize(0))
|
|
3990
|
-
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
3991
|
-
/**
|
|
3992
|
-
* tick line size in alternate fashion
|
|
3993
|
-
*/
|
|
3994
|
-
svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
|
|
3995
|
-
if (alternate_text &&
|
|
3996
|
-
self.chartConfiguration.isNoAlternateXaxisText == undefined) {
|
|
3997
|
-
alternate_text = false;
|
|
3998
|
-
return long_tick_length_bg - 7;
|
|
3999
|
-
}
|
|
4000
|
-
else {
|
|
4001
|
-
alternate_text = true;
|
|
4002
|
-
return short_tick_length_bg - 4;
|
|
4003
|
-
}
|
|
4004
|
-
});
|
|
4005
|
-
/**
|
|
4006
|
-
* reset the flag so that values can be shown in same alternate fashion
|
|
4007
|
-
*/
|
|
4008
|
-
alternate_text = false;
|
|
4009
|
-
/**
|
|
4010
|
-
* print x-axis label texts
|
|
4011
|
-
* used by weekly charts
|
|
4012
|
-
*/
|
|
4013
|
-
svg
|
|
4014
|
-
.selectAll('g.x1.axis1 g.tick text')
|
|
4015
|
-
.attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
4016
|
-
.attr('y', function () {
|
|
4017
|
-
if (alternate_text) {
|
|
4018
|
-
alternate_text = false;
|
|
4019
|
-
return long_tick_length_bg;
|
|
4020
|
-
}
|
|
4021
|
-
else {
|
|
4022
|
-
alternate_text = true;
|
|
4023
|
-
return short_tick_length_bg;
|
|
4024
|
-
}
|
|
4025
|
-
});
|
|
4026
|
-
}
|
|
4027
|
-
if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
4028
|
-
svg
|
|
4029
|
-
.selectAll('g.x1.axis1 g.tick text')
|
|
4030
|
-
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
4031
|
-
.attr('y', short_tick_length_bg)
|
|
4032
|
-
.text(function (d) {
|
|
4033
|
-
var isValueToBeIgnored = false;
|
|
4034
|
-
data.map((indiv) => {
|
|
4035
|
-
if (indiv.name.toLowerCase() == d.trim().toLowerCase() &&
|
|
4036
|
-
indiv[metaData.keyList[0]] == -1) {
|
|
4037
|
-
isValueToBeIgnored = true;
|
|
4038
|
-
}
|
|
4039
|
-
});
|
|
4040
|
-
if (isValueToBeIgnored) {
|
|
4041
|
-
return '';
|
|
4042
|
-
}
|
|
4043
|
-
if (d.trim().indexOf(' ') > -1) {
|
|
4044
|
-
return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
4045
|
-
}
|
|
4046
|
-
return d.toLowerCase();
|
|
4047
|
-
});
|
|
4048
|
-
svg
|
|
4049
|
-
.selectAll('g.x1.axis1 g.tick')
|
|
4050
|
-
.append('text')
|
|
4051
|
-
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
4052
|
-
.attr('y', long_tick_length_bg)
|
|
4053
|
-
.attr('fill', 'currentColor')
|
|
4054
|
-
.text(function (d) {
|
|
4055
|
-
if (d.trim().indexOf(' ') > -1) {
|
|
4056
|
-
return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
|
|
4057
|
-
}
|
|
4058
|
-
return '';
|
|
4059
|
-
});
|
|
3977
|
+
if (this.chartConfiguration.xAxisGrid) {
|
|
3978
|
+
for (var j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
|
|
3979
|
+
svg
|
|
3980
|
+
.append('g')
|
|
3981
|
+
.attr('class', `x${j + 2} axis${j + 2}`)
|
|
3982
|
+
.style('color', 'var(--chart-grid-color)') // Use CSS variable instead of hardcoded
|
|
3983
|
+
.attr('transform', 'translate(0,' + height * this.chartConfiguration.xAxisGrid[j] + ')')
|
|
3984
|
+
.call(d3.axisBottom(xScale).tickSize(0).ticks(5).tickFormat(''))
|
|
3985
|
+
.style('fill', 'var(--chart-text-color)');
|
|
3986
|
+
}
|
|
4060
3987
|
}
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
3988
|
+
let yScale = d3.scaleLinear().rangeRound([height, 0]);
|
|
3989
|
+
/**
|
|
3990
|
+
* update max vakues so that the vakue wont exceed the max limit
|
|
3991
|
+
* used by weekly charts
|
|
3992
|
+
*/
|
|
3993
|
+
var maxValue = d3.max(layers, (d) => d3.max(d, (d) => d[1]));
|
|
4064
3994
|
if (maxValue == 0) {
|
|
4065
3995
|
if (this.chartData.targetLineData) {
|
|
4066
3996
|
maxValue = this.chartData.targetLineData.target + 20;
|
|
@@ -4069,27 +3999,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4069
3999
|
maxValue = 100;
|
|
4070
4000
|
}
|
|
4071
4001
|
}
|
|
4072
|
-
if (self.chartConfiguration.yAxisGrid) {
|
|
4073
|
-
// svg
|
|
4074
|
-
// .append('g')
|
|
4075
|
-
// .attr('class', 'grid')
|
|
4076
|
-
// .call(
|
|
4077
|
-
// d3
|
|
4078
|
-
// .axisLeft(y)
|
|
4079
|
-
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
4080
|
-
// .tickSize(-width)
|
|
4081
|
-
// .tickFormat('')
|
|
4082
|
-
// )
|
|
4083
|
-
// // .style('stroke-dasharray', '5 5')
|
|
4084
|
-
// .style('color', '#B9B9B9')
|
|
4085
|
-
// .style('opacity', '0.5')
|
|
4086
|
-
// .call((g) => g.select('.domain').remove());
|
|
4087
|
-
}
|
|
4088
4002
|
if (this.chartConfiguration.customYscale) {
|
|
4089
|
-
/**
|
|
4090
|
-
* increase y-scale so that values wont cross or exceed out of range
|
|
4091
|
-
* used in weekly charts
|
|
4092
|
-
*/
|
|
4093
4003
|
maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
4094
4004
|
}
|
|
4095
4005
|
if (this.chartData.targetLineData &&
|
|
@@ -4099,26 +4009,16 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4099
4009
|
? this.chartData.targetLineData.target + 3
|
|
4100
4010
|
: this.chartData.targetLineData.target + 20;
|
|
4101
4011
|
}
|
|
4102
|
-
|
|
4103
|
-
let
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
if (maxLineValue > 0)
|
|
4113
|
-
minLineValue = minLineValue - 3;
|
|
4114
|
-
if (minLineValue > 0) {
|
|
4115
|
-
minLineValue = 0;
|
|
4116
|
-
}
|
|
4117
|
-
lineYscale = d3
|
|
4118
|
-
.scaleLinear()
|
|
4119
|
-
.domain([minLineValue, maxLineValue])
|
|
4120
|
-
.range([height, minLineValue]);
|
|
4121
|
-
}
|
|
4012
|
+
yScale.domain([0, maxValue]).nice();
|
|
4013
|
+
let xAxis = d3
|
|
4014
|
+
.axisBottom(xScale)
|
|
4015
|
+
.tickSize(0)
|
|
4016
|
+
.tickFormat(self.chartConfiguration.xAxisLabelFomatter);
|
|
4017
|
+
let yAxis = d3
|
|
4018
|
+
.axisLeft(yScale)
|
|
4019
|
+
.ticks(self.chartConfiguration.numberOfYTicks)
|
|
4020
|
+
.tickSize(0)
|
|
4021
|
+
.tickFormat(self.chartConfiguration.yAxisLabelFomatter);
|
|
4122
4022
|
let yLineAxis;
|
|
4123
4023
|
if (lineYscale != null) {
|
|
4124
4024
|
yLineAxis = d3
|
|
@@ -4128,542 +4028,634 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4128
4028
|
.tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
4129
4029
|
}
|
|
4130
4030
|
/**
|
|
4131
|
-
*
|
|
4132
|
-
*
|
|
4031
|
+
* between x-axis label used by weekly charts
|
|
4032
|
+
* isXgridBetweenLabels will be undefined for dashboard charts
|
|
4133
4033
|
*/
|
|
4134
4034
|
if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
4135
4035
|
svg
|
|
4136
4036
|
.append('g')
|
|
4137
4037
|
.attr('class', 'grid')
|
|
4138
|
-
.attr('transform', 'translate(' +
|
|
4139
|
-
.call(d3.axisBottom(
|
|
4038
|
+
.attr('transform', 'translate(' + xScale.bandwidth() / 2 + ',' + height + ')')
|
|
4039
|
+
.call(d3.axisBottom(xScale).tickSize(-height).tickFormat(''))
|
|
4140
4040
|
.style('stroke-dasharray', '5 5')
|
|
4141
4041
|
.style('color', '#999999')
|
|
4042
|
+
// .style("opacity", "0.5")
|
|
4142
4043
|
.call((g) => g.select('.domain').remove());
|
|
4143
4044
|
}
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4045
|
+
/**
|
|
4046
|
+
* used to draw y-axis grid
|
|
4047
|
+
*/
|
|
4048
|
+
if (self.chartConfiguration.yAxisGrid) {
|
|
4148
4049
|
svg
|
|
4149
4050
|
.append('g')
|
|
4051
|
+
.attr('class', 'grid')
|
|
4150
4052
|
.call(d3
|
|
4151
|
-
.axisLeft(
|
|
4053
|
+
.axisLeft(yScale)
|
|
4152
4054
|
.ticks(self.chartConfiguration.numberOfYTicks)
|
|
4153
|
-
.tickSize(-width)
|
|
4154
|
-
.
|
|
4155
|
-
|
|
4156
|
-
.
|
|
4157
|
-
}
|
|
4158
|
-
else {
|
|
4159
|
-
svg
|
|
4160
|
-
.append('g')
|
|
4161
|
-
.call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
|
|
4162
|
-
.style('color', '#B9B9B9')
|
|
4055
|
+
.tickSize(-width)
|
|
4056
|
+
.tickFormat(''))
|
|
4057
|
+
// Remove hardcoded colors and use CSS variables
|
|
4058
|
+
.style('color', 'var(--chart-grid-color)')
|
|
4163
4059
|
.style('opacity', '0.5')
|
|
4164
4060
|
.call((g) => g.select('.domain').remove());
|
|
4165
4061
|
}
|
|
4166
|
-
var
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
}
|
|
4170
|
-
else {
|
|
4171
|
-
/**
|
|
4172
|
-
* used to make grouped bars with lesser width as we are not using padding for width
|
|
4173
|
-
* used by weekly charts
|
|
4174
|
-
*/
|
|
4175
|
-
xSubgroup.range([0, x.bandwidth()]);
|
|
4176
|
-
}
|
|
4177
|
-
// if (this.chartConfiguration.isDrilldownChart) {
|
|
4178
|
-
// }
|
|
4179
|
-
var color = d3
|
|
4180
|
-
.scaleOrdinal()
|
|
4181
|
-
.domain(subgroups)
|
|
4182
|
-
.range(Object.values(metaData.colors));
|
|
4183
|
-
// var colorAboveTarget = d3
|
|
4184
|
-
// .scaleOrdinal()
|
|
4185
|
-
// .domain(subgroups)
|
|
4186
|
-
// .range(Object.values(metaData.colorAboveTarget));
|
|
4187
|
-
var state = svg
|
|
4188
|
-
.append('g')
|
|
4189
|
-
.selectAll('.state')
|
|
4190
|
-
.data(data)
|
|
4062
|
+
var layer = svg
|
|
4063
|
+
.selectAll('.layer')
|
|
4064
|
+
.data(layers)
|
|
4191
4065
|
.enter()
|
|
4192
4066
|
.append('g')
|
|
4193
|
-
.attr('
|
|
4194
|
-
|
|
4067
|
+
.attr('class', 'layer')
|
|
4068
|
+
.style('fill', function (d, i) {
|
|
4069
|
+
return metaData.colors[d.key];
|
|
4195
4070
|
});
|
|
4196
|
-
|
|
4071
|
+
var rect = layer
|
|
4197
4072
|
.selectAll('rect')
|
|
4198
4073
|
.data(function (d) {
|
|
4199
|
-
|
|
4200
|
-
subgroups.map(function (key) {
|
|
4201
|
-
// if (key !== "group") {
|
|
4202
|
-
let obj = { key: key, value: d[key], name: d.name };
|
|
4203
|
-
newList.push(obj);
|
|
4204
|
-
// }
|
|
4205
|
-
});
|
|
4206
|
-
return newList;
|
|
4074
|
+
return d;
|
|
4207
4075
|
})
|
|
4208
|
-
.enter()
|
|
4076
|
+
.enter();
|
|
4077
|
+
rect
|
|
4209
4078
|
.append('rect')
|
|
4210
|
-
.attr('class', 'bars')
|
|
4211
4079
|
.on('click', function (d) {
|
|
4212
|
-
if (
|
|
4080
|
+
if (!lineData || self.chartConfiguration.forComparison) {
|
|
4213
4081
|
if (!metaData.barWithoutClick ||
|
|
4214
4082
|
!metaData.barWithoutClick.length ||
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
// self.handleClick(d.data.name);
|
|
4218
|
-
self.handleClick(d);
|
|
4219
|
-
}
|
|
4220
|
-
})
|
|
4221
|
-
.attr('x', function (d) {
|
|
4222
|
-
if (self.chartConfiguration.isDrilldownChart) {
|
|
4223
|
-
data.map((indiv) => {
|
|
4224
|
-
if (indiv.name == d.name) {
|
|
4225
|
-
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
4226
|
-
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
4227
|
-
if (x.bandwidth() > 100) {
|
|
4228
|
-
if (self.chartData.data.length == 1) {
|
|
4229
|
-
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
4230
|
-
tempScale.range([
|
|
4231
|
-
0 + (x.bandwidth() - 200) / 2,
|
|
4232
|
-
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4233
|
-
]);
|
|
4234
|
-
// .padding(0.05);
|
|
4235
|
-
}
|
|
4236
|
-
else
|
|
4237
|
-
tempScale.range([
|
|
4238
|
-
0 + (x.bandwidth() - 300) / 2,
|
|
4239
|
-
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4240
|
-
]);
|
|
4241
|
-
// .padding(0.05);
|
|
4242
|
-
}
|
|
4243
|
-
else
|
|
4244
|
-
tempScale.range([
|
|
4245
|
-
0 + (x.bandwidth() - 125) / 2,
|
|
4246
|
-
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
4247
|
-
]);
|
|
4248
|
-
}
|
|
4249
|
-
}
|
|
4250
|
-
});
|
|
4251
|
-
return tempScale(d.key);
|
|
4083
|
+
!metaData.barWithoutClick.includes(d.data.name.toLowerCase()))
|
|
4084
|
+
self.handleClick(d.data.name);
|
|
4252
4085
|
}
|
|
4253
|
-
return xSubgroup(d.key);
|
|
4254
4086
|
})
|
|
4255
4087
|
.attr('y', function (d) {
|
|
4256
|
-
|
|
4088
|
+
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
4089
|
+
const actualHeight = yScale(d[0]) - yScale(d[1]);
|
|
4090
|
+
return actualHeight < 3 ? yScale(d[0]) - 3 : yScale(d[1]);
|
|
4091
|
+
}
|
|
4092
|
+
return 0;
|
|
4257
4093
|
})
|
|
4258
|
-
.attr('
|
|
4259
|
-
if (
|
|
4260
|
-
//
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
]);
|
|
4273
|
-
// .padding(0.05);
|
|
4274
|
-
}
|
|
4275
|
-
else
|
|
4276
|
-
tempScale.range([
|
|
4277
|
-
0 + (x.bandwidth() - 300) / 2,
|
|
4278
|
-
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4279
|
-
]);
|
|
4280
|
-
// .padding(0.05);
|
|
4281
|
-
}
|
|
4282
|
-
else
|
|
4283
|
-
tempScale.range([
|
|
4284
|
-
0 + (x.bandwidth() - 125) / 2,
|
|
4285
|
-
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
4286
|
-
]);
|
|
4287
|
-
}
|
|
4288
|
-
}
|
|
4289
|
-
});
|
|
4290
|
-
return tempScale.bandwidth();
|
|
4094
|
+
.attr('x', function (d, i) {
|
|
4095
|
+
if (isMobile) {
|
|
4096
|
+
// On mobile, position bars with padding
|
|
4097
|
+
return leftAndRightSpaces + i * (barWidth + barPadding);
|
|
4098
|
+
}
|
|
4099
|
+
if (self.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
4100
|
+
return xScale(d.data.name);
|
|
4101
|
+
}
|
|
4102
|
+
else {
|
|
4103
|
+
if (self.chartConfiguration.isDrilldownChart &&
|
|
4104
|
+
self.chartData.data.length <= 3) {
|
|
4105
|
+
return xScale(d.data.name) + xScale.bandwidth() / 2 - 35;
|
|
4106
|
+
}
|
|
4107
|
+
return xScale(d.data.name) + xScale.bandwidth() * 0.1;
|
|
4291
4108
|
}
|
|
4292
|
-
return xSubgroup.bandwidth();
|
|
4293
4109
|
})
|
|
4294
4110
|
.attr('height', function (d) {
|
|
4295
|
-
if (d
|
|
4296
|
-
|
|
4111
|
+
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
4112
|
+
const actualHeight = yScale(d[0]) - yScale(d[1]);
|
|
4113
|
+
return actualHeight < 3 ? 3 : actualHeight;
|
|
4297
4114
|
}
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4115
|
+
return 0;
|
|
4116
|
+
})
|
|
4117
|
+
.attr('width', function (d) {
|
|
4118
|
+
// Use calculated barWidth for mobile, otherwise scale
|
|
4119
|
+
if (isMobile) {
|
|
4120
|
+
return barWidth;
|
|
4121
|
+
}
|
|
4122
|
+
return self.chartConfiguration.isMultiChartGridLine == undefined
|
|
4123
|
+
? xScale.bandwidth()
|
|
4124
|
+
: self.chartConfiguration.isDrilldownChart &&
|
|
4125
|
+
self.chartData.data.length <= 3
|
|
4126
|
+
? 70
|
|
4127
|
+
: xScale.bandwidth() * 0.8;
|
|
4301
4128
|
})
|
|
4302
|
-
// .style('cursor', 'pointer')
|
|
4129
|
+
// .style('cursor', 'pointer');
|
|
4303
4130
|
.style('cursor', function (d) {
|
|
4304
|
-
if (metaData.hasDrillDown)
|
|
4131
|
+
if (metaData.hasDrillDown) {
|
|
4132
|
+
if (metaData.barWithoutClick.length > 0 &&
|
|
4133
|
+
metaData.barWithoutClick.includes(d.data.name.toLowerCase())) {
|
|
4134
|
+
return 'default';
|
|
4135
|
+
}
|
|
4305
4136
|
return 'pointer';
|
|
4137
|
+
}
|
|
4306
4138
|
else
|
|
4307
4139
|
return 'default';
|
|
4308
4140
|
})
|
|
4309
|
-
.
|
|
4310
|
-
if (d
|
|
4141
|
+
.style('fill', function (d) {
|
|
4142
|
+
if (!isNaN(d[0]) &&
|
|
4143
|
+
!isNaN(d[1]) &&
|
|
4311
4144
|
self.chartData.targetLineData &&
|
|
4312
|
-
d
|
|
4313
|
-
|
|
4314
|
-
return self.chartData
|
|
4315
|
-
return
|
|
4145
|
+
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
4146
|
+
parseFloat(self.chartData.targetLineData.target))
|
|
4147
|
+
return self.chartData?.targetLineData?.barAboveTargetColor;
|
|
4148
|
+
return metaData.colors[d.key];
|
|
4316
4149
|
});
|
|
4317
4150
|
/**
|
|
4318
|
-
*
|
|
4151
|
+
* do not show valus on hover as its alreay dislayed
|
|
4319
4152
|
*/
|
|
4320
|
-
if (this.
|
|
4321
|
-
|
|
4322
|
-
.
|
|
4323
|
-
.
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
return newList;
|
|
4330
|
-
})
|
|
4331
|
-
.enter()
|
|
4153
|
+
if (!this.isCC && !self.chartConfiguration.isMultiChartGridLine) {
|
|
4154
|
+
rect
|
|
4155
|
+
.append('svg:title') // TITLE APPENDED HERE
|
|
4156
|
+
.text(function (d) {
|
|
4157
|
+
return d[1] - d[0];
|
|
4158
|
+
});
|
|
4159
|
+
}
|
|
4160
|
+
if (this.isCC) {
|
|
4161
|
+
rect
|
|
4332
4162
|
.append('text')
|
|
4333
4163
|
.attr('x', function (d) {
|
|
4334
|
-
return
|
|
4164
|
+
return xScale(d.data.name);
|
|
4165
|
+
})
|
|
4166
|
+
.attr('text-anchor', function (d) {
|
|
4167
|
+
if (!d[0]) {
|
|
4168
|
+
return 'end';
|
|
4169
|
+
}
|
|
4170
|
+
else {
|
|
4171
|
+
return 'start';
|
|
4172
|
+
}
|
|
4335
4173
|
})
|
|
4174
|
+
.attr('class', 'verticalbar__text')
|
|
4336
4175
|
.attr('y', function (d) {
|
|
4337
|
-
|
|
4176
|
+
if (!d[0]) {
|
|
4177
|
+
return yScale(d[1]);
|
|
4178
|
+
}
|
|
4179
|
+
else {
|
|
4180
|
+
return yScale(d[1]) - 7;
|
|
4181
|
+
}
|
|
4338
4182
|
})
|
|
4339
|
-
.attr(
|
|
4340
|
-
.
|
|
4341
|
-
return d.
|
|
4342
|
-
? d.key.length > 20
|
|
4343
|
-
? d.key.substring(0, 17) + '...'
|
|
4344
|
-
: d.key
|
|
4345
|
-
: '';
|
|
4183
|
+
// .attr("y", function (d) { return yScale(d[0]) - yScale(d[1]); })
|
|
4184
|
+
.attr('dy', function (d) {
|
|
4185
|
+
return d.class;
|
|
4346
4186
|
})
|
|
4347
|
-
.
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
.style('font-size', function (d) {
|
|
4352
|
-
if (self.chartConfiguration.isDrilldownChart) {
|
|
4353
|
-
if (window.innerWidth > 1900) {
|
|
4354
|
-
return '18px';
|
|
4355
|
-
}
|
|
4356
|
-
else if (window.innerWidth < 1400) {
|
|
4357
|
-
return '10px';
|
|
4358
|
-
}
|
|
4359
|
-
else {
|
|
4360
|
-
return '14px';
|
|
4187
|
+
.text(function (d) {
|
|
4188
|
+
if (!d[0]) {
|
|
4189
|
+
if (!isNaN(d[1] - d[0])) {
|
|
4190
|
+
return Math.round((d[1] - d[0]) * 100) / 100;
|
|
4361
4191
|
}
|
|
4192
|
+
else
|
|
4193
|
+
return;
|
|
4362
4194
|
}
|
|
4363
4195
|
else {
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
})
|
|
4367
|
-
.attr('transform', function (d) {
|
|
4368
|
-
data.map((indiv) => {
|
|
4369
|
-
if (indiv.name == d.name) {
|
|
4370
|
-
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
4371
|
-
var temp;
|
|
4372
|
-
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
4373
|
-
if (x.bandwidth() > 100) {
|
|
4374
|
-
if (self.chartData.data.length == 1) {
|
|
4375
|
-
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
4376
|
-
tempScale.range([
|
|
4377
|
-
0 + (x.bandwidth() - 200) / 2,
|
|
4378
|
-
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4379
|
-
]);
|
|
4380
|
-
// .padding(0.05);
|
|
4381
|
-
}
|
|
4382
|
-
else
|
|
4383
|
-
tempScale.range([
|
|
4384
|
-
0 + (x.bandwidth() - 300) / 2,
|
|
4385
|
-
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4386
|
-
]);
|
|
4387
|
-
// .padding(0.05);
|
|
4388
|
-
}
|
|
4389
|
-
else
|
|
4390
|
-
tempScale.range([
|
|
4391
|
-
0 + (x.bandwidth() - 125) / 2,
|
|
4392
|
-
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
4393
|
-
]);
|
|
4394
|
-
}
|
|
4196
|
+
if (!isNaN(d[1])) {
|
|
4197
|
+
return Math.round(d[1] * 100) / 100;
|
|
4395
4198
|
}
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
* if set, then all texts ll be horizontal
|
|
4399
|
-
*/
|
|
4400
|
-
if (self.chartConfiguration.textAlwaysHorizontal) {
|
|
4401
|
-
return ('translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')');
|
|
4199
|
+
else
|
|
4200
|
+
return;
|
|
4402
4201
|
}
|
|
4403
|
-
/**
|
|
4404
|
-
* rotate texts having more than one digits
|
|
4405
|
-
*/
|
|
4406
|
-
// if (d.value > 9)
|
|
4407
|
-
if (!isNaN(tempScale(d.key)))
|
|
4408
|
-
return ('translate(' +
|
|
4409
|
-
(tempScale(d.key) + tempScale.bandwidth() * 0.55) +
|
|
4410
|
-
',' +
|
|
4411
|
-
(y(0) - 10) +
|
|
4412
|
-
') rotate(270)');
|
|
4413
|
-
return 'translate(0,0)';
|
|
4414
|
-
// else
|
|
4415
|
-
// return (
|
|
4416
|
-
// 'translate(' +
|
|
4417
|
-
// (tempScale(d.key) + tempScale.bandwidth() / 2) +
|
|
4418
|
-
// ',' +
|
|
4419
|
-
// y(0) +
|
|
4420
|
-
// ')'
|
|
4421
|
-
// );
|
|
4422
|
-
})
|
|
4423
|
-
.on('click', function (d) {
|
|
4424
|
-
if (!metaData.barWithoutClick ||
|
|
4425
|
-
!metaData.barWithoutClick.length ||
|
|
4426
|
-
(!metaData.barWithoutClick.includes(d?.name) &&
|
|
4427
|
-
!metaData.barWithoutClick.includes(d?.key)))
|
|
4428
|
-
self.handleClick(d);
|
|
4429
4202
|
});
|
|
4430
|
-
state
|
|
4431
|
-
.selectAll('.lib-data-labels-weeklycharts')
|
|
4432
|
-
.on('mouseout', handleMouseOut)
|
|
4433
|
-
.on('mouseover', handleMouseOver);
|
|
4434
|
-
}
|
|
4435
|
-
if (this.chartConfiguration.displayTitleOnTop) {
|
|
4436
|
-
state
|
|
4437
|
-
.selectAll('rect')
|
|
4438
|
-
.on('mouseout', handleMouseOut)
|
|
4439
|
-
.on('mouseover', handleMouseOver);
|
|
4440
4203
|
}
|
|
4204
|
+
/**
|
|
4205
|
+
svg
|
|
4206
|
+
.append('foreignObject')
|
|
4207
|
+
.attr('transform', 'translate(' + 0 + ',' + (yZero - 25) + ')')
|
|
4208
|
+
.attr('width', width)
|
|
4209
|
+
.attr('height', 30)
|
|
4210
|
+
.append('xhtml:div')
|
|
4211
|
+
.attr('class', 'target-display')
|
|
4212
|
+
.style('color', this.chartData.targetLineData.color)
|
|
4213
|
+
*/
|
|
4214
|
+
/**
|
|
4215
|
+
* on hover, display title on top
|
|
4216
|
+
*/
|
|
4441
4217
|
function handleMouseOver(d, i) {
|
|
4218
|
+
if (!self.chartConfiguration.displayTitleOnTop) {
|
|
4219
|
+
return;
|
|
4220
|
+
}
|
|
4221
|
+
svg
|
|
4222
|
+
.selectAll('rect')
|
|
4223
|
+
.filter(function (data) {
|
|
4224
|
+
return data == d;
|
|
4225
|
+
})
|
|
4226
|
+
.style('fill', function (d) {
|
|
4227
|
+
if (!isNaN(d[0]) &&
|
|
4228
|
+
!isNaN(d[1]) &&
|
|
4229
|
+
self.chartData.targetLineData &&
|
|
4230
|
+
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
4231
|
+
parseFloat(self.chartData.targetLineData.target))
|
|
4232
|
+
return self.chartData.targetLineData.barAboveTargetHoverColor
|
|
4233
|
+
? self.chartData.targetLineData.barAboveTargetHoverColor
|
|
4234
|
+
: self.chartData?.targetLineData?.barAboveTargetColor
|
|
4235
|
+
? self.chartData?.targetLineData?.barAboveTargetColor
|
|
4236
|
+
: '';
|
|
4237
|
+
return metaData.hoverColor ? metaData.hoverColor : '';
|
|
4238
|
+
});
|
|
4442
4239
|
svg
|
|
4443
4240
|
.append('foreignObject')
|
|
4444
4241
|
.attr('x', function () {
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
4450
|
-
elementsCounter = keys.length;
|
|
4451
|
-
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
4452
|
-
if (x.bandwidth() > 100) {
|
|
4453
|
-
if (self.chartData.data.length == 1) {
|
|
4454
|
-
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
4455
|
-
tempScale.range([
|
|
4456
|
-
0 + (x.bandwidth() - 200) / 2,
|
|
4457
|
-
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4458
|
-
]);
|
|
4459
|
-
// .padding(0.05);
|
|
4460
|
-
}
|
|
4461
|
-
else
|
|
4462
|
-
tempScale.range([
|
|
4463
|
-
0 + (x.bandwidth() - 300) / 2,
|
|
4464
|
-
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4465
|
-
]);
|
|
4466
|
-
// .padding(0.05);
|
|
4467
|
-
}
|
|
4468
|
-
else
|
|
4469
|
-
tempScale.range([
|
|
4470
|
-
0 + (x.bandwidth() - 125) / 2,
|
|
4471
|
-
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
4472
|
-
]);
|
|
4473
|
-
}
|
|
4474
|
-
}
|
|
4475
|
-
});
|
|
4476
|
-
if (metaData.hasDrillDown) {
|
|
4477
|
-
if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
4478
|
-
return (x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90);
|
|
4479
|
-
}
|
|
4480
|
-
return (x(d.name) +
|
|
4481
|
-
tempScale(d.key) -
|
|
4482
|
-
(tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
|
|
4483
|
-
tempScale.bandwidth() / 2);
|
|
4242
|
+
if (xScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
4243
|
+
return (xScale(d.data.name) -
|
|
4244
|
+
leftAndRightSpaces +
|
|
4245
|
+
(xScale.bandwidth() + leftAndRightSpaces * 2 - 180) / 2);
|
|
4484
4246
|
}
|
|
4485
|
-
|
|
4486
|
-
return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
|
|
4247
|
+
return xScale(d.data.name) - leftAndRightSpaces;
|
|
4487
4248
|
})
|
|
4488
4249
|
.attr('class', 'lib-verticalstack-title-ontop')
|
|
4489
4250
|
.attr('y', function () {
|
|
4490
|
-
|
|
4251
|
+
// Increase the gap between the bar and the tooltip (was -1 - 40)
|
|
4252
|
+
return yScale(d[1]) - 1 - 50; // 10px more gap
|
|
4491
4253
|
})
|
|
4492
4254
|
.attr('dy', function () {
|
|
4493
4255
|
return d.class;
|
|
4494
4256
|
})
|
|
4495
4257
|
.attr('width', function () {
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
if (indiv.name == d.name) {
|
|
4499
|
-
let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
4500
|
-
tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
4501
|
-
if (x.bandwidth() > 100) {
|
|
4502
|
-
if (self.chartData.data.length == 1) {
|
|
4503
|
-
if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
4504
|
-
tempScale.range([
|
|
4505
|
-
0 + (x.bandwidth() - 200) / 2,
|
|
4506
|
-
x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
4507
|
-
]);
|
|
4508
|
-
// .padding(0.05);
|
|
4509
|
-
}
|
|
4510
|
-
else
|
|
4511
|
-
tempScale.range([
|
|
4512
|
-
0 + (x.bandwidth() - 300) / 2,
|
|
4513
|
-
x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
4514
|
-
]);
|
|
4515
|
-
// .padding(0.05);
|
|
4516
|
-
}
|
|
4517
|
-
else
|
|
4518
|
-
tempScale.range([
|
|
4519
|
-
0 + (x.bandwidth() - 125) / 2,
|
|
4520
|
-
x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
4521
|
-
]);
|
|
4522
|
-
}
|
|
4523
|
-
}
|
|
4524
|
-
});
|
|
4525
|
-
if (metaData.hasDrillDown) {
|
|
4526
|
-
if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
4527
|
-
return '180px';
|
|
4528
|
-
}
|
|
4529
|
-
return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
4258
|
+
if (xScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
4259
|
+
return '180px';
|
|
4530
4260
|
}
|
|
4531
|
-
|
|
4532
|
-
return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
4261
|
+
return xScale.bandwidth() + leftAndRightSpaces * 2;
|
|
4533
4262
|
})
|
|
4534
4263
|
.attr('height', 40)
|
|
4535
4264
|
.append('xhtml:div')
|
|
4536
4265
|
.attr('class', 'title')
|
|
4537
4266
|
.style('z-index', 99)
|
|
4538
4267
|
.html(function () {
|
|
4539
|
-
|
|
4540
|
-
if (!
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4268
|
+
// Tooltip content without any arrow mark
|
|
4269
|
+
if (!isNaN(d[1] - d[0])) {
|
|
4270
|
+
if (d[1] - d[0] === 0) {
|
|
4271
|
+
return '<span class="title-top-text">0</span>';
|
|
4272
|
+
}
|
|
4273
|
+
var dataType = metaData.dataType ? metaData.dataType : '';
|
|
4274
|
+
var desiredText = '';
|
|
4275
|
+
// Always show the full x-axis label (category name) in the tooltip
|
|
4276
|
+
desiredText =
|
|
4277
|
+
'<span class="title-bar-name">' +
|
|
4278
|
+
(d.data.name ? d.data.name : '') +
|
|
4279
|
+
'</span>';
|
|
4280
|
+
desiredText += metaData.unit
|
|
4281
|
+
? '<span class="title-top-text">' +
|
|
4282
|
+
metaData.unit +
|
|
4283
|
+
(d[1] - d[0]) +
|
|
4284
|
+
dataType +
|
|
4285
|
+
'</span>'
|
|
4286
|
+
: '<span class="title-top-text">' +
|
|
4287
|
+
(d[1] - d[0]) +
|
|
4546
4288
|
dataType +
|
|
4547
4289
|
'</span>';
|
|
4290
|
+
// No arrow mark or arrow HTML/CSS in tooltip
|
|
4548
4291
|
return desiredText;
|
|
4549
4292
|
}
|
|
4550
|
-
else
|
|
4551
|
-
|
|
4552
|
-
let desiredText = '<span class="title-bar-name">' +
|
|
4553
|
-
tempKey +
|
|
4554
|
-
':' +
|
|
4555
|
-
d.value +
|
|
4556
|
-
dataType +
|
|
4557
|
-
'</span>';
|
|
4558
|
-
desiredText +=
|
|
4559
|
-
'<span class="title-bar-value">' + d.name + '</span>';
|
|
4560
|
-
return desiredText;
|
|
4561
|
-
}
|
|
4293
|
+
else
|
|
4294
|
+
return;
|
|
4562
4295
|
});
|
|
4563
4296
|
}
|
|
4564
4297
|
function handleMouseOut(d, i) {
|
|
4565
4298
|
if (!self.chartConfiguration.displayTitleOnTop) {
|
|
4566
4299
|
return;
|
|
4567
4300
|
}
|
|
4301
|
+
// svg.selectAll('rect').style('fill', metaData.colors[d.key]);
|
|
4302
|
+
svg.selectAll('rect').style('fill', function (d) {
|
|
4303
|
+
if (!isNaN(d[0]) &&
|
|
4304
|
+
!isNaN(d[1]) &&
|
|
4305
|
+
self.chartData.targetLineData &&
|
|
4306
|
+
parseFloat(d[1]) - parseFloat(d[0]) >=
|
|
4307
|
+
parseFloat(self.chartData.targetLineData.target))
|
|
4308
|
+
return self.chartData?.targetLineData?.barAboveTargetColor;
|
|
4309
|
+
return metaData.colors[d.key];
|
|
4310
|
+
});
|
|
4568
4311
|
svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
4569
4312
|
}
|
|
4570
4313
|
/**
|
|
4571
|
-
*
|
|
4572
|
-
* used by
|
|
4314
|
+
* used to show value on top of the bars
|
|
4315
|
+
* need to be used by bar charts only(one bar should contain one value)
|
|
4316
|
+
* used by weekly charts
|
|
4573
4317
|
*/
|
|
4574
|
-
if (this.chartConfiguration.
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
.
|
|
4578
|
-
.
|
|
4579
|
-
state.selectAll('.barstext').remove();
|
|
4318
|
+
if (this.chartConfiguration.showTotalOnTop != undefined) {
|
|
4319
|
+
rect
|
|
4320
|
+
.append('text')
|
|
4321
|
+
.attr('x', function (d) {
|
|
4322
|
+
return xScale(d.data.name) + xScale.bandwidth() / 2;
|
|
4580
4323
|
})
|
|
4581
|
-
.
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4324
|
+
.attr('class', 'lib-verticalstack-labels-ontop-weklycharts')
|
|
4325
|
+
.attr('y', function (d) {
|
|
4326
|
+
return yScale(d[1]) - 3;
|
|
4327
|
+
})
|
|
4328
|
+
.attr('dy', function (d) {
|
|
4329
|
+
return d.class;
|
|
4330
|
+
})
|
|
4331
|
+
.text(function (d) {
|
|
4332
|
+
if (!isNaN(d[1] - d[0])) {
|
|
4333
|
+
if (d[1] - d[0] == 0) {
|
|
4334
|
+
return;
|
|
4335
|
+
}
|
|
4336
|
+
if (d[1] - d[0] <= 999)
|
|
4337
|
+
return metaData.unit
|
|
4338
|
+
? metaData.unit + formatFromBackend(d[1] - d[0])
|
|
4339
|
+
: formatFromBackend(d[1] - d[0]);
|
|
4340
|
+
else
|
|
4341
|
+
return metaData.unit
|
|
4342
|
+
? metaData.unit + formatForHugeNumbers(d[1] - d[0])
|
|
4343
|
+
: formatForHugeNumbers(d[1] - d[0]);
|
|
4344
|
+
}
|
|
4345
|
+
else
|
|
4346
|
+
return;
|
|
4347
|
+
});
|
|
4348
|
+
}
|
|
4349
|
+
/**
|
|
4350
|
+
* used to show angled values on top of the bars
|
|
4351
|
+
* used by weekly charts
|
|
4352
|
+
*/
|
|
4353
|
+
if (this.chartConfiguration.showAngledLabels != undefined) {
|
|
4354
|
+
rect
|
|
4355
|
+
.append('text')
|
|
4356
|
+
.attr('x', 0)
|
|
4357
|
+
.attr('fill', function (d, i) {
|
|
4358
|
+
return metaData.colors[d.key];
|
|
4359
|
+
})
|
|
4360
|
+
.attr('class', 'lib-data-labels-angled-weeklycharts')
|
|
4361
|
+
.attr('y', 0)
|
|
4362
|
+
.attr('dy', function (d) {
|
|
4363
|
+
return d.class;
|
|
4364
|
+
})
|
|
4365
|
+
.text(function (d) {
|
|
4366
|
+
if (!isNaN(d[1] - d[0]) && d[1] - d[0] > 0) {
|
|
4367
|
+
if (d[1] - d[0] <= 999)
|
|
4368
|
+
return metaData.unit
|
|
4369
|
+
? metaData.unit + formatFromBackend(d[1] - d[0])
|
|
4370
|
+
: formatFromBackend(d[1] - d[0]);
|
|
4371
|
+
else
|
|
4372
|
+
return metaData.unit + formatForHugeNumbers(d[1] - d[0]);
|
|
4373
|
+
}
|
|
4374
|
+
else
|
|
4375
|
+
return;
|
|
4376
|
+
})
|
|
4377
|
+
.attr('transform', function (d) {
|
|
4378
|
+
if (!isNaN(d[1] - d[0]) && d[1] - d[0] > 0) {
|
|
4379
|
+
var total = 0;
|
|
4380
|
+
var incrementer = 1;
|
|
4381
|
+
metaData.keyList.forEach((key) => {
|
|
4382
|
+
if (d.data[key])
|
|
4383
|
+
total = total + d.data[key];
|
|
4384
|
+
else
|
|
4385
|
+
incrementer = 2;
|
|
4594
4386
|
});
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4387
|
+
if (tempObjectHolder[d.data.name] == undefined) {
|
|
4388
|
+
tempObjectHolder[d.data.name] = 1;
|
|
4389
|
+
}
|
|
4390
|
+
else {
|
|
4391
|
+
tempObjectHolder[d.data.name] =
|
|
4392
|
+
tempObjectHolder[d.data.name] + incrementer;
|
|
4393
|
+
}
|
|
4394
|
+
switch (tempObjectHolder[d.data.name]) {
|
|
4395
|
+
case 1:
|
|
4396
|
+
return ('translate(' +
|
|
4397
|
+
(xScale(d.data.name) + xScale.bandwidth() / 3) +
|
|
4398
|
+
',' +
|
|
4399
|
+
(yScale(total) - 3) +
|
|
4400
|
+
') rotate(270)');
|
|
4401
|
+
case 2:
|
|
4402
|
+
return ('translate(' +
|
|
4403
|
+
(xScale(d.data.name) + xScale.bandwidth() / 2 + 2) +
|
|
4404
|
+
',' +
|
|
4405
|
+
(yScale(total) - 3) +
|
|
4406
|
+
') rotate(270)');
|
|
4407
|
+
default:
|
|
4408
|
+
return ('translate(' +
|
|
4409
|
+
(xScale(d.data.name) + (xScale.bandwidth() * 3) / 4) +
|
|
4410
|
+
',' +
|
|
4411
|
+
(yScale(total) - 3) +
|
|
4412
|
+
') rotate(270)');
|
|
4413
|
+
}
|
|
4414
|
+
}
|
|
4415
|
+
return 'rotate(0)';
|
|
4416
|
+
});
|
|
4417
|
+
}
|
|
4418
|
+
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
4419
|
+
if (isMobile) {
|
|
4420
|
+
// Custom x-axis label rendering for mobile: evenly distribute under each bar
|
|
4421
|
+
svg.selectAll('.custom-x-label').remove();
|
|
4422
|
+
data.forEach(function (d, i) {
|
|
4423
|
+
const xVal = leftAndRightSpaces + i * (barWidth + barPadding) + barWidth / 2;
|
|
4424
|
+
svg.append('text')
|
|
4425
|
+
.attr('class', 'custom-x-label')
|
|
4426
|
+
.attr('x', 0)
|
|
4427
|
+
.attr('y', height + 18)
|
|
4428
|
+
.attr('text-anchor', 'middle')
|
|
4429
|
+
.attr('transform', 'translate(' + (xVal + 20) + ',0)') // current value + 20
|
|
4430
|
+
.style('font-size', '10px')
|
|
4431
|
+
.style('fill', 'var(--chart-text-color)')
|
|
4432
|
+
.style('writing-mode', 'sideways-lr') // writing mode for mobile
|
|
4433
|
+
.text(d.name.substring(0, 3));
|
|
4434
|
+
});
|
|
4435
|
+
}
|
|
4436
|
+
else {
|
|
4437
|
+
svg
|
|
4438
|
+
.append('g')
|
|
4439
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4440
|
+
.attr('class', 'lib-stacked-x-axis-text')
|
|
4441
|
+
.call(xAxis)
|
|
4442
|
+
.selectAll('text')
|
|
4443
|
+
.style('fill', 'var(--chart-text-color)')
|
|
4444
|
+
.style('font-size', '12px')
|
|
4445
|
+
.attr('text-anchor', 'middle')
|
|
4446
|
+
.attr('dx', '0')
|
|
4447
|
+
.attr('dy', '0.71em')
|
|
4448
|
+
.attr('transform', null)
|
|
4611
4449
|
.text(function (d) {
|
|
4612
|
-
return d
|
|
4450
|
+
return d;
|
|
4613
4451
|
});
|
|
4452
|
+
}
|
|
4453
|
+
svg
|
|
4454
|
+
.append('g')
|
|
4455
|
+
.attr('class', 'lib-stacked-y-axis-text')
|
|
4456
|
+
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4457
|
+
.attr('transform', 'translate(0,0)')
|
|
4458
|
+
.call(yAxis)
|
|
4459
|
+
.selectAll('text')
|
|
4460
|
+
.style('fill', 'var(--chart-text-color)');
|
|
4461
|
+
}
|
|
4462
|
+
else if (this.chartConfiguration.isDrilldownChart) {
|
|
4463
|
+
svg
|
|
4464
|
+
.append('g')
|
|
4465
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4466
|
+
.attr('class', 'lib-stacked-x-axis-text multichart1')
|
|
4467
|
+
.call(xAxis)
|
|
4468
|
+
.style('display', 'none');
|
|
4469
|
+
svgYAxisLeft
|
|
4470
|
+
.append('g')
|
|
4471
|
+
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
4472
|
+
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4473
|
+
.attr('transform', 'translate(0,0)')
|
|
4474
|
+
.call(yAxis)
|
|
4475
|
+
.selectAll('text')
|
|
4476
|
+
.style('fill', 'var(--chart-text-color)');
|
|
4477
|
+
svgYAxisRight
|
|
4478
|
+
.append('g')
|
|
4479
|
+
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
4480
|
+
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4481
|
+
.attr('transform', 'translate(0,0)')
|
|
4482
|
+
.call(yAxis)
|
|
4483
|
+
.style('display', 'none');
|
|
4484
|
+
}
|
|
4485
|
+
else {
|
|
4486
|
+
svg
|
|
4487
|
+
.append('g')
|
|
4488
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4489
|
+
.attr('class', 'lib-stacked-x-axis-text multichart')
|
|
4490
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4491
|
+
.call(xAxis)
|
|
4492
|
+
.selectAll('text')
|
|
4493
|
+
.style('fill', 'var(--chart-text-color)');
|
|
4494
|
+
svg
|
|
4495
|
+
.append('g')
|
|
4496
|
+
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
4497
|
+
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4498
|
+
.attr('transform', 'translate(0,0)')
|
|
4499
|
+
.call(yAxis)
|
|
4500
|
+
.selectAll('text')
|
|
4501
|
+
.style('fill', 'var(--chart-text-color)');
|
|
4502
|
+
}
|
|
4503
|
+
/**
|
|
4504
|
+
* for existing charts, place xaxis labels nearer to xaxis
|
|
4505
|
+
* used by existing charts
|
|
4506
|
+
*/
|
|
4507
|
+
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
4508
|
+
d3.selectAll('g.lib-stacked-x-axis-text g.tick text').attr('y', function () {
|
|
4509
|
+
if (alternate_text) {
|
|
4510
|
+
alternate_text = false;
|
|
4511
|
+
return long_tick_length + 1;
|
|
4512
|
+
}
|
|
4513
|
+
else {
|
|
4514
|
+
alternate_text = true;
|
|
4515
|
+
return short_tick_length + 1;
|
|
4516
|
+
}
|
|
4614
4517
|
});
|
|
4615
4518
|
}
|
|
4616
|
-
|
|
4617
|
-
.
|
|
4618
|
-
|
|
4619
|
-
.attr('transform', 'translate(0,' + height + ')')
|
|
4620
|
-
.style('color', '#000')
|
|
4621
|
-
.call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
4622
|
-
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
4623
|
-
svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
4624
|
-
svg
|
|
4625
|
-
.append('g')
|
|
4626
|
-
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
4627
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4628
|
-
.attr('transform', 'translate(0,0)')
|
|
4629
|
-
.call(y)
|
|
4630
|
-
.style('display', 'none');
|
|
4631
|
-
svgYAxisLeft
|
|
4632
|
-
.append('g')
|
|
4633
|
-
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
4634
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4635
|
-
.attr('transform', 'translate(0,0)')
|
|
4636
|
-
.call(d3
|
|
4637
|
-
.axisLeft(y)
|
|
4638
|
-
.tickSize(0)
|
|
4639
|
-
.ticks(self.chartConfiguration.numberOfYTicks)
|
|
4640
|
-
.tickFormat(self.chartConfiguration.yAxisLabelFomatter));
|
|
4641
|
-
svgYAxisRight
|
|
4642
|
-
.append('g')
|
|
4643
|
-
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
4644
|
-
.attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
4645
|
-
.attr('transform', 'translate(0,0)')
|
|
4646
|
-
.call(y)
|
|
4647
|
-
.style('display', 'none');
|
|
4519
|
+
else {
|
|
4520
|
+
d3.selectAll('.multichart > g > text').attr('class', 'lib-display-hidden');
|
|
4521
|
+
}
|
|
4648
4522
|
/**
|
|
4649
|
-
* hide
|
|
4650
|
-
* config is there for future use
|
|
4523
|
+
* based of the flag, hide or show xaxis texts
|
|
4651
4524
|
* used by weekly charts
|
|
4652
4525
|
*/
|
|
4653
4526
|
if (this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
4654
4527
|
this.chartConfiguration.isXaxisLabelHidden) {
|
|
4655
|
-
d3.selectAll('
|
|
4528
|
+
d3.selectAll('.multichart > g > text').attr('class', 'lib-display-hidden');
|
|
4529
|
+
}
|
|
4530
|
+
else if (this.chartConfiguration.isXaxisLabelHidden != undefined) {
|
|
4531
|
+
svg
|
|
4532
|
+
.append('g')
|
|
4533
|
+
.attr('class', 'x1 axis1')
|
|
4534
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4535
|
+
.style('color', '#000')
|
|
4536
|
+
.call(d3.axisBottom(xScale).tickSize(0))
|
|
4537
|
+
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
4538
|
+
svg
|
|
4539
|
+
.append('g')
|
|
4540
|
+
.attr('class', 'x2 axis2')
|
|
4541
|
+
.attr('transform', 'translate(0,' + height + ')')
|
|
4542
|
+
.style('color', '#000')
|
|
4543
|
+
.call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
4544
|
+
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
4545
|
+
svg.selectAll('.axis2 > g > text').attr('class', 'lib-display-hidden');
|
|
4546
|
+
// svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
4547
|
+
svg.selectAll('.x1.axis1 .tick line').attr('y2', function () {
|
|
4548
|
+
if (self.chartConfiguration.hideXaxisTick) {
|
|
4549
|
+
return 0;
|
|
4550
|
+
}
|
|
4551
|
+
/**
|
|
4552
|
+
* isNoAlternateXaxisText is used to prevent x-axis label to be displayed in alternate fashion
|
|
4553
|
+
* for future use
|
|
4554
|
+
*/
|
|
4555
|
+
if (alternate_text &&
|
|
4556
|
+
self.chartConfiguration.isNoAlternateXaxisText == undefined) {
|
|
4557
|
+
alternate_text = false;
|
|
4558
|
+
return long_tick_length_bg - 7;
|
|
4559
|
+
}
|
|
4560
|
+
else {
|
|
4561
|
+
alternate_text = true;
|
|
4562
|
+
return short_tick_length_bg - 4;
|
|
4563
|
+
}
|
|
4564
|
+
});
|
|
4565
|
+
/**
|
|
4566
|
+
* reset the flag so that texts also follow the pattern of ticks
|
|
4567
|
+
* used by weekly charts
|
|
4568
|
+
*/
|
|
4569
|
+
alternate_text = false;
|
|
4570
|
+
svg
|
|
4571
|
+
.selectAll('g.x1.axis1 g.tick text')
|
|
4572
|
+
// .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
4573
|
+
.attr('class', function () {
|
|
4574
|
+
if (self.chartConfiguration.isDrilldownChart) {
|
|
4575
|
+
if (data && data.length > 8) {
|
|
4576
|
+
return 'lib-xaxis-labels-texts-drilldown-alt';
|
|
4577
|
+
}
|
|
4578
|
+
return 'lib-xaxis-labels-texts-drilldown';
|
|
4579
|
+
}
|
|
4580
|
+
else
|
|
4581
|
+
return 'lib-xaxis-labels-texts-weeklycharts';
|
|
4582
|
+
})
|
|
4583
|
+
.attr('y', function () {
|
|
4584
|
+
if (alternate_text) {
|
|
4585
|
+
alternate_text = false;
|
|
4586
|
+
return long_tick_length_bg;
|
|
4587
|
+
}
|
|
4588
|
+
else {
|
|
4589
|
+
alternate_text = true;
|
|
4590
|
+
return short_tick_length_bg;
|
|
4591
|
+
}
|
|
4592
|
+
});
|
|
4593
|
+
}
|
|
4594
|
+
if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
4595
|
+
svg
|
|
4596
|
+
.selectAll('g.x1.axis1 g.tick text')
|
|
4597
|
+
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
4598
|
+
.attr('y', short_tick_length_bg)
|
|
4599
|
+
.text(function (d, i) {
|
|
4600
|
+
if (isMobile) {
|
|
4601
|
+
// If label has more than one word, show only first 3 letters of first word
|
|
4602
|
+
var firstWord = d.split(' ')[0];
|
|
4603
|
+
return firstWord.substring(0, 3);
|
|
4604
|
+
}
|
|
4605
|
+
if (d.trim().indexOf(' ') > -1) {
|
|
4606
|
+
return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
4607
|
+
}
|
|
4608
|
+
return d.toLowerCase();
|
|
4609
|
+
})
|
|
4610
|
+
.attr('transform', function (d, i) {
|
|
4611
|
+
if (isMobile) {
|
|
4612
|
+
var totalBars = 0;
|
|
4613
|
+
if (this.parentNode && this.parentNode.parentNode) {
|
|
4614
|
+
totalBars = d3.select(this.parentNode.parentNode).selectAll('g.tick').size();
|
|
4615
|
+
}
|
|
4616
|
+
if (totalBars === 2) {
|
|
4617
|
+
return 'translate(0,0)';
|
|
4618
|
+
}
|
|
4619
|
+
else {
|
|
4620
|
+
return 'translate(' + (i * 30) + ',0)';
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
return null;
|
|
4624
|
+
});
|
|
4625
|
+
svg
|
|
4626
|
+
.selectAll('g.x1.axis1 g.tick')
|
|
4627
|
+
.append('text')
|
|
4628
|
+
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
4629
|
+
.attr('y', long_tick_length_bg)
|
|
4630
|
+
.attr('fill', 'currentColor')
|
|
4631
|
+
.text(function (d) {
|
|
4632
|
+
// For mobile, do not print the second word at all
|
|
4633
|
+
if (isMobile) {
|
|
4634
|
+
return '';
|
|
4635
|
+
}
|
|
4636
|
+
if (d.trim().indexOf(' ') > -1) {
|
|
4637
|
+
return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
|
|
4638
|
+
}
|
|
4639
|
+
return '';
|
|
4640
|
+
})
|
|
4641
|
+
.attr('transform', function (d, i) {
|
|
4642
|
+
if (isMobile && i === 0) {
|
|
4643
|
+
return 'translate(20,0)';
|
|
4644
|
+
}
|
|
4645
|
+
return null;
|
|
4646
|
+
});
|
|
4656
4647
|
}
|
|
4657
4648
|
/**
|
|
4658
|
-
* hide
|
|
4649
|
+
* hide yaxis values
|
|
4659
4650
|
* used by weekly charts
|
|
4660
4651
|
*/
|
|
4661
4652
|
if (this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
4662
4653
|
this.chartConfiguration.isYaxisLabelHidden) {
|
|
4663
|
-
|
|
4654
|
+
svg
|
|
4655
|
+
.selectAll('.yaxis-dashed > g > text')
|
|
4656
|
+
.attr('class', 'lib-display-hidden');
|
|
4664
4657
|
}
|
|
4665
|
-
/**
|
|
4666
|
-
* hide y axis labels
|
|
4658
|
+
/** hide y axis labels
|
|
4667
4659
|
* config is there for future use
|
|
4668
4660
|
*/
|
|
4669
4661
|
if (this.chartConfiguration.isYaxisHidden != undefined &&
|
|
@@ -4678,17 +4670,14 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4678
4670
|
this.chartConfiguration.isYaxisDashed) {
|
|
4679
4671
|
d3.selectAll('.yaxis-dashed')
|
|
4680
4672
|
.style('stroke-dasharray', '5 5')
|
|
4681
|
-
.style('color', '
|
|
4673
|
+
.style('color', 'var(--chart-grid-color)'); // Use CSS variable
|
|
4682
4674
|
}
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
.attr('transform', 'translate(' + 0 + ',0)')
|
|
4690
|
-
.call(yLineAxis);
|
|
4691
|
-
}
|
|
4675
|
+
/**
|
|
4676
|
+
* x axis color
|
|
4677
|
+
* used by weekly charts
|
|
4678
|
+
*/
|
|
4679
|
+
if (this.chartConfiguration.isXaxisColor != undefined) {
|
|
4680
|
+
d3.selectAll('.multichart').style('color', this.chartConfiguration.isXaxisColor || 'var(--chart-text-color)');
|
|
4692
4681
|
}
|
|
4693
4682
|
/**
|
|
4694
4683
|
* used to display y label
|
|
@@ -4696,63 +4685,54 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4696
4685
|
if (this.isZoomedOut) {
|
|
4697
4686
|
svg
|
|
4698
4687
|
.selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
4699
|
-
.attr('class', 'lib-display-hidden');
|
|
4700
|
-
}
|
|
4701
|
-
/**
|
|
4702
|
-
* used to write y labels based on configuration
|
|
4703
|
-
*/
|
|
4704
|
-
if (metaData.yLabel) {
|
|
4705
|
-
svgYAxisLeft
|
|
4706
|
-
.append('text')
|
|
4707
|
-
.attr('class', 'lib-axis-group-label font-size-1')
|
|
4708
|
-
.attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
4709
4688
|
.attr('transform', 'rotate(-90)')
|
|
4710
|
-
.attr('
|
|
4711
|
-
.attr('x',
|
|
4712
|
-
.attr('dy',
|
|
4713
|
-
.style('text-anchor', 'middle');
|
|
4714
|
-
if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
4715
|
-
svgYAxisLeft
|
|
4716
|
-
.selectAll('.lib-axis-group-label')
|
|
4717
|
-
.style('font-size', 'smaller')
|
|
4718
|
-
.text(metaData.yLabel);
|
|
4719
|
-
}
|
|
4720
|
-
else {
|
|
4721
|
-
/**
|
|
4722
|
-
* used by weekly charts
|
|
4723
|
-
*/
|
|
4724
|
-
svg
|
|
4725
|
-
.selectAll('.lib-axis-group-label')
|
|
4726
|
-
.attr('class', 'lib-ylabel-weeklyCharts')
|
|
4727
|
-
.text(metaData.yLabel.toLowerCase());
|
|
4728
|
-
}
|
|
4689
|
+
.attr('text-anchor', 'end')
|
|
4690
|
+
.attr('x', '-5')
|
|
4691
|
+
.attr('dy', null);
|
|
4729
4692
|
}
|
|
4730
|
-
|
|
4693
|
+
function styleAxisDomain() {
|
|
4694
|
+
svg.selectAll('.domain')
|
|
4695
|
+
.style('stroke', 'var(--chart-axis-color)')
|
|
4696
|
+
.style('stroke-width', '1px');
|
|
4697
|
+
svgYAxisLeft.selectAll('.domain')
|
|
4698
|
+
.style('stroke', 'var(--chart-axis-color)')
|
|
4699
|
+
.style('stroke-width', '1px');
|
|
4700
|
+
svgYAxisRight.selectAll('.domain')
|
|
4701
|
+
.style('stroke', 'var(--chart-axis-color)')
|
|
4702
|
+
.style('stroke-width', '1px');
|
|
4703
|
+
}
|
|
4704
|
+
styleAxisDomain();
|
|
4705
|
+
if (metaData.yLabel) {
|
|
4706
|
+
svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
|
|
4731
4707
|
function isAcronym(label) {
|
|
4732
|
-
return (
|
|
4733
|
-
(label === label.toUpperCase() && /[A-Z]/.test(label)));
|
|
4708
|
+
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
4734
4709
|
}
|
|
4735
|
-
const
|
|
4736
|
-
const isAcr = isAcronym(
|
|
4737
|
-
|
|
4710
|
+
const yLabelText = metaData.yLabel;
|
|
4711
|
+
const isAcr = isAcronym(yLabelText.replace(/[^A-Za-z]/g, ''));
|
|
4712
|
+
const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
|
|
4713
|
+
svgYAxisLeft
|
|
4738
4714
|
.append('text')
|
|
4739
4715
|
.attr('class', function () {
|
|
4740
4716
|
let baseClass = 'lib-axis-group-label font-size-1';
|
|
4741
4717
|
if (self.chartConfiguration.isDrilldownChart)
|
|
4742
|
-
return baseClass + ' lib-
|
|
4718
|
+
return baseClass + ' lib-ylabel-drilldowncharts';
|
|
4743
4719
|
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
4744
|
-
return baseClass + ' lib-
|
|
4720
|
+
return baseClass + ' lib-ylabel-weeklyCharts';
|
|
4745
4721
|
return baseClass + ' lib-axis-waterfall-label';
|
|
4746
4722
|
})
|
|
4747
|
-
.attr('style', self.chartConfiguration.
|
|
4748
|
-
.attr('transform', '
|
|
4723
|
+
.attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
4724
|
+
.attr('transform', 'rotate(-90)')
|
|
4725
|
+
.attr('y', yPosition)
|
|
4726
|
+
.attr('x', 0 - height / 2)
|
|
4727
|
+
.attr('dy', '1em')
|
|
4749
4728
|
.style('text-anchor', 'middle')
|
|
4750
4729
|
.style('fill', 'var(--chart-text-color)')
|
|
4751
|
-
.
|
|
4730
|
+
.style('color', 'var(--chart-text-color)')
|
|
4731
|
+
.text(isAcr ? yLabelText.toUpperCase() : yLabelText.toLowerCase())
|
|
4752
4732
|
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
4753
4733
|
}
|
|
4754
4734
|
if (this.chartData.targetLineData) {
|
|
4755
|
-
const yZero =
|
|
4735
|
+
const yZero = yScale(parsedNum);
|
|
4756
4736
|
svg
|
|
4757
4737
|
.append('line')
|
|
4758
4738
|
.attr('x1', 0)
|
|
@@ -4776,7 +4756,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4776
4756
|
.append('xhtml:div')
|
|
4777
4757
|
.attr('class', 'target-display')
|
|
4778
4758
|
.style('color', 'var(--chart-text-color)')
|
|
4779
|
-
.html(function () {
|
|
4759
|
+
.html(function (d, i) {
|
|
4780
4760
|
let dataTypeTemp = '';
|
|
4781
4761
|
let targetLineName = 'target';
|
|
4782
4762
|
if (metaData.dataType) {
|
|
@@ -4794,119 +4774,156 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4794
4774
|
'</div>');
|
|
4795
4775
|
});
|
|
4796
4776
|
}
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
// svg
|
|
4802
|
-
// .selectAll('.lib-axis-group-label')
|
|
4803
|
-
// .attr('class', 'lib-ylabel-drilldowncharts')
|
|
4804
|
-
// .text(metaData.yLabel.toLowerCase());
|
|
4805
|
-
svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
|
|
4806
|
-
}
|
|
4777
|
+
rect
|
|
4778
|
+
.selectAll('rect')
|
|
4779
|
+
.on('mouseenter', handleMouseOver)
|
|
4780
|
+
.on('mouseout', handleMouseOut);
|
|
4807
4781
|
if (metaData.lineyLabel) {
|
|
4808
|
-
|
|
4782
|
+
svg
|
|
4809
4783
|
.append('text')
|
|
4810
4784
|
.attr('class', 'lib-axis-group-label lib-line-axis')
|
|
4811
4785
|
.attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
4812
|
-
.attr('transform', 'translate(
|
|
4813
|
-
.attr('y', 0 -
|
|
4814
|
-
.attr('x',
|
|
4786
|
+
.attr('transform', 'translate(' + (width - 20) + ',0) rotate(90)')
|
|
4787
|
+
.attr('y', 0 - margin.right * 3)
|
|
4788
|
+
.attr('x', height / 2)
|
|
4815
4789
|
.attr('dy', '5em')
|
|
4816
4790
|
.style('text-anchor', 'middle')
|
|
4817
|
-
.style('font-size', 'smaller')
|
|
4818
4791
|
.text(metaData.lineyLabel);
|
|
4819
4792
|
}
|
|
4820
|
-
if (
|
|
4793
|
+
if (metaData.xLabel) {
|
|
4794
|
+
function isAcronym(label) {
|
|
4795
|
+
return ((label.length <= 4 && /^[A-Z]+$/.test(label)) ||
|
|
4796
|
+
(label === label.toUpperCase() && /[A-Z]/.test(label)));
|
|
4797
|
+
}
|
|
4798
|
+
const xLabelText = metaData.xLabel;
|
|
4799
|
+
const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
4800
|
+
const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 10);
|
|
4821
4801
|
svg
|
|
4822
|
-
.append('
|
|
4823
|
-
.
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
.
|
|
4802
|
+
.append('text')
|
|
4803
|
+
.attr('class', function () {
|
|
4804
|
+
let baseClass = 'lib-axis-group-label font-size-1';
|
|
4805
|
+
if (self.chartConfiguration.isDrilldownChart)
|
|
4806
|
+
return baseClass + ' lib-xlabel-drilldowncharts';
|
|
4807
|
+
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
4808
|
+
return baseClass + ' lib-xlabel-weeklyCharts';
|
|
4809
|
+
return baseClass + ' lib-axis-waterfall-label';
|
|
4810
|
+
})
|
|
4811
|
+
.attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
4812
|
+
.attr('transform', 'translate(' + width / 2 + ' ,' + xPosition + ')')
|
|
4813
|
+
.style('text-anchor', 'middle')
|
|
4814
|
+
.style('fill', 'var(--chart-text-color)')
|
|
4815
|
+
.text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
4816
|
+
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
4817
|
+
}
|
|
4818
|
+
if (lineData && colors) {
|
|
4819
|
+
var dataGroup = d3
|
|
4820
|
+
.nest()
|
|
4821
|
+
.key(function (d) {
|
|
4822
|
+
return d.category;
|
|
4823
|
+
})
|
|
4824
|
+
.entries(lineData);
|
|
4825
|
+
var lineGen = d3
|
|
4828
4826
|
.line()
|
|
4829
4827
|
.x(function (d) {
|
|
4830
|
-
return
|
|
4828
|
+
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
4831
4829
|
})
|
|
4832
4830
|
.y(function (d) {
|
|
4833
4831
|
return lineYscale(d.value);
|
|
4834
|
-
}));
|
|
4835
|
-
var dot = svg
|
|
4836
|
-
.selectAll('myCircles')
|
|
4837
|
-
.data(lineData)
|
|
4838
|
-
.enter()
|
|
4839
|
-
.append('g')
|
|
4840
|
-
.on('click', function (d) {
|
|
4841
|
-
if (!metaData.barWithoutClick ||
|
|
4842
|
-
!metaData.barWithoutClick.length ||
|
|
4843
|
-
(!metaData.barWithoutClick.includes(d?.name) &&
|
|
4844
|
-
!metaData.barWithoutClick.includes(d?.key)))
|
|
4845
|
-
self.handleClick(d);
|
|
4846
4832
|
});
|
|
4847
|
-
|
|
4848
|
-
.
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
})
|
|
4852
|
-
.attr('stroke', 'none')
|
|
4853
|
-
.attr('cx', function (d) {
|
|
4854
|
-
return x(d.name) + x.bandwidth() / 2;
|
|
4855
|
-
})
|
|
4856
|
-
.attr('cy', function (d) {
|
|
4833
|
+
var calculateCX = (d) => {
|
|
4834
|
+
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
4835
|
+
};
|
|
4836
|
+
var calculateCY = (d) => {
|
|
4857
4837
|
return lineYscale(d.value);
|
|
4858
|
-
}
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4838
|
+
};
|
|
4839
|
+
dataGroup.forEach(function (d, i) {
|
|
4840
|
+
svg
|
|
4841
|
+
.append('path')
|
|
4842
|
+
.datum(d.values)
|
|
4843
|
+
.attr('fill', 'none')
|
|
4844
|
+
.attr('stroke', function (d) {
|
|
4845
|
+
if ('category' in d[0]) {
|
|
4846
|
+
return colors[d[0].category];
|
|
4847
|
+
}
|
|
4848
|
+
else {
|
|
4849
|
+
return self.chartConfiguration.lineGraphColor;
|
|
4850
|
+
}
|
|
4851
|
+
})
|
|
4852
|
+
.attr('stroke-width', 2.5) /**line thinkness */
|
|
4853
|
+
.attr('d', lineGen(d.values));
|
|
4854
|
+
var dot = svg
|
|
4855
|
+
.selectAll('myCircles')
|
|
4856
|
+
.data(d.values)
|
|
4857
|
+
.enter()
|
|
4858
|
+
.append('g')
|
|
4859
|
+
.on('click', function (d) {
|
|
4860
|
+
self.handleClick(d);
|
|
4861
|
+
});
|
|
4862
4862
|
dot
|
|
4863
|
-
.append('
|
|
4864
|
-
.attr('
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4863
|
+
.append('circle')
|
|
4864
|
+
.attr('fill', function (d) {
|
|
4865
|
+
if ('category' in d) {
|
|
4866
|
+
return colors[d.category];
|
|
4867
|
+
}
|
|
4868
|
+
else {
|
|
4869
|
+
return self.chartConfiguration.lineGraphColor;
|
|
4870
|
+
}
|
|
4869
4871
|
})
|
|
4870
|
-
.attr('
|
|
4872
|
+
.attr('stroke', 'none')
|
|
4873
|
+
.attr('cx', function (d, i) {
|
|
4874
|
+
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
4875
|
+
})
|
|
4876
|
+
.attr('cy', function (d, i) {
|
|
4871
4877
|
return lineYscale(d.value);
|
|
4872
4878
|
})
|
|
4873
|
-
.attr('
|
|
4874
|
-
.
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4879
|
+
.attr('r', 3) /**radius of circle=5 */
|
|
4880
|
+
.style('cursor', 'pointer');
|
|
4881
|
+
if (self.chartConfiguration.lineGraphColor) {
|
|
4882
|
+
dot
|
|
4883
|
+
.append('text')
|
|
4884
|
+
.attr('class', 'dots')
|
|
4885
|
+
.attr('fill', self.chartConfiguration.lineGraphColor)
|
|
4886
|
+
.attr('style', 'font-size: ' + '.85em;' + 'font-weight:' + 'bold')
|
|
4887
|
+
.attr('x', function (d, i) {
|
|
4888
|
+
return xScale(d.name) + xScale.bandwidth() / 2;
|
|
4889
|
+
})
|
|
4890
|
+
.attr('y', function (d, i) {
|
|
4891
|
+
return lineYscale(d.value);
|
|
4892
|
+
})
|
|
4893
|
+
.attr('dy', '-1em')
|
|
4894
|
+
.text(function (d, i) {
|
|
4895
|
+
return self.chartConfiguration.labelFormatter(d.value);
|
|
4896
|
+
});
|
|
4897
|
+
}
|
|
4898
|
+
});
|
|
4878
4899
|
}
|
|
4900
|
+
// svg.attr('width', 150).style('max-width', 150).style('overflow-x', 'auto');
|
|
4879
4901
|
}
|
|
4880
4902
|
handleClick(d) {
|
|
4881
|
-
if (this.chartData
|
|
4903
|
+
if (this.chartData?.metaData?.hasDrillDown || d?.toggleFrom)
|
|
4882
4904
|
this.clickEvent.emit(d);
|
|
4883
4905
|
}
|
|
4884
4906
|
handleHeaderMenuClick(id) {
|
|
4885
4907
|
this.headerMenuclickEvent.emit(id);
|
|
4886
4908
|
}
|
|
4887
|
-
handleDD1Click(event) {
|
|
4888
|
-
this.isDD1Open = true;
|
|
4889
|
-
this.isDD2Open = false;
|
|
4890
|
-
}
|
|
4891
|
-
handleDD2Click(event) {
|
|
4892
|
-
this.isDD2Open = true;
|
|
4893
|
-
this.isDD1Open = false;
|
|
4894
|
-
}
|
|
4895
4909
|
handleCompareByFilterSelection(event) {
|
|
4896
4910
|
this.clickEvent.emit(event);
|
|
4897
4911
|
}
|
|
4912
|
+
handleZoominZoomoutClick({ isZoomOut, event }) {
|
|
4913
|
+
this.isZoomOutSelected(isZoomOut);
|
|
4914
|
+
}
|
|
4898
4915
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GroupChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4899
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: GroupChartComponent, selector: "lib-group-chart", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["groupchartcontainer"], descendants: true, static: true }, { propertyName: "groupcontainerElt", first: true, predicate: ["groupcontainer"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<div\r\n #groupcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n [style.background-color]=\"chartConfiguration.backgroundColor\"\r\n (resized)=\"onResized($event)\"\r\n>\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 <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\r\n <lib-chart-header-v1\r\n [title]=\"chartData.metaData.title\"\r\n [hasDrillDown]=\"chartData.metaData.hasDrillDown\"\r\n [isEditEnabled]=\"chartData.metaData.isEditEnabled\"\r\n [menuOptions]=\"chartConfiguration.headerMenuOptions\"\r\n [isria]=\"customChartConfiguration.isRia\"\r\n [selectedKpiTooltop]=\"chartConfiguration.selectedKpiTooltop\"\r\n (menuOptionClickEvent)=\"handleHeaderMenuClick($event)\"\r\n [isAlertEnabled]=\"isAlertEnabled\"\r\n *ngIf=\"isHeaderVisible\"\r\n></lib-chart-header-v1>\r\n\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"groupchartcontainer\"\r\n #groupchartcontainer\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:35px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title:after{content:\"\";position:absolute;bottom:0;left:50%;margin-left:-10px;width:0;height:0;border-top:solid 10px #d3d3d3;border-left:solid 10px transparent;border-right:solid 10px transparent}.title-top-text{color:#000;font-size:14px;font-weight:600}.title-bar-name{color:#000;font-size:12px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:#4f4f4f;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 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{background-color:#2e3640}.lib-chart-wrapper:hover .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: ChartHeaderV1Component, selector: "lib-chart-header-v1", inputs: ["isAlertEnabled", "title", "menuOptions", "isEditEnabled", "isria", "hasDrillDown", "selectedKpiTooltop"], outputs: ["menuOptionClickEvent"] }, { 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 }); }
|
|
4916
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: GroupChartComponent, selector: "lib-group-chart", 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: "<div\r\n #groupcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n [style.background-color]=\"chartConfiguration.backgroundColor\"\r\n (resized)=\"onResized($event)\"\r\n>\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 <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\r\n <lib-chart-header-v1\r\n [title]=\"chartData.metaData.title\"\r\n [hasDrillDown]=\"chartData.metaData.hasDrillDown\"\r\n [isEditEnabled]=\"chartData.metaData.isEditEnabled\"\r\n [menuOptions]=\"chartConfiguration.headerMenuOptions\"\r\n [isria]=\"customChartConfiguration.isRia\"\r\n [selectedKpiTooltop]=\"chartConfiguration.selectedKpiTooltop\"\r\n (menuOptionClickEvent)=\"handleHeaderMenuClick($event)\"\r\n [isAlertEnabled]=\"isAlertEnabled\"\r\n *ngIf=\"isHeaderVisible\"\r\n></lib-chart-header-v1>\r\n\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"groupchartcontainer\"\r\n #groupchartcontainer\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:35px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title:after{content:\"\";position:absolute;bottom:0;left:50%;margin-left:-10px;width:0;height:0;border-top:solid 10px #d3d3d3;border-left:solid 10px transparent;border-right:solid 10px transparent}.title-top-text{color:#000;font-size:14px;font-weight:600}.title-bar-name{color:#000;font-size:12px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:#4f4f4f;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 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{background-color:#2e3640}.lib-chart-wrapper:hover .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: ChartHeaderV1Component, selector: "lib-chart-header-v1", inputs: ["isAlertEnabled", "title", "menuOptions", "isEditEnabled", "isria", "hasDrillDown", "selectedKpiTooltop"], outputs: ["menuOptionClickEvent"] }, { 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 }); }
|
|
4900
4917
|
}
|
|
4901
4918
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GroupChartComponent, decorators: [{
|
|
4902
4919
|
type: Component,
|
|
4903
4920
|
args: [{ selector: 'lib-group-chart', encapsulation: ViewEncapsulation.None, template: "<div\r\n #groupcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n [style.background-color]=\"chartConfiguration.backgroundColor\"\r\n (resized)=\"onResized($event)\"\r\n>\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 <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\r\n <lib-chart-header-v1\r\n [title]=\"chartData.metaData.title\"\r\n [hasDrillDown]=\"chartData.metaData.hasDrillDown\"\r\n [isEditEnabled]=\"chartData.metaData.isEditEnabled\"\r\n [menuOptions]=\"chartConfiguration.headerMenuOptions\"\r\n [isria]=\"customChartConfiguration.isRia\"\r\n [selectedKpiTooltop]=\"chartConfiguration.selectedKpiTooltop\"\r\n (menuOptionClickEvent)=\"handleHeaderMenuClick($event)\"\r\n [isAlertEnabled]=\"isAlertEnabled\"\r\n *ngIf=\"isHeaderVisible\"\r\n></lib-chart-header-v1>\r\n\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"groupchartcontainer\"\r\n #groupchartcontainer\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:35px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1}.title:after{content:\"\";position:absolute;bottom:0;left:50%;margin-left:-10px;width:0;height:0;border-top:solid 10px #d3d3d3;border-left:solid 10px transparent;border-right:solid 10px transparent}.title-top-text{color:#000;font-size:14px;font-weight:600}.title-bar-name{color:#000;font-size:12px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:#4f4f4f;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 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{background-color:#2e3640}.lib-chart-wrapper:hover .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"] }]
|
|
4904
4921
|
}], ctorParameters: () => [], propDecorators: { containerElt: [{
|
|
4905
4922
|
type: ViewChild,
|
|
4906
|
-
args: ['
|
|
4907
|
-
}],
|
|
4923
|
+
args: ['verticalstackedchartcontainer', { static: true }]
|
|
4924
|
+
}], verticalstackedcontainerElt: [{
|
|
4908
4925
|
type: ViewChild,
|
|
4909
|
-
args: ['
|
|
4926
|
+
args: ['verticalstackedcontainer', { static: true }]
|
|
4910
4927
|
}], chartData: [{
|
|
4911
4928
|
type: Input
|
|
4912
4929
|
}], customChartConfiguration: [{
|