axidio-styleguide-library1-v2 0.0.889 → 0.0.891

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