axidio-styleguide-library1-v2 0.3.13 → 0.3.14

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.
@@ -6488,11 +6488,9 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6488
6488
  LONG_TICK_LENGTH: 16,
6489
6489
  SHORT_TICK_LENGTH_BG: 5,
6490
6490
  LONG_TICK_LENGTH_BG: 30,
6491
- MIN_MOBILE_BAR_WIDTH: 28, // Adjusted for better mobile fit
6492
- DESKTOP_MIN_BAR_WIDTH: 40,
6493
- TABLET_MIN_BAR_WIDTH: 35, // Added tablet-specific width
6494
- MOBILE_BAR_PADDING: 10, // Reduced padding for mobile
6495
- TABLET_BAR_PADDING: 8, // Added tablet-specific padding
6491
+ DESKTOP_BAR_WIDTH: 40, // Desktop bar width
6492
+ MOBILE_BAR_WIDTH: 25, // Mobile/Tablet bar width (reduced)
6493
+ BAR_GAP: 30, // Gap between bars (increased for better separation)
6496
6494
  ZOOM_THRESHOLD: 30,
6497
6495
  ZOOM_IN_THRESHOLD: 8,
6498
6496
  };
@@ -6557,48 +6555,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6557
6555
  removeExistingChart() {
6558
6556
  d3.select('#' + this.uniqueId).remove();
6559
6557
  }
6560
- getDeviceConfig() {
6561
- const width = window.innerWidth;
6562
- return {
6563
- isMobile: width < 768, // Changed from 576 to 768 for better mobile coverage
6564
- isTablet: width >= 768 && width < 1024, // Changed from 576-992 to 768-1024
6565
- isDesktop: width >= 1024, // Changed from 992 to 1024
6566
- };
6567
- }
6568
- configureResponsiveSettings(device) {
6569
- if (device.isMobile) {
6570
- this.chartConfiguration.margin = { top: 15, right: 5, bottom: 35, left: 25 };
6571
- this.chartConfiguration.numberOfYTicks = 4;
6572
- this.chartConfiguration.svgHeight = 55;
6573
- }
6574
- else if (device.isTablet) {
6575
- this.chartConfiguration.margin = { top: 20, right: 15, bottom: 40, left: 35 };
6576
- this.chartConfiguration.numberOfYTicks = 5;
6577
- this.chartConfiguration.svgHeight = 65;
6578
- }
6579
- else {
6580
- // Desktop/Large screens
6581
- const width = window.innerWidth;
6582
- if (width >= 1920) {
6583
- // Large monitors
6584
- this.chartConfiguration.margin = { top: 35, right: 35, bottom: 55, left: 70 };
6585
- this.chartConfiguration.numberOfYTicks = 8;
6586
- this.chartConfiguration.svgHeight = 85;
6587
- }
6588
- else if (width >= 1366) {
6589
- // Medium monitors
6590
- this.chartConfiguration.margin = { top: 30, right: 30, bottom: 50, left: 60 };
6591
- this.chartConfiguration.numberOfYTicks = 7;
6592
- this.chartConfiguration.svgHeight = 80;
6593
- }
6594
- else {
6595
- // Small desktops/laptops
6596
- this.chartConfiguration.margin = { top: 25, right: 25, bottom: 45, left: 50 };
6597
- this.chartConfiguration.numberOfYTicks = 6;
6598
- this.chartConfiguration.svgHeight = 75;
6599
- }
6600
- }
6601
- }
6602
6558
  mergeConfigurations() {
6603
6559
  for (const key in this.defaultConfiguration) {
6604
6560
  this.chartConfiguration[key] = ChartHelper.getValueByConfigurationType(key, this.defaultConfiguration, this.customChartConfiguration);
@@ -6617,26 +6573,20 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6617
6573
  }
6618
6574
  return metaData;
6619
6575
  }
6620
- calculateDimensions(chartContainer, verticalContainer, margin, device, dataLength) {
6576
+ calculateDimensions(chartContainer, verticalContainer, margin, dataLength) {
6621
6577
  const containerWidth = chartContainer.node().getBoundingClientRect().width;
6622
6578
  const containerHeight = verticalContainer.node().getBoundingClientRect().height;
6623
- let width = containerWidth - margin.left - margin.right;
6579
+ const leftAxisWidth = 80;
6580
+ const rightAxisWidth = this.CONSTANTS.RIGHT_SVG_WIDTH;
6581
+ const availableWidth = containerWidth - leftAxisWidth - rightAxisWidth;
6582
+ let width = availableWidth - margin.left - margin.right;
6624
6583
  let height = containerHeight * (this.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
6625
- // Responsive zoom handling
6626
6584
  if (dataLength > this.CONSTANTS.ZOOM_THRESHOLD && this.isZoomedOut) {
6627
- const minWidth = device.isMobile
6628
- ? dataLength * 12
6629
- : device.isTablet
6630
- ? dataLength * 20
6631
- : dataLength * 25;
6585
+ const minWidth = dataLength * 25;
6632
6586
  width = Math.max(width, minWidth);
6633
6587
  }
6634
6588
  if (dataLength > this.CONSTANTS.ZOOM_IN_THRESHOLD && !this.isZoomedOut) {
6635
- width = device.isMobile
6636
- ? dataLength * 50
6637
- : device.isTablet
6638
- ? dataLength * 90
6639
- : dataLength * 130;
6589
+ width = dataLength * 130;
6640
6590
  }
6641
6591
  if (this.chartConfiguration.isFullScreen) {
6642
6592
  height = this.chartConfiguration.svgHeight !== 80
@@ -6644,28 +6594,41 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6644
6594
  : containerHeight;
6645
6595
  }
6646
6596
  if (this.chartConfiguration.isDrilldownChart) {
6647
- const offset = device.isMobile ? 60 : device.isTablet ? 90 : 130;
6648
- height = containerHeight - margin.top - margin.bottom - offset;
6597
+ height = containerHeight - margin.top - margin.bottom - 130;
6649
6598
  }
6599
+ const isMobileOrTablet = window.innerWidth < 1024;
6650
6600
  let barWidth;
6651
6601
  let barPadding;
6652
- let requiredSvgWidth;
6653
- if (device.isMobile) {
6654
- barWidth = this.CONSTANTS.MIN_MOBILE_BAR_WIDTH;
6655
- barPadding = this.CONSTANTS.MOBILE_BAR_PADDING;
6656
- requiredSvgWidth = Math.max(width - this.CONSTANTS.RIGHT_SVG_WIDTH, (barWidth + barPadding) * dataLength + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 +
6657
- this.CONSTANTS.RIGHT_SVG_WIDTH - barPadding);
6658
- }
6659
- else if (device.isTablet) {
6660
- barWidth = this.CONSTANTS.TABLET_MIN_BAR_WIDTH;
6661
- barPadding = this.CONSTANTS.TABLET_BAR_PADDING;
6662
- requiredSvgWidth = Math.max(width - this.CONSTANTS.RIGHT_SVG_WIDTH, (barWidth + barPadding) * dataLength + this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
6602
+ if (isMobileOrTablet) {
6603
+ if (dataLength === 1) {
6604
+ barWidth = 60;
6605
+ barPadding = 0;
6606
+ }
6607
+ else if (dataLength === 2) {
6608
+ barWidth = 50;
6609
+ barPadding = 45;
6610
+ }
6611
+ else if (dataLength === 3) {
6612
+ barWidth = 45;
6613
+ barPadding = 40;
6614
+ }
6615
+ else if (dataLength <= 5) {
6616
+ barWidth = 35;
6617
+ barPadding = 30;
6618
+ }
6619
+ else {
6620
+ barWidth = 25;
6621
+ barPadding = 25;
6622
+ }
6663
6623
  }
6664
6624
  else {
6665
- barWidth = Math.max(this.CONSTANTS.DESKTOP_MIN_BAR_WIDTH, (width - this.CONSTANTS.RIGHT_SVG_WIDTH - this.CONSTANTS.LEFT_RIGHT_SPACES * 2) / dataLength);
6666
- barPadding = 0;
6667
- requiredSvgWidth = width - this.CONSTANTS.RIGHT_SVG_WIDTH;
6625
+ barWidth = this.CONSTANTS.DESKTOP_BAR_WIDTH;
6626
+ barPadding = this.CONSTANTS.BAR_GAP;
6668
6627
  }
6628
+ const totalBarsWidth = barWidth * dataLength;
6629
+ const totalGaps = barPadding * (dataLength - 1);
6630
+ const minRequiredWidth = totalBarsWidth + totalGaps + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
6631
+ const requiredSvgWidth = Math.max(availableWidth, minRequiredWidth);
6669
6632
  return {
6670
6633
  width,
6671
6634
  height,
@@ -6676,63 +6639,110 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6676
6639
  requiredSvgWidth,
6677
6640
  };
6678
6641
  }
6679
- createSvgContainers(chartContainer, dimensions, margin) {
6680
- const outerContainer = chartContainer
6642
+ createSvgContainers(chartContainer, dimensions, margin, hasXLabel // Add this parameter
6643
+ ) {
6644
+ // Calculate total height including space for X-axis label if present
6645
+ const xLabelSpace = hasXLabel ? 30 : 0;
6646
+ const totalHeight = dimensions.height + margin.top + margin.bottom + xLabelSpace;
6647
+ // Main wrapper
6648
+ const chartWrapper = chartContainer
6681
6649
  .append('div')
6682
6650
  .attr('id', this.uniqueId)
6683
- .attr('class', 'outer-container')
6651
+ .attr('class', 'chart-wrapper-main')
6652
+ .style('position', 'relative')
6684
6653
  .style('width', '100%')
6685
- .style('height', dimensions.height)
6686
- .style('overflow-x', 'hidden')
6687
- .style('padding-left', `${margin.left}px`)
6688
- .style('margin-left', '10px')
6689
- .style('padding-right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`);
6690
- const svgYAxisLeft = outerContainer
6654
+ .style('height', `${totalHeight}px`); // Include X-label space
6655
+ // Left Y-axis - Fixed
6656
+ const leftAxisContainer = chartWrapper
6657
+ .append('div')
6658
+ .attr('class', 'left-axis-container')
6659
+ .style('position', 'absolute')
6660
+ .style('left', '0')
6661
+ .style('top', '0')
6662
+ .style('width', '80px')
6663
+ .style('height', `${dimensions.height + margin.top + margin.bottom}px`) // Exclude X-label space
6664
+ .style('background-color', 'var(--card-bg)')
6665
+ .style('z-index', '10');
6666
+ const svgYAxisLeft = leftAxisContainer
6691
6667
  .append('svg')
6692
6668
  .attr('width', '80')
6693
6669
  .attr('height', dimensions.height + margin.top + margin.bottom)
6694
- .style('position', 'absolute')
6695
- .style('left', '0')
6696
- .style('z-index', 1)
6697
6670
  .append('g')
6698
6671
  .attr('transform', `translate(${margin.left + 10},${margin.top})`);
6699
- const svgYAxisRight = outerContainer
6672
+ // Right Y-axis - Fixed
6673
+ const rightAxisContainer = chartWrapper
6674
+ .append('div')
6675
+ .attr('class', 'right-axis-container')
6676
+ .style('position', 'absolute')
6677
+ .style('right', '0')
6678
+ .style('top', '0')
6679
+ .style('width', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`)
6680
+ .style('height', `${dimensions.height + margin.top + margin.bottom}px`) // Exclude X-label space
6681
+ .style('background-color', 'var(--card-bg)')
6682
+ .style('z-index', '10');
6683
+ const svgYAxisRight = rightAxisContainer
6700
6684
  .append('svg')
6701
6685
  .attr('width', this.CONSTANTS.RIGHT_SVG_WIDTH)
6702
6686
  .attr('height', dimensions.height + margin.top + margin.bottom)
6703
- .style('position', 'absolute')
6704
- .style('right', '2px')
6705
- .style('z-index', 1)
6706
6687
  .append('g')
6707
6688
  .attr('transform', `translate(0,${margin.top})`);
6708
- const innerContainer = outerContainer
6689
+ // Scrollable middle area
6690
+ const scrollableContainer = chartWrapper
6709
6691
  .append('div')
6710
- .attr('class', 'inner-container')
6711
- .style('width', '100%')
6712
- .style('overflow-x', 'auto');
6692
+ .attr('class', 'scrollable-chart-container')
6693
+ .style('position', 'absolute')
6694
+ .style('left', '80px')
6695
+ .style('right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`)
6696
+ .style('top', '0')
6697
+ .style('width', 'auto')
6698
+ .style('height', `${dimensions.height + margin.top + margin.bottom}px`) // Exclude X-label space
6699
+ .style('overflow-x', 'auto')
6700
+ .style('overflow-y', 'hidden');
6701
+ const innerContainer = scrollableContainer
6702
+ .append('div')
6703
+ .attr('class', 'inner-chart-container')
6704
+ .style('min-width', '100%');
6713
6705
  const svg = innerContainer
6714
6706
  .append('svg')
6715
6707
  .attr('width', dimensions.requiredSvgWidth)
6716
6708
  .attr('height', dimensions.height + margin.top + margin.bottom + 30)
6717
6709
  .append('g')
6718
6710
  .attr('transform', `translate(0,${margin.top})`);
6719
- return { svg, svgYAxisLeft, svgYAxisRight, innerContainer };
6720
- }
6721
- createScales(data, layers, lineData, dimensions, device) {
6711
+ // Fixed bottom container for X-axis label
6712
+ const bottomLabelContainer = chartWrapper
6713
+ .append('div')
6714
+ .attr('class', 'bottom-label-container')
6715
+ .style('position', 'absolute')
6716
+ .style('left', '80px')
6717
+ .style('right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`)
6718
+ .style('bottom', '0')
6719
+ .style('height', `${xLabelSpace}px`)
6720
+ .style('display', 'flex')
6721
+ .style('justify-content', 'center')
6722
+ .style('align-items', 'center')
6723
+ .style('background-color', 'var(--card-bg)')
6724
+ .style('z-index', '10');
6725
+ return { svg, svgYAxisLeft, svgYAxisRight, innerContainer, bottomLabelContainer };
6726
+ }
6727
+ createScales(data, layers, lineData, dimensions) {
6722
6728
  const { width, height, barWidth, barPadding } = dimensions;
6723
- // Adjust padding based on device
6724
- const padding = device.isMobile ? 0.15 : device.isTablet ? 0.3 : 0.5;
6729
+ // Calculate bar positioning
6730
+ const totalBarsWidth = data.length * barWidth;
6731
+ const totalSpacing = (data.length - 1) * barPadding;
6732
+ const requiredWidth = totalBarsWidth + totalSpacing + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
6733
+ const effectiveWidth = Math.max(width, requiredWidth);
6734
+ const paddingRatio = barPadding / (barWidth + barPadding);
6735
+ // X-scale starts from 0 (no left spacing for grid alignment)
6725
6736
  const xScale = d3
6726
6737
  .scaleBand()
6727
- .rangeRound([
6728
- this.CONSTANTS.LEFT_RIGHT_SPACES,
6729
- width - this.CONSTANTS.RIGHT_SVG_WIDTH - this.CONSTANTS.LEFT_RIGHT_SPACES
6730
- ])
6738
+ .rangeRound([0, dimensions.requiredSvgWidth]) // Full width from 0
6731
6739
  .domain(data.map(d => d.name).reverse())
6732
- .padding(padding);
6740
+ .paddingInner(paddingRatio)
6741
+ .paddingOuter(0)
6742
+ .align(0.5);
6733
6743
  const xScaleFromOrigin = d3
6734
6744
  .scaleBand()
6735
- .rangeRound([width - this.CONSTANTS.RIGHT_SVG_WIDTH, 0])
6745
+ .rangeRound([width, 0])
6736
6746
  .domain(data.map(d => d.name).reverse());
6737
6747
  const yScale = d3.scaleLinear().rangeRound([height, 0]);
6738
6748
  let maxValue = d3.max(layers, (d) => d3.max(d, (d) => d[1]));
@@ -6778,7 +6788,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6778
6788
  }
6779
6789
  return { xAxis, yAxis, yLineAxis };
6780
6790
  }
6781
- renderBars(svg, layers, scales, metaData, dimensions, device) {
6791
+ renderBars(svg, layers, scales, metaData, dimensions) {
6782
6792
  const layer = svg
6783
6793
  .selectAll('.layer')
6784
6794
  .data(layers)
@@ -6790,11 +6800,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6790
6800
  .selectAll('rect')
6791
6801
  .data((d) => d)
6792
6802
  .enter();
6793
- this.appendRectangles(rect, scales, metaData, dimensions, device);
6803
+ this.appendRectangles(rect, scales, metaData, dimensions);
6794
6804
  this.addInteractions(rect, svg, metaData, scales);
6795
6805
  return rect;
6796
6806
  }
6797
- appendRectangles(rect, scales, metaData, dimensions, device) {
6807
+ appendRectangles(rect, scales, metaData, dimensions) {
6798
6808
  const { barWidth, barPadding } = dimensions;
6799
6809
  const { xScale, yScale } = scales;
6800
6810
  rect
@@ -6813,17 +6823,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6813
6823
  }
6814
6824
  return 0;
6815
6825
  })
6816
- .attr('x', (d, i) => {
6817
- if (device.isMobile) {
6818
- return this.CONSTANTS.LEFT_RIGHT_SPACES + i * (barWidth + barPadding);
6819
- }
6826
+ .attr('x', (d) => {
6827
+ const xPosition = xScale(d.data.name);
6828
+ const bandwidth = xScale.bandwidth();
6820
6829
  if (!this.chartConfiguration.isMultiChartGridLine) {
6821
- return xScale(d.data.name);
6830
+ return xPosition + (bandwidth - barWidth) / 2;
6822
6831
  }
6823
6832
  if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
6824
- return xScale(d.data.name) + xScale.bandwidth() / 2 - 35;
6833
+ return xPosition + bandwidth / 2 - 35;
6825
6834
  }
6826
- return xScale(d.data.name) + xScale.bandwidth() * 0.1;
6835
+ const calculatedWidth = bandwidth * 0.8;
6836
+ return xPosition + (bandwidth - calculatedWidth) / 2;
6827
6837
  })
6828
6838
  .attr('height', (d) => {
6829
6839
  if (!isNaN(d[0]) && !isNaN(d[1])) {
@@ -6833,10 +6843,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6833
6843
  return 0;
6834
6844
  })
6835
6845
  .attr('width', (d) => {
6836
- if (device.isMobile)
6837
- return barWidth;
6838
6846
  if (!this.chartConfiguration.isMultiChartGridLine)
6839
- return xScale.bandwidth();
6847
+ return barWidth;
6840
6848
  if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
6841
6849
  return 70;
6842
6850
  }
@@ -6892,23 +6900,13 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6892
6900
  const value = d[1] - d[0];
6893
6901
  if (isNaN(value))
6894
6902
  return;
6895
- const device = this.getDeviceConfig();
6896
6903
  const bandwidth = xScale.bandwidth();
6897
- // Responsive tooltip width
6898
- let width;
6899
- if (device.isMobile) {
6900
- width = Math.min(bandwidth + 40, 150);
6901
- }
6902
- else if (device.isTablet) {
6903
- width = Math.min(bandwidth + 60, 200);
6904
- }
6905
- else {
6906
- width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
6907
- ? '250px'
6908
- : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
6909
- ? '180px'
6910
- : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
6911
- }
6904
+ // Fixed tooltip width for all resolutions
6905
+ const width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
6906
+ ? '250px'
6907
+ : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
6908
+ ? '180px'
6909
+ : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
6912
6910
  svg
6913
6911
  .append('foreignObject')
6914
6912
  .attr('x', this.calculateTooltipX(d, xScale, width))
@@ -6947,12 +6945,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6947
6945
  .style('fill', (d) => this.getBarColor(d, metaData));
6948
6946
  svg.selectAll('.lib-verticalstack-title-ontop').remove();
6949
6947
  }
6950
- renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin) {
6948
+ renderAxisLabels(svg, svgYAxisLeft, bottomLabelContainer, metaData, dimensions, margin) {
6951
6949
  if (metaData.yLabel) {
6952
6950
  this.addYAxisLabel(svgYAxisLeft, metaData.yLabel, dimensions.height, margin);
6953
6951
  }
6954
6952
  if (metaData.xLabel) {
6955
- this.addXAxisLabel(svg, metaData.xLabel, dimensions.width, dimensions.height, margin);
6953
+ this.addXAxisLabel(bottomLabelContainer, metaData.xLabel);
6956
6954
  }
6957
6955
  }
6958
6956
  addYAxisLabel(svgYAxisLeft, label, height, margin) {
@@ -6973,21 +6971,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6973
6971
  .text(isAcronym ? label.toUpperCase() : label.toLowerCase())
6974
6972
  .style('text-transform', isAcronym ? 'none' : 'capitalize');
6975
6973
  }
6976
- addXAxisLabel(svg, label, width, height, margin) {
6977
- const isria = this.customChartConfiguration?.isRia;
6974
+ addXAxisLabel(bottomLabelContainer, label) {
6978
6975
  const isAcronym = this.isAcronymLabel(label);
6979
- const xPosition = isria
6980
- ? height + margin.top + margin.bottom
6981
- : height + margin.top + margin.bottom + 10;
6982
- svg
6983
- .append('text')
6984
- .attr('class', this.getXAxisLabelClass())
6985
- .attr('style', this.chartConfiguration.xAxisCustomlabelStyles)
6986
- .attr('transform', `translate(${width / 2},${xPosition})`)
6987
- .style('text-anchor', 'middle')
6988
- .style('fill', 'var(--chart-text-color)')
6989
- .text(isAcronym ? label.toUpperCase() : label.toLowerCase())
6990
- .style('text-transform', isAcronym ? 'none' : 'capitalize');
6976
+ bottomLabelContainer
6977
+ .append('div')
6978
+ .style('width', '100%')
6979
+ .style('text-align', 'center')
6980
+ .style('font-size', '12px')
6981
+ .style('font-weight', '600')
6982
+ .style('font-family', 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto')
6983
+ .style('color', 'var(--chart-text-color)')
6984
+ .style('text-transform', isAcronym ? 'none' : 'capitalize')
6985
+ .text(isAcronym ? label.toUpperCase() : label.toLowerCase());
6991
6986
  }
6992
6987
  isAcronymLabel(label) {
6993
6988
  const cleanLabel = label.replace(/[^A-Za-z]/g, '');
@@ -7026,8 +7021,10 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7026
7021
  }
7027
7022
  }
7028
7023
  initializeStackedChart() {
7029
- const device = this.getDeviceConfig();
7030
- this.configureResponsiveSettings(device);
7024
+ // Use fixed configuration for all resolutions
7025
+ this.chartConfiguration.margin = { top: 20, right: 20, bottom: 40, left: 40 };
7026
+ this.chartConfiguration.numberOfYTicks = 5;
7027
+ this.chartConfiguration.svgHeight = 70;
7031
7028
  this.mergeConfigurations();
7032
7029
  this.applyConfigurationFlags();
7033
7030
  const data = this.chartData.data;
@@ -7038,17 +7035,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7038
7035
  const chartContainer = d3.select(this.containerElt.nativeElement);
7039
7036
  const verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
7040
7037
  const margin = this.chartConfiguration.margin;
7041
- const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, device, data.length);
7042
- const { svg, svgYAxisLeft, svgYAxisRight } = this.createSvgContainers(chartContainer, dimensions, margin);
7038
+ const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, data.length);
7039
+ const hasXLabel = !!metaData.xLabel;
7040
+ const { svg, svgYAxisLeft, svgYAxisRight, bottomLabelContainer } = this.createSvgContainers(chartContainer, dimensions, margin, hasXLabel);
7043
7041
  const stack = d3.stack().keys(keyList).offset(d3.stackOffsetNone);
7044
7042
  const layers = stack(data);
7045
7043
  data.sort((a, b) => b.total - a.total);
7046
- const scales = this.createScales(data, layers, lineData, dimensions, device);
7044
+ const scales = this.createScales(data, layers, lineData, dimensions);
7047
7045
  const axes = this.createAxes(scales);
7048
7046
  this.renderGrids(svg, scales, dimensions);
7049
- const rect = this.renderBars(svg, layers, scales, metaData, dimensions, device);
7050
- this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, device, data);
7051
- this.renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin);
7047
+ const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
7048
+ this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
7049
+ this.renderAxisLabels(svg, svgYAxisLeft, bottomLabelContainer, metaData, dimensions, margin);
7052
7050
  this.renderTargetLine(svg, svgYAxisRight, scales, dimensions, metaData);
7053
7051
  this.renderDataLabels(rect, scales, metaData, dimensions);
7054
7052
  this.renderLineChart(svg, lineData, scales, colors, metaData);
@@ -7057,7 +7055,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7057
7055
  if (this.chartConfiguration.isXgridBetweenLabels) {
7058
7056
  svg
7059
7057
  .append('g')
7060
- .attr('class', 'grid')
7058
+ .attr('class', 'grid vertical-grid')
7061
7059
  .attr('transform', `translate(${scales.xScale.bandwidth() / 2},${dimensions.height})`)
7062
7060
  .call(d3.axisBottom(scales.xScale).tickSize(-dimensions.height).tickFormat(''))
7063
7061
  .style('stroke-dasharray', '5 5')
@@ -7065,16 +7063,25 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7065
7063
  .call((g) => g.select('.domain').remove());
7066
7064
  }
7067
7065
  if (this.chartConfiguration.yAxisGrid) {
7066
+ // Grid lines start from x=0 (no gap with Y-axis)
7067
+ const gridWidth = dimensions.requiredSvgWidth;
7068
7068
  svg
7069
7069
  .append('g')
7070
- .attr('class', 'grid')
7070
+ .attr('class', 'grid horizontal-grid')
7071
+ .attr('transform', 'translate(0,0)') // Start from x=0
7071
7072
  .call(d3
7072
7073
  .axisLeft(scales.yScale)
7073
7074
  .ticks(this.chartConfiguration.numberOfYTicks)
7074
- .tickSize(-dimensions.width)
7075
+ .tickSize(-gridWidth)
7075
7076
  .tickFormat(''))
7076
7077
  .style('color', 'var(--chart-grid-color)')
7077
- .style('opacity', '1');
7078
+ .style('opacity', '1')
7079
+ .call((g) => {
7080
+ g.select('.domain').remove();
7081
+ g.selectAll('line')
7082
+ .attr('x1', 0)
7083
+ .attr('x2', -gridWidth);
7084
+ });
7078
7085
  }
7079
7086
  if (this.chartConfiguration.xAxisGrid) {
7080
7087
  for (let j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
@@ -7088,7 +7095,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7088
7095
  }
7089
7096
  }
7090
7097
  }
7091
- renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, device, data) {
7098
+ renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data) {
7092
7099
  if (this.chartConfiguration.showXaxisTop) {
7093
7100
  svg
7094
7101
  .append('g')
@@ -7098,7 +7105,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7098
7105
  svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
7099
7106
  }
7100
7107
  if (!this.chartConfiguration.isMultiChartGridLine) {
7101
- this.renderStandardAxes(svg, axes, scales, dimensions, device, data);
7108
+ this.renderStandardAxes(svg, axes, scales, dimensions, data);
7102
7109
  }
7103
7110
  else if (this.chartConfiguration.isDrilldownChart) {
7104
7111
  this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions);
@@ -7109,24 +7116,35 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7109
7116
  this.applyAxisStyling(svg, svgYAxisLeft, svgYAxisRight);
7110
7117
  this.applyAxisConfigurations(svg, scales, dimensions, data);
7111
7118
  }
7112
- renderStandardAxes(svg, axes, scales, dimensions, device, data) {
7113
- if (device.isMobile) {
7114
- this.renderMobileXAxis(svg, data, dimensions);
7115
- }
7116
- else {
7117
- svg
7118
- .append('g')
7119
- .attr('transform', `translate(0,${dimensions.height})`)
7120
- .attr('class', 'lib-stacked-x-axis-text')
7121
- .call(axes.xAxis)
7122
- .selectAll('text')
7123
- .style('fill', 'var(--chart-text-color)')
7124
- .style('font-size', '12px')
7125
- .attr('text-anchor', 'middle')
7126
- .attr('dx', '0')
7127
- .attr('dy', '0.71em')
7128
- .attr('transform', null);
7129
- }
7119
+ renderStandardAxes(svg, axes, scales, dimensions, data) {
7120
+ const isMobileOrTablet = window.innerWidth < 1024;
7121
+ // X-axis with labels
7122
+ const xAxisGroup = svg
7123
+ .append('g')
7124
+ .attr('transform', `translate(0,${dimensions.height})`)
7125
+ .attr('class', 'lib-stacked-x-axis-text')
7126
+ .call(axes.xAxis);
7127
+ // Style X-axis labels
7128
+ xAxisGroup
7129
+ .selectAll('text')
7130
+ .style('fill', 'var(--chart-text-color)')
7131
+ .style('font-size', isMobileOrTablet ? '10px' : '12px')
7132
+ .attr('text-anchor', 'middle')
7133
+ .attr('dy', '1em')
7134
+ .each(function (d) {
7135
+ const textElement = d3.select(this);
7136
+ const text = textElement.text();
7137
+ if (isMobileOrTablet && text.length > 12) {
7138
+ textElement.text(text.substring(0, 10) + '...');
7139
+ }
7140
+ });
7141
+ // Ensure X-axis line is visible
7142
+ xAxisGroup
7143
+ .select('.domain')
7144
+ .style('stroke', 'var(--chart-axis-color)')
7145
+ .style('stroke-width', '1px')
7146
+ .attr('d', `M0,0H${dimensions.requiredSvgWidth}`);
7147
+ // Y-axis
7130
7148
  svg
7131
7149
  .append('g')
7132
7150
  .attr('class', 'lib-stacked-y-axis-text')
@@ -7135,27 +7153,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7135
7153
  .selectAll('text')
7136
7154
  .style('fill', 'var(--chart-text-color)');
7137
7155
  }
7138
- renderMobileXAxis(svg, data, dimensions) {
7139
- svg.selectAll('.custom-x-label').remove();
7140
- const maxLength = Math.max(...data.map(d => d.name.length));
7141
- const fontSize = maxLength > 10 ? '8px' : '10px';
7142
- data.forEach((d, i) => {
7143
- const xVal = this.CONSTANTS.LEFT_RIGHT_SPACES +
7144
- i * (dimensions.barWidth + dimensions.barPadding) +
7145
- dimensions.barWidth / 2;
7146
- svg
7147
- .append('text')
7148
- .attr('class', 'custom-x-label')
7149
- .attr('x', 0)
7150
- .attr('y', dimensions.height + 18)
7151
- .attr('text-anchor', 'middle')
7152
- .attr('transform', `translate(${xVal + 20},0)`)
7153
- .style('font-size', fontSize)
7154
- .style('fill', 'var(--chart-text-color)')
7155
- .style('writing-mode', 'sideways-lr')
7156
- .text(d.name.length > 6 ? d.name.substring(0, 4) + '...' : d.name);
7157
- });
7158
- }
7159
7156
  renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions) {
7160
7157
  svg
7161
7158
  .append('g')
@@ -7237,7 +7234,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7237
7234
  }
7238
7235
  }
7239
7236
  renderCustomXAxis(svg, scales, dimensions, data) {
7240
- const device = this.getDeviceConfig();
7241
7237
  svg
7242
7238
  .append('g')
7243
7239
  .attr('class', 'x1 axis1')
@@ -7245,12 +7241,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7245
7241
  .style('color', '#000')
7246
7242
  .call(d3.axisBottom(scales.xScale).tickSize(0))
7247
7243
  .call((g) => g.select('.domain').attr('fill', 'none'));
7248
- this.styleCustomXAxisTicks(svg, data, device);
7244
+ this.styleCustomXAxisTicks(svg, data);
7249
7245
  if (this.chartConfiguration.xLabelsOnSameLine) {
7250
- this.applyXLabelsOnSameLine(svg, device);
7246
+ this.applyXLabelsOnSameLine(svg);
7251
7247
  }
7252
7248
  }
7253
- styleCustomXAxisTicks(svg, data, device) {
7249
+ styleCustomXAxisTicks(svg, data) {
7254
7250
  let alternateText = false;
7255
7251
  svg.selectAll('.x1.axis1 .tick line').attr('y2', () => {
7256
7252
  if (this.chartConfiguration.hideXaxisTick)
@@ -7282,28 +7278,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7282
7278
  return this.CONSTANTS.SHORT_TICK_LENGTH_BG;
7283
7279
  });
7284
7280
  }
7285
- applyXLabelsOnSameLine(svg, device) {
7281
+ applyXLabelsOnSameLine(svg) {
7286
7282
  svg
7287
7283
  .selectAll('g.x1.axis1 g.tick text')
7288
7284
  .attr('class', 'lib-xaxis-labels-texts-drilldown')
7289
7285
  .attr('y', this.CONSTANTS.SHORT_TICK_LENGTH_BG)
7290
7286
  .text((d) => {
7291
- if (device.isMobile) {
7292
- return d.split(' ')[0].substring(0, 3);
7293
- }
7294
7287
  const trimmed = d.trim();
7295
7288
  const spaceIndex = trimmed.indexOf(' ');
7296
7289
  return spaceIndex > -1
7297
7290
  ? trimmed.substring(0, spaceIndex).toLowerCase()
7298
7291
  : trimmed.toLowerCase();
7299
- })
7300
- .attr('transform', function (d, i) {
7301
- if (device.isMobile) {
7302
- const parent = this.parentNode?.parentNode;
7303
- const totalBars = parent ? d3.select(parent).selectAll('g.tick').size() : 0;
7304
- return totalBars === 2 ? 'translate(0,0)' : `translate(${i * 30},0)`;
7305
- }
7306
- return null;
7307
7292
  });
7308
7293
  svg
7309
7294
  .selectAll('g.x1.axis1 g.tick')
@@ -7312,16 +7297,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7312
7297
  .attr('y', this.CONSTANTS.LONG_TICK_LENGTH_BG)
7313
7298
  .attr('fill', 'currentColor')
7314
7299
  .text((d) => {
7315
- if (device.isMobile)
7316
- return '';
7317
7300
  const trimmed = d.trim();
7318
7301
  const spaceIndex = trimmed.indexOf(' ');
7319
7302
  return spaceIndex > -1
7320
7303
  ? trimmed.substring(spaceIndex).toLowerCase()
7321
7304
  : '';
7322
- })
7323
- .attr('transform', (d, i) => {
7324
- return device.isMobile && i === 0 ? 'translate(20,0)' : null;
7325
7305
  });
7326
7306
  }
7327
7307
  renderDataLabels(rect, scales, metaData, dimensions) {
@@ -7512,11 +7492,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7512
7492
  this.isZoomOutSelected(isZoomOut);
7513
7493
  }
7514
7494
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7515
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;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:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.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}.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}@media (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:9px!important}.lib-axis-group-label{font-size:10px!important}.dots{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr;font-size:9px!important}.target-display{font-size:9px;line-height:11px}.title-top-text{font-size:10px}.title-bar-name{font-size:12px}.zoomIcons{width:26px;height:26px}.lib-verticalstack-labels-ontop-weklycharts{font-size:9px}}@media (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.lib-axis-group-label{font-size:11px!important}.dots{font-size:9px!important}.target-display{font-size:10px;line-height:12px}.title-top-text{font-size:11px}.title-bar-name{font-size:13px}.zoomIcons{width:28px;height:28px}}@media (min-width: 1024px) and (max-width: 1365px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}.lib-axis-group-label{font-size:12px!important}.dots{font-size:10px!important}}@media (min-width: 1366px) and (max-width: 1919px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.lib-axis-group-label{font-size:13px!important}.dots{font-size:11px!important}}@media (min-width: 1920px) and (max-width: 2559px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.lib-axis-group-label{font-size:14px!important}.dots{font-size:12px!important}.target-display{font-size:13px;line-height:15px}.title-top-text{font-size:14px}.title-bar-name{font-size:16px}}@media (min-width: 2560px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.lib-axis-group-label{font-size:15px!important}.dots{font-size:14px!important}.target-display{font-size:14px;line-height:16px}.title-top-text{font-size:15px}.title-bar-name{font-size:18px}.zoomIcons{width:34px;height:34px}}@media (orientation: portrait) and (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{font-size:8px!important}}@media (orientation: landscape) and (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
7495
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;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:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.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}.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}.lib-xaxis-labels-texts-drilldown,.lib-xaxis-labels-texts-drilldown-alt,.lib-xaxis-labels-texts-weeklycharts{font-size:12px}.lib-display-hidden{display:none!important}.chart-wrapper-main{position:relative;width:100%;box-sizing:border-box}.left-axis-container,.right-axis-container{pointer-events:none;overflow:hidden;-webkit-user-select:none;user-select:none}.scrollable-chart-container{-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.scrollable-chart-container::-webkit-scrollbar{height:8px}.scrollable-chart-container::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.scrollable-chart-container::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.scrollable-chart-container::-webkit-scrollbar-thumb:hover{background:#555}.inner-chart-container{position:relative}.grid line{stroke-width:1;shape-rendering:crispEdges}.horizontal-grid line{stroke-opacity:.7}.vertical-grid line{stroke-opacity:.7}.lib-y-axis-hidden{opacity:0!important;pointer-events:none}.lib-stacked-x-axis-text .domain{stroke:var(--chart-axis-color);stroke-width:1px}.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;font-size:12px;fill:var(--chart-text-color)}.lib-stacked-y-axis-text .domain{stroke:var(--chart-axis-color);stroke-width:1px}.lib-stacked-y-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;font-size:12px;fill:var(--chart-text-color)}@media (max-width: 1024px){.scrollable-chart-container::-webkit-scrollbar{height:6px}.lib-stacked-x-axis-text text{font-size:10px}}@media (max-width: 768px){.scrollable-chart-container::-webkit-scrollbar{height:4px}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
7516
7496
  }
7517
7497
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
7518
7498
  type: Component,
7519
- args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;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:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.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}.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}@media (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:9px!important}.lib-axis-group-label{font-size:10px!important}.dots{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr;font-size:9px!important}.target-display{font-size:9px;line-height:11px}.title-top-text{font-size:10px}.title-bar-name{font-size:12px}.zoomIcons{width:26px;height:26px}.lib-verticalstack-labels-ontop-weklycharts{font-size:9px}}@media (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.lib-axis-group-label{font-size:11px!important}.dots{font-size:9px!important}.target-display{font-size:10px;line-height:12px}.title-top-text{font-size:11px}.title-bar-name{font-size:13px}.zoomIcons{width:28px;height:28px}}@media (min-width: 1024px) and (max-width: 1365px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}.lib-axis-group-label{font-size:12px!important}.dots{font-size:10px!important}}@media (min-width: 1366px) and (max-width: 1919px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.lib-axis-group-label{font-size:13px!important}.dots{font-size:11px!important}}@media (min-width: 1920px) and (max-width: 2559px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.lib-axis-group-label{font-size:14px!important}.dots{font-size:12px!important}.target-display{font-size:13px;line-height:15px}.title-top-text{font-size:14px}.title-bar-name{font-size:16px}}@media (min-width: 2560px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.lib-axis-group-label{font-size:15px!important}.dots{font-size:14px!important}.target-display{font-size:14px;line-height:16px}.title-top-text{font-size:15px}.title-bar-name{font-size:18px}.zoomIcons{width:34px;height:34px}}@media (orientation: portrait) and (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{font-size:8px!important}}@media (orientation: landscape) and (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
7499
+ args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;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:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.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}.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}.lib-xaxis-labels-texts-drilldown,.lib-xaxis-labels-texts-drilldown-alt,.lib-xaxis-labels-texts-weeklycharts{font-size:12px}.lib-display-hidden{display:none!important}.chart-wrapper-main{position:relative;width:100%;box-sizing:border-box}.left-axis-container,.right-axis-container{pointer-events:none;overflow:hidden;-webkit-user-select:none;user-select:none}.scrollable-chart-container{-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#888 #f1f1f1}.scrollable-chart-container::-webkit-scrollbar{height:8px}.scrollable-chart-container::-webkit-scrollbar-track{background:#f1f1f1;border-radius:4px}.scrollable-chart-container::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.scrollable-chart-container::-webkit-scrollbar-thumb:hover{background:#555}.inner-chart-container{position:relative}.grid line{stroke-width:1;shape-rendering:crispEdges}.horizontal-grid line{stroke-opacity:.7}.vertical-grid line{stroke-opacity:.7}.lib-y-axis-hidden{opacity:0!important;pointer-events:none}.lib-stacked-x-axis-text .domain{stroke:var(--chart-axis-color);stroke-width:1px}.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;font-size:12px;fill:var(--chart-text-color)}.lib-stacked-y-axis-text .domain{stroke:var(--chart-axis-color);stroke-width:1px}.lib-stacked-y-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;font-size:12px;fill:var(--chart-text-color)}@media (max-width: 1024px){.scrollable-chart-container::-webkit-scrollbar{height:6px}.lib-stacked-x-axis-text text{font-size:10px}}@media (max-width: 768px){.scrollable-chart-container::-webkit-scrollbar{height:4px}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
7520
7500
  }], ctorParameters: () => [], propDecorators: { containerElt: [{
7521
7501
  type: ViewChild,
7522
7502
  args: ['verticalstackedchartcontainer', { static: true }]
@@ -7625,6 +7605,1242 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7625
7605
  get isAlertEnabled() {
7626
7606
  return this.chartConfiguration?.headerMenuOptions?.some((option) => option.id === 'editAlert');
7627
7607
  }
7608
+ // initializegroupChart() {
7609
+ // var self = this;
7610
+ // let data = [];
7611
+ // let metaData: any = null;
7612
+ // let keyList = null;
7613
+ // let lineData = null;
7614
+ // let colorMap = {};
7615
+ // var formatFromBackend;
7616
+ // var formatForHugeNumbers;
7617
+ // const isMobile = window.innerWidth < 576;
7618
+ // const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
7619
+ // const isDesktop = window.innerWidth >= 992;
7620
+ // let isria = this.customChartConfiguration.isRia
7621
+ // var x: any;
7622
+ // var alternate_text = false;
7623
+ // var short_tick_length = 4;
7624
+ // var long_tick_length = 16;
7625
+ // /**
7626
+ // * longer tick length needed for weekly charts
7627
+ // */
7628
+ // var short_tick_length_bg = 5;
7629
+ // var long_tick_length_bg = 30;
7630
+ // var leftAndRightSpaces = 50;
7631
+ // var rightSvgWidth = 60;
7632
+ // var tempScale;
7633
+ // for (var i in this.defaultConfiguration) {
7634
+ // this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(
7635
+ // i,
7636
+ // this.defaultConfiguration,
7637
+ // this.customChartConfiguration
7638
+ // );
7639
+ // }
7640
+ // data = this.chartData.data;
7641
+ // metaData = this.chartData.metaData;
7642
+ // lineData = this.chartData.lineData;
7643
+ // // if (lineData || this.chartData.targetLineData) {
7644
+ // // rightSvgWidth = 60;
7645
+ // // }
7646
+ // if (!metaData.colorAboveTarget) {
7647
+ // metaData['colorAboveTarget'] = metaData.colors;
7648
+ // }
7649
+ // colorMap = metaData.colors;
7650
+ // keyList = metaData.keyList;
7651
+ // var chartContainer = d3.select(this.containerElt.nativeElement);
7652
+ // var verticalstackedcontainer = d3.select(
7653
+ // this.groupcontainerElt.nativeElement
7654
+ // );
7655
+ // var margin = this.chartConfiguration.margin;
7656
+ // const { width, height } = this.calculateChartDimensions(
7657
+ // chartContainer,
7658
+ // verticalstackedcontainer,
7659
+ // margin,
7660
+ // self
7661
+ // );
7662
+ // /**
7663
+ // * for hiding header
7664
+ // * used by weekly charts
7665
+ // */
7666
+ // if (this.chartConfiguration.isHeaderVisible != undefined)
7667
+ // this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
7668
+ // /**
7669
+ // * for hiding legends
7670
+ // * used by weekly charts
7671
+ // */
7672
+ // if (this.chartConfiguration.legendVisible != undefined) {
7673
+ // this.legendVisible = this.chartConfiguration.legendVisible;
7674
+ // }
7675
+ // /**
7676
+ // * for removing background color so that it can take parents color
7677
+ // *
7678
+ // */
7679
+ // if (this.chartConfiguration.isTransparentBackground != undefined) {
7680
+ // this.isTransparentBackground =
7681
+ // this.chartConfiguration.isTransparentBackground;
7682
+ // }
7683
+ // /**
7684
+ // * format data values based on configuration received
7685
+ // */
7686
+ // if (this.chartConfiguration.textFormatter != undefined) {
7687
+ // formatFromBackend = ChartHelper.dataValueFormatter(
7688
+ // this.chartConfiguration.textFormatter
7689
+ // );
7690
+ // formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
7691
+ // }
7692
+ // const {
7693
+ // outerContainer,
7694
+ // svgYAxisLeft,
7695
+ // svgYAxisRight,
7696
+ // innerContainer,
7697
+ // svg
7698
+ // } = this.createChartContainers(chartContainer, margin, height, rightSvgWidth, self, width);
7699
+ // var subgroups: any = keyList;
7700
+ // var groups = d3
7701
+ // .map(data, function (d) {
7702
+ // return d.name;
7703
+ // })
7704
+ // .keys();
7705
+ // /**
7706
+ // * x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
7707
+ // */
7708
+ // if (this.chartConfiguration.isMultiChartGridLine != undefined) {
7709
+ // x = d3
7710
+ // .scaleBand()
7711
+ // .rangeRound([width, 0])
7712
+ // .align(0.5)
7713
+ // .padding([0.5])
7714
+ // .domain(
7715
+ // data.map(function (d: any) {
7716
+ // return d.name.toLowerCase();
7717
+ // })
7718
+ // );
7719
+ // } else {
7720
+ // x = d3
7721
+ // .scaleBand()
7722
+ // .domain(groups)
7723
+ // .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
7724
+ // .padding([0.3]);
7725
+ // }
7726
+ // // x.bandwidth(96);
7727
+ // var xScaleFromOrigin = d3
7728
+ // .scaleBand()
7729
+ // .domain(groups)
7730
+ // .range([0, width - rightSvgWidth]);
7731
+ // // .padding([0.2]);
7732
+ // if (this.chartConfiguration.isMultiChartGridLine == undefined) {
7733
+ // /**
7734
+ // * normal ticks for all dashboard charts
7735
+ // */
7736
+ // svg
7737
+ // .append('g')
7738
+ // .attr('class', 'x1 axis1')
7739
+ // .attr('transform', 'translate(0,' + height + ')')
7740
+ // .call(d3.axisBottom(x))
7741
+ // .call((g) => g.select('.domain').remove());
7742
+ // svg.selectAll('g.x1.axis1 g.tick line').remove();
7743
+ // // Only move x-axis labels further down for grouped charts if there is no xLabel
7744
+ // if (subgroups.length > 1 && !metaData.xLabel) {
7745
+ // svg
7746
+ // .selectAll('g.x1.axis1 g.tick text')
7747
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7748
+ // .style('fill', 'var(--chart-text-color)')
7749
+ // .attr('y', 32); // Increase distance from bars (default is ~9)
7750
+ // } else {
7751
+ // svg
7752
+ // .selectAll('g.x1.axis1 g.tick text')
7753
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7754
+ // .style('fill', 'var(--chart-text-color)');
7755
+ // }
7756
+ // }
7757
+ // else {
7758
+ // /**
7759
+ // * bigger ticks for weekly charts and more space from x axis to labels
7760
+ // */
7761
+ // /**
7762
+ // * draw x axis
7763
+ // */
7764
+ // svg
7765
+ // .append('g')
7766
+ // .attr('class', 'x1 axis1')
7767
+ // .attr('transform', 'translate(0,' + height + ')')
7768
+ // .call(d3.axisBottom(x).tickSize(0))
7769
+ // .call((g) => g.select('.domain').attr('fill', 'none'));
7770
+ // /**
7771
+ // * tick line size in alternate fashion
7772
+ // */
7773
+ // svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
7774
+ // if (
7775
+ // alternate_text &&
7776
+ // self.chartConfiguration.isNoAlternateXaxisText == undefined
7777
+ // ) {
7778
+ // alternate_text = false;
7779
+ // return long_tick_length_bg - 7;
7780
+ // } else {
7781
+ // alternate_text = true;
7782
+ // return short_tick_length_bg - 4;
7783
+ // }
7784
+ // });
7785
+ // /**
7786
+ // * reset the flag so that values can be shown in same alternate fashion
7787
+ // */
7788
+ // alternate_text = false;
7789
+ // /**
7790
+ // * print x-axis label texts
7791
+ // * used by weekly charts
7792
+ // */
7793
+ // svg
7794
+ // .selectAll('g.x1.axis1 g.tick text')
7795
+ // .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
7796
+ // .attr('y', function () {
7797
+ // // Minimize gap in maximized (fullscreen) view for weekly charts
7798
+ // if (self.chartConfiguration.isFullScreen) {
7799
+ // return short_tick_length_bg;
7800
+ // }
7801
+ // if (alternate_text) {
7802
+ // alternate_text = false;
7803
+ // return long_tick_length_bg;
7804
+ // } else {
7805
+ // alternate_text = true;
7806
+ // return short_tick_length_bg;
7807
+ // }
7808
+ // });
7809
+ // }
7810
+ // if (self.chartConfiguration.xLabelsOnSameLine) {
7811
+ // const xAxisLabels = svg
7812
+ // .selectAll('g.x1.axis1 g.tick text')
7813
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7814
+ // .style('font-size', this.isHeaderVisible ? '18px' : '14px')
7815
+ // .attr('text-anchor', 'middle')
7816
+ // .attr('y', function(d) {
7817
+ // // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
7818
+ // if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
7819
+ // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7820
+ // if (self.chartConfiguration.isFullScreen) {
7821
+ // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7822
+ // }
7823
+ // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7824
+ // }
7825
+ // // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
7826
+ // if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
7827
+ // const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
7828
+ // if (self.chartConfiguration.isFullScreen) {
7829
+ // // Reduce extra gap in maximized view
7830
+ // return short_tick_length_bg + 2;
7831
+ // }
7832
+ // return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
7833
+ // }
7834
+ // // Default/fallback logic for other cases
7835
+ // let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
7836
+ // if (
7837
+ // subgroups.length > 1 &&
7838
+ // !metaData.xLabel &&
7839
+ // (/\d{2,4}[-\/]\d{2}[-\/]\d{2,4}/.test(d) || /\d{2,4}[-\/]\d{2,4}/.test(d))
7840
+ // ) {
7841
+ // baseY = self.isHeaderVisible ? short_tick_length_bg + 15 : short_tick_length_bg + 25;
7842
+ // }
7843
+ // if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
7844
+ // baseY += 4;
7845
+ // }
7846
+ // // In maximized view, reduce baseY slightly for grouped bars
7847
+ // if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
7848
+ // baseY = Math.max(short_tick_length_bg, baseY - 10);
7849
+ // }
7850
+ // return baseY;
7851
+ // })
7852
+ // .attr('x', function (d) {
7853
+ // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7854
+ // return 1; // Move first line text slightly to the left in zoom-in view for better alignment
7855
+ // }
7856
+ // return 0; // Default position
7857
+ // })
7858
+ // .text(function (d) {
7859
+ // var isValueToBeIgnored = false;
7860
+ // if (isMobile && !self.isHeaderVisible) {
7861
+ // let firstPart = d.split(/[\s\-]+/)[0];
7862
+ // return firstPart.substring(0, 3).toLowerCase();
7863
+ // }
7864
+ // (data as any[]).map((indiv: any) => {
7865
+ // if (
7866
+ // indiv.name &&
7867
+ // indiv.name.toLowerCase() == d.trim().toLowerCase() &&
7868
+ // indiv[metaData.keyList[0]] == -1
7869
+ // ) {
7870
+ // isValueToBeIgnored = true;
7871
+ // }
7872
+ // });
7873
+ // if (isValueToBeIgnored) {
7874
+ // return '';
7875
+ // }
7876
+ // // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
7877
+ // // Apply for grouped bar charts and single bar charts, header visible, single line
7878
+ // const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
7879
+ // if (dateRangeRegex.test(d.trim())) {
7880
+ // return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
7881
+ // }
7882
+ // // Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
7883
+ // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7884
+ // const isWeekLabel = /week|wk|w\d+/i.test(d);
7885
+ // if (
7886
+ // subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)
7887
+ // ) {
7888
+ // var first = d.substring(0, d.indexOf(' '));
7889
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7890
+ // return first + '\n' + second;
7891
+ // }
7892
+ // // Also keep previous logic for minimized view
7893
+ // if (isDateLabel) {
7894
+ // if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
7895
+ // var first = d.substring(0, d.indexOf(' '));
7896
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7897
+ // return first + '\n' + second;
7898
+ // } else {
7899
+ // return d;
7900
+ // }
7901
+ // }
7902
+ // if (d.trim().indexOf(' ') > -1) {
7903
+ // return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
7904
+ // }
7905
+ // return d.toLowerCase();
7906
+ // // If label looks like a date (contains digits and - or /)
7907
+ // const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
7908
+ // // Only split date/week labels if there are many grouped bars and header is not visible
7909
+ // if (isDateLabel) {
7910
+ // if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
7911
+ // var first = d.substring(0, d.indexOf(' '));
7912
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7913
+ // return first + '\n' + second;
7914
+ // } else {
7915
+ // return d;
7916
+ // }
7917
+ // }
7918
+ // if (d.trim().indexOf(' ') > -1) {
7919
+ // return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
7920
+ // }
7921
+ // return d.toLowerCase();
7922
+ // });
7923
+ // // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
7924
+ // xAxisLabels.each(function(this: SVGTextElement, d: any) {
7925
+ // // Only apply writing-mode for exact date labels, not those containing 'week' or similar
7926
+ // const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
7927
+ // const isWeekLabel = /week|wk|w\d+/i.test(d);
7928
+ // if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
7929
+ // d3.select(this).style('writing-mode', 'sideways-lr');
7930
+ // }
7931
+ // });
7932
+ // if (!isMobile) {
7933
+ // svg
7934
+ // .selectAll('g.x1.axis1 g.tick')
7935
+ // .filter(function (d) {
7936
+ // return !/\d{2,4}[-\/]/.test(d); // Only process non-date labels
7937
+ // })
7938
+ // .append('text')
7939
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7940
+ // .attr('y', long_tick_length_bg)
7941
+ // .attr('fill', 'var(--chart-text-color)')
7942
+ // .attr('x', function (d) {
7943
+ // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7944
+ // return 1; // Move text slightly to the left
7945
+ // }
7946
+ // return 0; // Default position
7947
+ // })
7948
+ // .text(function (d) {
7949
+ // if (d.trim().indexOf(' ') > -1) {
7950
+ // return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
7951
+ // }
7952
+ // return '';
7953
+ // });
7954
+ // }
7955
+ // }
7956
+ // if (isria && self.chartData.data.length > 8) {
7957
+ // svg
7958
+ // .selectAll('g.x1.axis1 g.tick text')
7959
+ // .classed('mobile-xaxis-override', true)
7960
+ // .text(function (d: string) {
7961
+ // return d.substring(0, 3);
7962
+ // })
7963
+ // .style('font-size', '12px')
7964
+ // .attr('y', 5)
7965
+ // .attr('x', 5)
7966
+ // .style('text-anchor', 'middle');
7967
+ // }
7968
+ // if (isMobile && !this.isHeaderVisible) {
7969
+ // svg
7970
+ // .selectAll('g.x1.axis1 g.tick text')
7971
+ // .classed('mobile-xaxis-override', true);
7972
+ // }
7973
+ // /**y scale for left y axis */
7974
+ // var y = d3.scaleLinear().rangeRound([height, 0]);
7975
+ // var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
7976
+ // if (maxValue == 0) {
7977
+ // if (this.chartData.targetLineData) {
7978
+ // maxValue = this.chartData.targetLineData.target + 20;
7979
+ // } else {
7980
+ // maxValue = 100;
7981
+ // }
7982
+ // }
7983
+ // if (this.chartConfiguration.customYscale) {
7984
+ // /**
7985
+ // * increase y-scale so that values wont cross or exceed out of range
7986
+ // * used in weekly charts
7987
+ // */
7988
+ // maxValue = maxValue * this.chartConfiguration.customYscale;
7989
+ // }
7990
+ // if (
7991
+ // this.chartData.targetLineData &&
7992
+ // maxValue < this.chartData.targetLineData.target
7993
+ // ) {
7994
+ // maxValue =
7995
+ // maxValue < 10 && this.chartData.targetLineData.target < 10
7996
+ // ? this.chartData.targetLineData.target + 3
7997
+ // : this.chartData.targetLineData.target + 20;
7998
+ // }
7999
+ // y.domain([0, maxValue]).nice();
8000
+ // let lineYscale;
8001
+ // if (lineData != null) {
8002
+ // let maxLineValue = d3.max(lineData, function (d) {
8003
+ // return +d.value;
8004
+ // });
8005
+ // maxLineValue = maxLineValue * this.chartConfiguration.customYscale;
8006
+ // let minLineValue = d3.min(lineData, function (d) {
8007
+ // return +d.value;
8008
+ // });
8009
+ // if (maxLineValue > 0) minLineValue = minLineValue - 3;
8010
+ // if (minLineValue > 0) {
8011
+ // minLineValue = 0;
8012
+ // }
8013
+ // lineYscale = d3
8014
+ // .scaleLinear()
8015
+ // .domain([minLineValue, maxLineValue])
8016
+ // .range([height, minLineValue]);
8017
+ // }
8018
+ // let yLineAxis;
8019
+ // if (lineYscale != null) {
8020
+ // yLineAxis = d3
8021
+ // .axisRight(lineYscale)
8022
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8023
+ // .tickSize(0)
8024
+ // .tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
8025
+ // }
8026
+ // /**
8027
+ // * show x-axis grid between labels
8028
+ // * used by weekly charts
8029
+ // */
8030
+ // if (self.chartConfiguration.isXgridBetweenLabels) {
8031
+ // svg
8032
+ // .append('g')
8033
+ // .attr('class', 'grid')
8034
+ // .attr(
8035
+ // 'transform',
8036
+ // 'translate(' + x.bandwidth() / 2 + ',' + height + ')'
8037
+ // )
8038
+ // .call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
8039
+ // .style('stroke-dasharray', '5 5')
8040
+ // .style('color', 'var(--chart-grid-color, #999999)') // Use CSS variable
8041
+ // .call((g) => g.select('.domain').remove());
8042
+ // }
8043
+ // if (this.chartConfiguration.yAxisGrid) {
8044
+ // svg
8045
+ // .append('g')
8046
+ // .call(
8047
+ // d3
8048
+ // .axisLeft(y)
8049
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8050
+ // .tickSize(-width)
8051
+ // )
8052
+ // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8053
+ // .style('opacity', '0.5')
8054
+ // .call((g) => {
8055
+ // g.select('.domain')
8056
+ // .remove()
8057
+ // .style('stroke', 'var(--chart-domain-color, #000000)'); // Add CSS variable for domain
8058
+ // });
8059
+ // } else {
8060
+ // svg
8061
+ // .append('g')
8062
+ // .call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
8063
+ // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8064
+ // .style('opacity', '0.5')
8065
+ // .call((g) => {
8066
+ // g.select('.domain')
8067
+ // .style('stroke', 'var(--chart-domain-color, #000000)') // Add CSS variable for domain
8068
+ // .style('stroke-width', '1px'); // Ensure visibility
8069
+ // });
8070
+ // }
8071
+ // var xSubgroup = d3.scaleBand().domain(subgroups);
8072
+ // if (subgroups.length > 1 && !this.isZoomedOut) {
8073
+ // // For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
8074
+ // xSubgroup.range([0, x.bandwidth()]);
8075
+ // } else if (subgroups.length === 1 && !this.isZoomedOut) {
8076
+ // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
8077
+ // xSubgroup.range([0, 100]);
8078
+ // } else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
8079
+ // xSubgroup.range([0, x.bandwidth()]);
8080
+ // } else {
8081
+ // // used to make grouped bars with lesser width as we are not using padding for width
8082
+ // xSubgroup.range([0, x.bandwidth()]);
8083
+ // }
8084
+ // // if (this.chartConfiguration.isDrilldownChart) {
8085
+ // // }
8086
+ // var color = d3
8087
+ // .scaleOrdinal()
8088
+ // .domain(subgroups)
8089
+ // .range(Object.values(metaData.colors));
8090
+ // // var colorAboveTarget = d3
8091
+ // // .scaleOrdinal()
8092
+ // // .domain(subgroups)
8093
+ // // .range(Object.values(metaData.colorAboveTarget));
8094
+ // var state = svg
8095
+ // .append('g')
8096
+ // .selectAll('.state')
8097
+ // .data(data)
8098
+ // .enter()
8099
+ // .append('g')
8100
+ // .attr('transform', function (d) {
8101
+ // return 'translate(' + x(d.name) + ',0)';
8102
+ // });
8103
+ // state
8104
+ // .selectAll('rect')
8105
+ // .data(function (d) {
8106
+ // let newList: any = [];
8107
+ // subgroups.map(function (key) {
8108
+ // // if (key !== "group") {
8109
+ // let obj: any = { key: key, value: d[key], name: d.name };
8110
+ // newList.push(obj);
8111
+ // // }
8112
+ // });
8113
+ // return newList;
8114
+ // })
8115
+ // .enter()
8116
+ // .append('rect')
8117
+ // .attr('class', 'bars')
8118
+ // .on('click', function (d) {
8119
+ // if (d.key != 'Target') {
8120
+ // if (
8121
+ // !metaData.barWithoutClick ||
8122
+ // !metaData.barWithoutClick.length ||
8123
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8124
+ // !metaData.barWithoutClick.includes(d?.key))
8125
+ // )
8126
+ // // self.handleClick(d.data.name);
8127
+ // self.handleClick(d);
8128
+ // }
8129
+ // })
8130
+ // .attr('x', function (d) {
8131
+ // if (self.chartConfiguration.isDrilldownChart) {
8132
+ // data.map((indiv: any) => {
8133
+ // if (indiv.name == d.name) {
8134
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8135
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8136
+ // if (x.bandwidth() > 100) {
8137
+ // // Increase bar width a bit in zoom-in view
8138
+ // let reducedBarWidth = 60;
8139
+ // if (!self.isZoomedOut) {
8140
+ // reducedBarWidth = 30;
8141
+ // }
8142
+ // if (self.chartData.data.length == 1) {
8143
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8144
+ // tempScale.range([
8145
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8146
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8147
+ // ]);
8148
+ // } else
8149
+ // tempScale.range([
8150
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8151
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8152
+ // ]);
8153
+ // } else
8154
+ // tempScale.range([
8155
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8156
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8157
+ // ]);
8158
+ // }
8159
+ // }
8160
+ // });
8161
+ // return tempScale(d.key);
8162
+ // }
8163
+ // return xSubgroup(d.key);
8164
+ // })
8165
+ // .attr('y', function (d) {
8166
+ // if (d.value == -1) {
8167
+ // return y(0);
8168
+ // }
8169
+ // if (d.value >= 0) {
8170
+ // const barHeight = height - y(d.value);
8171
+ // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8172
+ // return barHeight < minHeight ? y(0) - minHeight : y(d.value);
8173
+ // }
8174
+ // return y(0);
8175
+ // })
8176
+ // .attr('width', function (d) {
8177
+ // // For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
8178
+ // if (subgroups.length > 1 && !self.isZoomedOut) {
8179
+ // return 50;
8180
+ // }
8181
+ // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
8182
+ // if (subgroups.length === 1 && !self.isZoomedOut) {
8183
+ // return 80;
8184
+ // }
8185
+ // let tempScale = d3.scaleBand().domain([]).range([0, 0]);
8186
+ // // Default logic for other chart types
8187
+ // if (self.chartConfiguration.isDrilldownChart) {
8188
+ // data.map((indiv: any) => {
8189
+ // if (indiv.name == d.name) {
8190
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8191
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8192
+ // if (x.bandwidth() > 100) {
8193
+ // // Increase bar width a bit in zoom-in view
8194
+ // let reducedBarWidth = 60;
8195
+ // if (!self.isZoomedOut) {
8196
+ // reducedBarWidth = 100;
8197
+ // }
8198
+ // if (self.chartData.data.length == 1) {
8199
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8200
+ // tempScale.range([
8201
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8202
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8203
+ // ]);
8204
+ // } else
8205
+ // tempScale.range([
8206
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8207
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8208
+ // ]);
8209
+ // } else
8210
+ // tempScale.range([
8211
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8212
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8213
+ // ]);
8214
+ // }
8215
+ // }
8216
+ // });
8217
+ // return self.isZoomedOut
8218
+ // ? tempScale.bandwidth()
8219
+ // : self.chartData.data.length && self.chartData.data.length > 8
8220
+ // ? tempScale.bandwidth()
8221
+ // : tempScale.bandwidth();
8222
+ // }
8223
+ // return self.isZoomedOut
8224
+ // ? tempScale.bandwidth()
8225
+ // : self.chartData.data.length && self.chartData.data.length > 8
8226
+ // ? tempScale.bandwidth()
8227
+ // : tempScale.bandwidth();
8228
+ // })
8229
+ // .attr('height', function (d) {
8230
+ // if (d.value == -1) {
8231
+ // return height - y(0);
8232
+ // }
8233
+ // if (d.value >= 0) {
8234
+ // const barHeight = height - y(d.value);
8235
+ // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8236
+ // return Math.max(barHeight, minHeight);
8237
+ // }
8238
+ // return height - y(0);
8239
+ // })
8240
+ // .style('cursor', function (d) {
8241
+ // if (metaData.hasDrillDown && !isria) return 'pointer';
8242
+ // else return 'default';
8243
+ // })
8244
+ // .attr('fill', function (d) {
8245
+ // if (
8246
+ // d.value &&
8247
+ // self.chartData.targetLineData &&
8248
+ // d.value >= parseFloat(self.chartData.targetLineData.target) &&
8249
+ // self.chartData.metaData.colorAboveTarget
8250
+ // ) {
8251
+ // const key = d.key.toLowerCase();
8252
+ // const colorAboveTarget = Object.keys(self.chartData.metaData.colorAboveTarget).find(
8253
+ // k => k.toLowerCase() === key
8254
+ // );
8255
+ // if (colorAboveTarget) {
8256
+ // return self.chartData.metaData.colorAboveTarget[colorAboveTarget];
8257
+ // }
8258
+ // }
8259
+ // return self.chartData.metaData.colors[d.key];
8260
+ // });
8261
+ // /**
8262
+ // * display angled texts on the bars
8263
+ // */
8264
+ // if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
8265
+ // state
8266
+ // .selectAll('text')
8267
+ // .data(function (d) {
8268
+ // let newList: any = [];
8269
+ // subgroups.map(function (key) {
8270
+ // let obj: any = { key: key, value: d[key], name: d.name };
8271
+ // newList.push(obj);
8272
+ // });
8273
+ // return newList;
8274
+ // })
8275
+ // .enter()
8276
+ // .append('text')
8277
+ // .attr('fill', 'var(--chart-text-color)')
8278
+ // .attr('x', function (d) {
8279
+ // return 0;
8280
+ // })
8281
+ // .attr('y', function (d) {
8282
+ // return 0;
8283
+ // })
8284
+ // .attr('class', 'lib-data-labels-weeklycharts')
8285
+ // .text(function (d) {
8286
+ // return d.key && d.value
8287
+ // ? d.key.length > 20
8288
+ // ? d.key.substring(0, 17) + '...'
8289
+ // : d.key
8290
+ // : '';
8291
+ // })
8292
+ // .style('fill', function (d) {
8293
+ // return '#000';
8294
+ // })
8295
+ // .style('font-weight', 'bold')
8296
+ // .style('font-size', function (d) {
8297
+ // if (self.isZoomedOut) {
8298
+ // return '9px'; // 👈 Zoomed out mode
8299
+ // }
8300
+ // if (self.chartConfiguration.isDrilldownChart) {
8301
+ // if (window.innerWidth > 1900) {
8302
+ // return '18px';
8303
+ // } else if (window.innerWidth < 1400) {
8304
+ // return '10px';
8305
+ // } else {
8306
+ // return '14px';
8307
+ // }
8308
+ // } else {
8309
+ // return '14px';
8310
+ // }
8311
+ // })
8312
+ // .attr('transform', function (d) {
8313
+ // data.map((indiv: any) => {
8314
+ // if (indiv.name == d.name) {
8315
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8316
+ // var temp;
8317
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8318
+ // if (x.bandwidth() > 100) {
8319
+ // if (self.chartData.data.length == 1) {
8320
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8321
+ // tempScale.range([
8322
+ // 0 + (x.bandwidth() - 200) / 2,
8323
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8324
+ // ]);
8325
+ // // .padding(0.05);
8326
+ // } else
8327
+ // tempScale.range([
8328
+ // 0 + (x.bandwidth() - 300) / 2,
8329
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8330
+ // ]);
8331
+ // // .padding(0.05);
8332
+ // } else
8333
+ // tempScale.range([
8334
+ // 0 + (x.bandwidth() - 125) / 2,
8335
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8336
+ // ]);
8337
+ // }
8338
+ // }
8339
+ // });
8340
+ // /**
8341
+ // * if set, then all texts ll be horizontal
8342
+ // */
8343
+ // if (self.chartConfiguration.textAlwaysHorizontal) {
8344
+ // return (
8345
+ // 'translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')'
8346
+ // );
8347
+ // }
8348
+ // /**
8349
+ // * rotate texts having more than one digits
8350
+ // */
8351
+ // // if (d.value > 9)
8352
+ // if (!isNaN(tempScale(d.key)))
8353
+ // return (
8354
+ // 'translate(' +
8355
+ // (tempScale(d.key) + tempScale.bandwidth() * 0.55) +
8356
+ // ',' +
8357
+ // (y(0) - 10) +
8358
+ // ') rotate(270)'
8359
+ // );
8360
+ // return 'translate(0,0)';
8361
+ // // else
8362
+ // // return (
8363
+ // // 'translate(' +
8364
+ // // (tempScale(d.key) + tempScale.bandwidth() / 2) +
8365
+ // // ',' +
8366
+ // // y(0) +
8367
+ // // ')'
8368
+ // // );
8369
+ // })
8370
+ // .on('click', function (d) {
8371
+ // if (
8372
+ // !metaData.barWithoutClick ||
8373
+ // !metaData.barWithoutClick.length ||
8374
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8375
+ // !metaData.barWithoutClick.includes(d?.key))
8376
+ // )
8377
+ // self.handleClick(d);
8378
+ // });
8379
+ // if (!isria) {
8380
+ // state
8381
+ // .selectAll('.lib-data-labels-weeklycharts')
8382
+ // .on('mouseout', handleMouseOut)
8383
+ // .on('mouseover', handleMouseOver);
8384
+ // }
8385
+ // }
8386
+ // if (this.chartConfiguration.displayTitleOnTop || (
8387
+ // this.chartConfiguration.textsOnBar == undefined &&
8388
+ // this.chartConfiguration.displayTitleOnTop == undefined
8389
+ // )) {
8390
+ // if (!isria) {
8391
+ // state
8392
+ // .selectAll('rect')
8393
+ // .on('mouseout', handleMouseOut)
8394
+ // .on('mouseover', handleMouseOver);
8395
+ // }
8396
+ // }
8397
+ // function handleMouseOver(d, i) {
8398
+ // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8399
+ // svg
8400
+ // .append('foreignObject')
8401
+ // .attr('x', function () {
8402
+ // // ...existing code for tempScale calculation...
8403
+ // var elementsCounter;
8404
+ // data.map((indiv: any) => {
8405
+ // if (indiv.name == d.name) {
8406
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8407
+ // elementsCounter = keys.length;
8408
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8409
+ // if (x.bandwidth() > 100) {
8410
+ // if (self.chartData.data.length == 1) {
8411
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8412
+ // tempScale.range([
8413
+ // 0 + (x.bandwidth() - 200) / 2,
8414
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8415
+ // ]);
8416
+ // } else
8417
+ // tempScale.range([
8418
+ // 0 + (x.bandwidth() - 300) / 2,
8419
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8420
+ // ]);
8421
+ // } else
8422
+ // tempScale.range([
8423
+ // 0 + (x.bandwidth() - 125) / 2,
8424
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8425
+ // ]);
8426
+ // }
8427
+ // }
8428
+ // });
8429
+ // if (metaData.hasDrillDown) {
8430
+ // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8431
+ // return (
8432
+ // x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90
8433
+ // );
8434
+ // }
8435
+ // return (
8436
+ // x(d.name) +
8437
+ // tempScale(d.key) -
8438
+ // (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
8439
+ // tempScale.bandwidth() / 2
8440
+ // );
8441
+ // } else return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
8442
+ // })
8443
+ // .attr('class', 'lib-verticalstack-title-ontop')
8444
+ // .attr('y', function () {
8445
+ // return y(d.value) - 3 - 40 - 10;
8446
+ // })
8447
+ // .attr('dy', function () {
8448
+ // return d.class;
8449
+ // })
8450
+ // .attr('width', function () {
8451
+ // data.map((indiv: any) => {
8452
+ // if (indiv.name == d.name) {
8453
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8454
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8455
+ // if (x.bandwidth() > 100) {
8456
+ // if (self.chartData.data.length == 1) {
8457
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8458
+ // tempScale.range([
8459
+ // 0 + (x.bandwidth() - 200) / 2,
8460
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8461
+ // ]);
8462
+ // } else
8463
+ // tempScale.range([
8464
+ // 0 + (x.bandwidth() - 300) / 2,
8465
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8466
+ // ]);
8467
+ // } else
8468
+ // tempScale.range([
8469
+ // 0 + (x.bandwidth() - 125) / 2,
8470
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8471
+ // ]);
8472
+ // }
8473
+ // }
8474
+ // });
8475
+ // if (metaData.hasDrillDown) {
8476
+ // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8477
+ // return '180px';
8478
+ // }
8479
+ // return tempScale.bandwidth() + leftAndRightSpaces * 2;
8480
+ // } else return tempScale.bandwidth() + leftAndRightSpaces * 2;
8481
+ // })
8482
+ // .attr('height', 50)
8483
+ // .append('xhtml:div')
8484
+ // .attr('class', 'title')
8485
+ // .style('z-index', 99)
8486
+ // .html(function () {
8487
+ // let barLabel = d.key;
8488
+ // let dataType = metaData.dataType ? metaData.dataType : '';
8489
+ // let value = d.value;
8490
+ // let desiredText =
8491
+ // '<span class="title-bar-name">' + barLabel + '</span>';
8492
+ // desiredText +=
8493
+ // '<span class="title-bar-value"><span>' +
8494
+ // value +
8495
+ // '</span>' +
8496
+ // dataType +
8497
+ // '</span>';
8498
+ // return desiredText;
8499
+ // });
8500
+ // }
8501
+ // function handleMouseOut(d, i) {
8502
+ // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8503
+ // }
8504
+ // svg
8505
+ // .append('g')
8506
+ // .attr('class', 'x2 axis2')
8507
+ // .attr('transform', 'translate(0,' + height + ')')
8508
+ // .style('color', 'var(--chart-axis-color, #000)') // Use CSS variable instead of hardcoded #000
8509
+ // .call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
8510
+ // .call((g) => g.select('.domain').attr('fill', 'none'));
8511
+ // svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
8512
+ // svg
8513
+ // .append('g')
8514
+ // .attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
8515
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8516
+ // .attr('transform', 'translate(0,0)')
8517
+ // .call(y)
8518
+ // .style('display', 'none');
8519
+ // svgYAxisLeft
8520
+ // .append('g')
8521
+ // .append('g')
8522
+ // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8523
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8524
+ // .attr('transform', 'translate(0,0)')
8525
+ // .call(
8526
+ // d3
8527
+ // .axisLeft(y)
8528
+ // .tickSize(0)
8529
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8530
+ // .tickFormat(function (d) {
8531
+ // const formatted = self.chartConfiguration.yAxisLabelFomatter
8532
+ // ? self.chartConfiguration.yAxisLabelFomatter(d)
8533
+ // : d;
8534
+ // return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
8535
+ // })
8536
+ // )
8537
+ // .call((g) => {
8538
+ // // Style the domain line for theme support
8539
+ // g.select('.domain')
8540
+ // .style('stroke', 'var(--chart-domain-color, #000000)')
8541
+ // .style('stroke-width', '1px');
8542
+ // })
8543
+ // .selectAll('text')
8544
+ // .style('fill', 'var(--chart-text-color)');
8545
+ // svgYAxisRight
8546
+ // .append('g')
8547
+ // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8548
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8549
+ // .attr('transform', 'translate(0,0)')
8550
+ // .call(y)
8551
+ // .style('display', 'none');
8552
+ // /**
8553
+ // * hide x axis labels
8554
+ // * config is there for future use
8555
+ // * used by weekly charts
8556
+ // */
8557
+ // if (
8558
+ // this.chartConfiguration.isXaxisLabelHidden != undefined &&
8559
+ // this.chartConfiguration.isXaxisLabelHidden
8560
+ // ) {
8561
+ // d3.selectAll('g.lib-line-x-axis-text > g > text').attr(
8562
+ // 'class',
8563
+ // 'lib-display-hidden'
8564
+ // );
8565
+ // }
8566
+ // /**
8567
+ // * hide y axis labels
8568
+ // * used by weekly charts
8569
+ // */
8570
+ // if (
8571
+ // this.chartConfiguration.isYaxisLabelHidden != undefined &&
8572
+ // this.chartConfiguration.isYaxisLabelHidden
8573
+ // ) {
8574
+ // d3.selectAll('.yaxis-dashed > g > text').attr(
8575
+ // 'class',
8576
+ // 'lib-display-hidden'
8577
+ // );
8578
+ // }
8579
+ // /**
8580
+ // * hide y axis labels
8581
+ // * config is there for future use
8582
+ // */
8583
+ // if (
8584
+ // this.chartConfiguration.isYaxisHidden != undefined &&
8585
+ // this.chartConfiguration.isYaxisHidden
8586
+ // ) {
8587
+ // d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
8588
+ // }
8589
+ // /**
8590
+ // * dashed y axis
8591
+ // * used by weekly charts
8592
+ // */
8593
+ // if (
8594
+ // this.chartConfiguration.isYaxisDashed != undefined &&
8595
+ // this.chartConfiguration.isYaxisDashed
8596
+ // ) {
8597
+ // d3.selectAll('.yaxis-dashed')
8598
+ // .style('stroke-dasharray', '5 5')
8599
+ // .style('color', 'var(--chart-axis-color, #999999)'); // Use CSS variable
8600
+ // }
8601
+ // if (lineData != null) {
8602
+ // if (lineData && self.chartConfiguration.showLineChartAxis) {
8603
+ // svgYAxisRight
8604
+ // .append('g')
8605
+ // .attr('class', 'lib-stacked-y-axis-text1')
8606
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8607
+ // .attr('transform', 'translate(' + 0 + ',0)')
8608
+ // .call(yLineAxis);
8609
+ // }
8610
+ // }
8611
+ // /**
8612
+ // * used to display y label
8613
+ // */
8614
+ // // if (this.isZoomedOut) {
8615
+ // // svg
8616
+ // // .selectAll('.lib-xaxis-labels-texts-drilldown')
8617
+ // // .attr('class', 'lib-display-hidden');
8618
+ // // }
8619
+ // if (this.isZoomedOut) {
8620
+ // svg
8621
+ // .selectAll('.lib-xaxis-labels-texts-drilldown')
8622
+ // .each((d, i, nodes) => {
8623
+ // const text = d3.select(nodes[i]);
8624
+ // const label = text.text();
8625
+ // if (label.indexOf('\n') > -1) {
8626
+ // const lines = label.split('\n');
8627
+ // text.text(null);
8628
+ // lines.forEach((line, idx) => {
8629
+ // text.append('tspan')
8630
+ // .text(line)
8631
+ // .attr('x', 0)
8632
+ // .attr('dy', idx === 0 ? '1em' : '1.1em');
8633
+ // });
8634
+ // } else {
8635
+ // const words = label.split(' ');
8636
+ // text.text(null);
8637
+ // words.forEach((word, index) => {
8638
+ // text.append('tspan').text(word);
8639
+ // });
8640
+ // }
8641
+ // })
8642
+ // .style('fill', 'var(--chart-text-color)')
8643
+ // .attr('transform', null);
8644
+ // svg
8645
+ // .select('.x-axis')
8646
+ // .attr('transform', `translate(0, ${height - margin.bottom + 10})`);
8647
+ // }
8648
+ // /**
8649
+ // * used to write y labels based on configuration
8650
+ // */
8651
+ // if (metaData.yLabel) {
8652
+ // const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
8653
+ // svgYAxisLeft
8654
+ // .append('text')
8655
+ // .attr('class', 'lib-axis-group-label font-size-1')
8656
+ // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8657
+ // .attr('transform', 'rotate(-90)')
8658
+ // .attr('y', yPosition)
8659
+ // .attr('x', 0 - height / 2)
8660
+ // .attr('dy', '1em')
8661
+ // .style('text-anchor', 'middle')
8662
+ // .attr('fill', 'var(--chart-text-color)');
8663
+ // if (this.chartConfiguration.isMultiChartGridLine === undefined) {
8664
+ // svgYAxisLeft
8665
+ // .selectAll('.lib-axis-group-label')
8666
+ // .style('font-size', 'smaller')
8667
+ // .text(metaData.yLabel);
8668
+ // } else {
8669
+ // svg
8670
+ // .selectAll('.lib-axis-group-label')
8671
+ // .attr('class', 'lib-ylabel-weeklyCharts')
8672
+ // .text(metaData.yLabel.toLowerCase());
8673
+ // }
8674
+ // }
8675
+ // if (this.chartData.targetLineData) {
8676
+ // const yZero = y(this.chartData.targetLineData.target);
8677
+ // svg
8678
+ // .append('line')
8679
+ // .attr('x1', 0)
8680
+ // .attr('x2', width)
8681
+ // .attr('y1', yZero)
8682
+ // .attr('y2', yZero)
8683
+ // .style('stroke-dasharray', '5 5')
8684
+ // .style('stroke', this.chartData.targetLineData.color);
8685
+ // // svgYAxisRight
8686
+ // // .append('line')
8687
+ // // .attr('x1', 0)
8688
+ // // .attr('x2', rightSvgWidth)
8689
+ // // .attr('y1', yZero)
8690
+ // // .attr('y2', yZero)
8691
+ // // .style('stroke', this.chartData.targetLineData.color);
8692
+ // svgYAxisRight
8693
+ // .append('foreignObject')
8694
+ // .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
8695
+ // .attr('width', rightSvgWidth)
8696
+ // .attr('height', 50)
8697
+ // .append('xhtml:div')
8698
+ // .attr('class', 'target-display')
8699
+ // .style('color', 'var(--chart-text-color)')
8700
+ // .html(function () {
8701
+ // let dataTypeTemp = '';
8702
+ // let targetLineName = 'target';
8703
+ // if (metaData.dataType) {
8704
+ // dataTypeTemp = metaData.dataType;
8705
+ // }
8706
+ // if (
8707
+ // self.chartData.targetLineData &&
8708
+ // self.chartData.targetLineData.targetName
8709
+ // ) {
8710
+ // targetLineName = self.chartData.targetLineData.targetName;
8711
+ // }
8712
+ // return (
8713
+ // `<div>${targetLineName}</div>` +
8714
+ // '<div>' +
8715
+ // self.chartData.targetLineData.target +
8716
+ // '' +
8717
+ // dataTypeTemp +
8718
+ // '</div>'
8719
+ // );
8720
+ // });
8721
+ // }
8722
+ // if (this.chartConfiguration.isDrilldownChart) {
8723
+ // /**
8724
+ // * used by drilldown charts
8725
+ // */
8726
+ // // svg
8727
+ // // .selectAll('.lib-axis-group-label')
8728
+ // // .attr('class', 'lib-ylabel-drilldowncharts')
8729
+ // // .text(metaData.yLabel.toLowerCase());
8730
+ // svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
8731
+ // }
8732
+ // if (metaData.xLabel) {
8733
+ // function isAcronym(label) {
8734
+ // return (
8735
+ // (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
8736
+ // (label === label.toUpperCase() && /[A-Z]/.test(label))
8737
+ // );
8738
+ // }
8739
+ // const xLabelText = metaData.xLabel;
8740
+ // const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
8741
+ // const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
8742
+ // svg
8743
+ // .append('text')
8744
+ // .attr('class', function () {
8745
+ // let baseClass = 'lib-axis-group-label font-size-1';
8746
+ // if (self.chartConfiguration.isDrilldownChart)
8747
+ // return baseClass + ' lib-xlabel-drilldowncharts';
8748
+ // if (self.chartConfiguration.isMultiChartGridLine != undefined)
8749
+ // return baseClass + ' lib-xlabel-weeklyCharts';
8750
+ // return baseClass + ' lib-axis-waterfall-label';
8751
+ // })
8752
+ // .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
8753
+ // .attr(
8754
+ // 'transform',
8755
+ // 'translate(' + width / 2 + ' ,' + xPosition + ')'
8756
+ // )
8757
+ // .style('text-anchor', 'middle')
8758
+ // .style('fill', 'var(--chart-text-color)')
8759
+ // .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
8760
+ // .style('text-transform', isAcr ? 'none' : 'capitalize');
8761
+ // }
8762
+ // if (metaData.lineyLabel) {
8763
+ // svgYAxisRight
8764
+ // .append('text')
8765
+ // .attr('class', 'lib-axis-group-label lib-line-axis')
8766
+ // .attr('fill', 'var(--chart-text-color)')
8767
+ // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8768
+ // .attr('transform', 'translate(0,0) rotate(90)')
8769
+ // .attr('y', 0 - 100)
8770
+ // .attr('x', 0 + 100)
8771
+ // .attr('dy', '5em')
8772
+ // .style('text-anchor', 'middle')
8773
+ // .style('font-size', 'smaller')
8774
+ // .text(metaData.lineyLabel);
8775
+ // }
8776
+ // if (lineData) {
8777
+ // svg
8778
+ // .append('path')
8779
+ // .datum(lineData)
8780
+ // .attr('fill', 'none')
8781
+ // .attr('stroke', self.chartConfiguration.lineGraphColor)
8782
+ // .attr('stroke-width', 1.5)
8783
+ // .attr(
8784
+ // 'd',
8785
+ // d3
8786
+ // .line()
8787
+ // .x(function (d) {
8788
+ // return x(d.name) + x.bandwidth() / 2;
8789
+ // })
8790
+ // .y(function (d) {
8791
+ // return lineYscale(d.value);
8792
+ // })
8793
+ // );
8794
+ // var dot = svg
8795
+ // .selectAll('myCircles')
8796
+ // .data(lineData)
8797
+ // .enter()
8798
+ // .append('g')
8799
+ // .on('click', function (d) {
8800
+ // if (
8801
+ // !metaData.barWithoutClick ||
8802
+ // !metaData.barWithoutClick.length ||
8803
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8804
+ // !metaData.barWithoutClick.includes(d?.key))
8805
+ // )
8806
+ // self.handleClick(d);
8807
+ // });
8808
+ // dot
8809
+ // .append('circle')
8810
+ // .attr('fill', function (d) {
8811
+ // return self.chartConfiguration.lineGraphColor;
8812
+ // })
8813
+ // .attr('stroke', 'none')
8814
+ // .attr('cx', function (d) {
8815
+ // return x(d.name) + x.bandwidth() / 2;
8816
+ // })
8817
+ // .attr('cy', function (d) {
8818
+ // return lineYscale(d.value);
8819
+ // })
8820
+ // .style('cursor', () =>
8821
+ // self.chartData.metaData.hasDrillDown ? 'pointer' : 'default'
8822
+ // )
8823
+ // .attr('r', 3);
8824
+ // if (self.chartConfiguration.lineGraphColor) {
8825
+ // dot
8826
+ // .append('text')
8827
+ // .attr('class', 'dot')
8828
+ // .attr('fill', 'var(--chart-text-color)')
8829
+ // .attr('color', self.chartConfiguration.lineGraphColor)
8830
+ // .attr('style', 'font-size: ' + '.85em')
8831
+ // .attr('x', function (d, i) {
8832
+ // return x(d.name) + x.bandwidth() / 2;
8833
+ // })
8834
+ // .attr('y', function (d) {
8835
+ // return lineYscale(d.value);
8836
+ // })
8837
+ // .attr('dy', '-1em')
8838
+ // .text(function (d) {
8839
+ // return self.chartConfiguration.labelFormatter(d.value);
8840
+ // });
8841
+ // }
8842
+ // }
8843
+ // }
7628
8844
  initializegroupChart() {
7629
8845
  // ==================== VARIABLE DECLARATIONS ====================
7630
8846
  const self = this;
@@ -7735,7 +8951,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7735
8951
  .domain(groups)
7736
8952
  .range([0, width - RIGHT_SVG_WIDTH]);
7737
8953
  // ==================== X-AXIS RENDERING ====================
7738
- this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile, isTablet);
8954
+ this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile);
7739
8955
  // ==================== Y-AXIS SETUP ====================
7740
8956
  const y = d3.scaleLinear().rangeRound([height, 0]);
7741
8957
  let maxValue = this.calculateMaxValue(data, keyList);
@@ -7786,18 +9002,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7786
9002
  }
7787
9003
  }
7788
9004
  // ==================== HELPER METHODS ====================
7789
- renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile, isTablet) {
9005
+ renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile) {
7790
9006
  let alternate_text = false;
7791
9007
  if (this.chartConfiguration.isMultiChartGridLine === undefined) {
7792
9008
  // Normal ticks for dashboard charts
7793
- // Dynamically adjust Y translation for mobile
7794
- let translateY = height;
7795
- if (isMobile) {
7796
- translateY = height + 5; // Add extra space at the top for mobile
7797
- }
7798
9009
  svg.append('g')
7799
9010
  .attr('class', 'x1 axis1')
7800
- .attr('transform', `translate(0,${translateY})`)
9011
+ .attr('transform', `translate(0,${height})`)
7801
9012
  .call(d3.axisBottom(x))
7802
9013
  .call((g) => g.select('.domain').remove());
7803
9014
  svg.selectAll('g.x1.axis1 g.tick line').remove();
@@ -7857,7 +9068,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7857
9068
  .attr('x', 5)
7858
9069
  .style('text-anchor', 'middle');
7859
9070
  }
7860
- // Mobile/tablet override - check for single-group date charts first
9071
+ // Mobile override - check for single-group date charts first
7861
9072
  if (isMobile) {
7862
9073
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
7863
9074
  const groupsCount = data.length || 0;
@@ -7871,14 +9082,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7871
9082
  hasDateValues = true;
7872
9083
  }
7873
9084
  });
7874
- // Count unique x-axis labels
7875
- const uniqueLabels = new Set();
7876
- textNodes.each(function (d) {
7877
- uniqueLabels.add(d);
7878
- });
7879
- const labelCount = uniqueLabels.size;
7880
- if (hasDateValues && labelCount <= 3) {
7881
- // For 3 or fewer labels, keep horizontal display
9085
+ if (hasDateValues && subgroups && subgroups.length < 3) {
9086
+ // For single chart with dates, ensure horizontal display
7882
9087
  textNodes
7883
9088
  .style('writing-mode', 'horizontal-tb') // Explicitly set horizontal
7884
9089
  .classed('mobile-xaxis-override', false) // Remove vertical class
@@ -7888,19 +9093,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7888
9093
  .attr('dx', '0') // Reset any x offset
7889
9094
  .attr('dy', '0'); // Reset any y offset
7890
9095
  }
7891
- else if (labelCount > 3) {
7892
- // For more than 3 labels, use vertical alignment
7893
- textNodes
7894
- .style('writing-mode', 'sideways-lr') // Vertical text
7895
- .classed('mobile-xaxis-override', true) // Add vertical class
7896
- .attr('text-anchor', 'middle') // Center align
7897
- .attr('y', 30) // Adjust vertical position
7898
- .attr('x', 0); // Reset x position
7899
- }
7900
9096
  else if (!this.isHeaderVisible) {
7901
9097
  // Default mobile behavior for non-date or multi-group
7902
9098
  textNodes.classed('mobile-xaxis-override', true);
7903
9099
  }
9100
+ // If there are many groups on mobile, rotate labels to sideways to
9101
+ // avoid overlapping and make them readable. Use a lower threshold
9102
+ // (3) so even small mobile screens get rotated labels when needed.
9103
+ if (groupsCount > 3) {
9104
+ svg.selectAll('g.x1.axis1 g.tick text')
9105
+ .style('writing-mode', 'sideways-lr')
9106
+ .style('text-anchor', 'middle')
9107
+ .attr('y', 0);
9108
+ }
7904
9109
  }
7905
9110
  }
7906
9111
  applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
@@ -7965,49 +9170,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7965
9170
  return baseY;
7966
9171
  }
7967
9172
  formatXLabelText(d, data, metaData, subgroups, self, isMobile) {
7968
- // Check if we're on mobile or tablet
7969
- const isSmallScreen = window.innerWidth < 992; // Less than 992px (mobile or tablet)
7970
- // Helper to extract and format week number
7971
- const extractWeekNumber = (text) => {
7972
- const match = text.match(/(?:week|wk|w)\s*(\d+)/i);
7973
- return match ? `W${match[1]}` : null;
7974
- };
7975
- // Helper to extract date part
7976
- const extractDate = (text) => {
7977
- const match = text.match(/\d{2}[-\/]\d{2}[-\/]\d{2,4}/);
7978
- return match ? match[0] : null;
7979
- };
7980
- // Check if label contains both date and week information
7981
- const hasDateAndTime = (text) => {
7982
- const dateMatch = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(text);
7983
- const weekMatch = /(?:week|wk|w)\s*\d+/i.test(text);
7984
- return { isDate: dateMatch, isWeek: weekMatch };
7985
- };
7986
- const labelInfo = hasDateAndTime(d);
7987
- // Mobile handling: format date and week parts
9173
+ // Mobile handling: keep date labels intact for single-series charts (do not trim)
7988
9174
  if (isMobile) {
7989
- // If header is hidden (compact mobile)
9175
+ const isDateLabel = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(d) || !isNaN(Date.parse(d));
9176
+ if (isDateLabel && subgroups && subgroups.length < 3) {
9177
+ // For single-series charts on mobile, show full date labels (no trimming)
9178
+ return d;
9179
+ }
9180
+ // If header is hidden (compact mobile), trim non-date labels as before
7990
9181
  if (!self.isHeaderVisible) {
7991
- // If it has both date and week, format appropriately
7992
- if (labelInfo.isDate && labelInfo.isWeek) {
7993
- const datePart = extractDate(d);
7994
- const weekPart = extractWeekNumber(d);
7995
- if (datePart && weekPart) {
7996
- return `${datePart}\n${weekPart}`;
7997
- }
7998
- }
7999
- // If it's just a date, return it unchanged
8000
- if (labelInfo.isDate) {
8001
- return extractDate(d) || d;
8002
- }
8003
- // If it has just week number, format it as W##
8004
- if (labelInfo.isWeek) {
8005
- const weekPart = extractWeekNumber(d);
8006
- if (weekPart) {
8007
- return weekPart;
8008
- }
8009
- }
8010
- // For non-date labels, trim as before
8011
9182
  const firstPart = d.split(/[\s\-]+/)[0];
8012
9183
  return firstPart.substring(0, 3).toLowerCase();
8013
9184
  }
@@ -8023,15 +9194,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8023
9194
  if (dateRangeRegex.test(d.trim())) {
8024
9195
  return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
8025
9196
  }
8026
- // Handle splitting of multi-part labels
9197
+ // Split date and week labels into two lines
9198
+ const isDateLabel = /\d{2,4}[-\/]/.test(d);
9199
+ const isWeekLabel = /week|wk|w\d+/i.test(d);
8027
9200
  if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 &&
8028
- d.indexOf(' ') > -1 && (labelInfo.isDate || labelInfo.isWeek)) {
9201
+ d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
8029
9202
  const first = d.substring(0, d.indexOf(' '));
8030
9203
  const second = d.substring(d.indexOf(' ') + 1).trim();
8031
9204
  return `${first}\n${second}`;
8032
9205
  }
8033
9206
  // Handle date labels in minimized view
8034
- if (labelInfo.isDate) {
9207
+ if (isDateLabel) {
8035
9208
  if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
8036
9209
  const first = d.substring(0, d.indexOf(' '));
8037
9210
  const second = d.substring(d.indexOf(' ') + 1).trim();
@@ -8601,22 +9774,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8601
9774
  if (label.indexOf('\n') > -1) {
8602
9775
  const lines = label.split('\n');
8603
9776
  text.text(null);
8604
- // Increase spacing between lines to avoid overlap on tablet/mobile
8605
9777
  lines.forEach((line, idx) => {
8606
9778
  text.append('tspan')
8607
9779
  .text(line)
8608
9780
  .attr('x', 0)
8609
- // first line sits at baseline, following lines are spaced further down
8610
- .attr('dy', idx === 0 ? '0em' : '1.2em');
9781
+ .attr('dy', idx === 0 ? '1em' : '1.1em');
8611
9782
  });
8612
- // Push multi-line labels down from the axis to prevent clipping/overlap
8613
- text.attr('y', 30);
8614
9783
  }
8615
9784
  else {
8616
9785
  const words = label.split(' ');
8617
9786
  text.text(null);
8618
9787
  words.forEach((word) => {
8619
- text.append('tspan').text(word).attr('x', 0).attr('dy', '0em');
9788
+ text.append('tspan').text(word);
8620
9789
  });
8621
9790
  }
8622
9791
  })
@@ -8634,7 +9803,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8634
9803
  // Minimum width per bar group based on device and number of subgroups
8635
9804
  const minWidthPerGroup = (() => {
8636
9805
  if (subgroupsCount > 2) {
8637
- return isMobile ? 100 : isTablet ? 100 : 120; // Wider for multiple subgroups
9806
+ return isMobile ? 80 : isTablet ? 100 : 120; // Wider for multiple subgroups
8638
9807
  }
8639
9808
  return isMobile ? 40 : isTablet ? 60 : 80; // Normal width for 1-2 subgroups
8640
9809
  })();