axidio-styleguide-library1-v2 0.3.11 → 0.3.12

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.5)
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,22 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7065
7063
  .call((g) => g.select('.domain').remove());
7066
7064
  }
7067
7065
  if (this.chartConfiguration.yAxisGrid) {
7066
+ const gridStartX = this.CONSTANTS.LEFT_RIGHT_SPACES;
7067
+ const gridWidth = dimensions.requiredSvgWidth - gridStartX;
7068
7068
  svg
7069
7069
  .append('g')
7070
- .attr('class', 'grid')
7070
+ .attr('class', 'grid horizontal-grid')
7071
+ .attr('transform', `translate(${gridStartX},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
+ });
7078
7082
  }
7079
7083
  if (this.chartConfiguration.xAxisGrid) {
7080
7084
  for (let j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
@@ -7088,7 +7092,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7088
7092
  }
7089
7093
  }
7090
7094
  }
7091
- renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, device, data) {
7095
+ renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data) {
7092
7096
  if (this.chartConfiguration.showXaxisTop) {
7093
7097
  svg
7094
7098
  .append('g')
@@ -7098,7 +7102,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7098
7102
  svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
7099
7103
  }
7100
7104
  if (!this.chartConfiguration.isMultiChartGridLine) {
7101
- this.renderStandardAxes(svg, axes, scales, dimensions, device, data);
7105
+ this.renderStandardAxes(svg, axes, scales, dimensions, data);
7102
7106
  }
7103
7107
  else if (this.chartConfiguration.isDrilldownChart) {
7104
7108
  this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions);
@@ -7109,24 +7113,34 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7109
7113
  this.applyAxisStyling(svg, svgYAxisLeft, svgYAxisRight);
7110
7114
  this.applyAxisConfigurations(svg, scales, dimensions, data);
7111
7115
  }
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
- }
7116
+ renderStandardAxes(svg, axes, scales, dimensions, data) {
7117
+ const isMobileOrTablet = window.innerWidth < 1024;
7118
+ // X-axis with labels
7119
+ const xAxisGroup = svg
7120
+ .append('g')
7121
+ .attr('transform', `translate(0,${dimensions.height})`)
7122
+ .attr('class', 'lib-stacked-x-axis-text')
7123
+ .call(axes.xAxis);
7124
+ // Style X-axis labels
7125
+ xAxisGroup
7126
+ .selectAll('text')
7127
+ .style('fill', 'var(--chart-text-color)')
7128
+ .style('font-size', isMobileOrTablet ? '10px' : '12px')
7129
+ .attr('text-anchor', 'middle')
7130
+ .attr('dy', '1em')
7131
+ .each(function (d) {
7132
+ const textElement = d3.select(this);
7133
+ const text = textElement.text();
7134
+ if (isMobileOrTablet && text.length > 12) {
7135
+ textElement.text(text.substring(0, 10) + '...');
7136
+ }
7137
+ });
7138
+ // Ensure X-axis line is visible
7139
+ xAxisGroup
7140
+ .select('.domain')
7141
+ .style('stroke', 'var(--chart-axis-color)')
7142
+ .style('stroke-width', '1px');
7143
+ // Y-axis
7130
7144
  svg
7131
7145
  .append('g')
7132
7146
  .attr('class', 'lib-stacked-y-axis-text')
@@ -7135,27 +7149,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7135
7149
  .selectAll('text')
7136
7150
  .style('fill', 'var(--chart-text-color)');
7137
7151
  }
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
7152
  renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions) {
7160
7153
  svg
7161
7154
  .append('g')
@@ -7237,7 +7230,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7237
7230
  }
7238
7231
  }
7239
7232
  renderCustomXAxis(svg, scales, dimensions, data) {
7240
- const device = this.getDeviceConfig();
7241
7233
  svg
7242
7234
  .append('g')
7243
7235
  .attr('class', 'x1 axis1')
@@ -7245,12 +7237,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7245
7237
  .style('color', '#000')
7246
7238
  .call(d3.axisBottom(scales.xScale).tickSize(0))
7247
7239
  .call((g) => g.select('.domain').attr('fill', 'none'));
7248
- this.styleCustomXAxisTicks(svg, data, device);
7240
+ this.styleCustomXAxisTicks(svg, data);
7249
7241
  if (this.chartConfiguration.xLabelsOnSameLine) {
7250
- this.applyXLabelsOnSameLine(svg, device);
7242
+ this.applyXLabelsOnSameLine(svg);
7251
7243
  }
7252
7244
  }
7253
- styleCustomXAxisTicks(svg, data, device) {
7245
+ styleCustomXAxisTicks(svg, data) {
7254
7246
  let alternateText = false;
7255
7247
  svg.selectAll('.x1.axis1 .tick line').attr('y2', () => {
7256
7248
  if (this.chartConfiguration.hideXaxisTick)
@@ -7282,28 +7274,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7282
7274
  return this.CONSTANTS.SHORT_TICK_LENGTH_BG;
7283
7275
  });
7284
7276
  }
7285
- applyXLabelsOnSameLine(svg, device) {
7277
+ applyXLabelsOnSameLine(svg) {
7286
7278
  svg
7287
7279
  .selectAll('g.x1.axis1 g.tick text')
7288
7280
  .attr('class', 'lib-xaxis-labels-texts-drilldown')
7289
7281
  .attr('y', this.CONSTANTS.SHORT_TICK_LENGTH_BG)
7290
7282
  .text((d) => {
7291
- if (device.isMobile) {
7292
- return d.split(' ')[0].substring(0, 3);
7293
- }
7294
7283
  const trimmed = d.trim();
7295
7284
  const spaceIndex = trimmed.indexOf(' ');
7296
7285
  return spaceIndex > -1
7297
7286
  ? trimmed.substring(0, spaceIndex).toLowerCase()
7298
7287
  : 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
7288
  });
7308
7289
  svg
7309
7290
  .selectAll('g.x1.axis1 g.tick')
@@ -7312,16 +7293,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7312
7293
  .attr('y', this.CONSTANTS.LONG_TICK_LENGTH_BG)
7313
7294
  .attr('fill', 'currentColor')
7314
7295
  .text((d) => {
7315
- if (device.isMobile)
7316
- return '';
7317
7296
  const trimmed = d.trim();
7318
7297
  const spaceIndex = trimmed.indexOf(' ');
7319
7298
  return spaceIndex > -1
7320
7299
  ? trimmed.substring(spaceIndex).toLowerCase()
7321
7300
  : '';
7322
- })
7323
- .attr('transform', (d, i) => {
7324
- return device.isMobile && i === 0 ? 'translate(20,0)' : null;
7325
7301
  });
7326
7302
  }
7327
7303
  renderDataLabels(rect, scales, metaData, dimensions) {
@@ -7512,11 +7488,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7512
7488
  this.isZoomOutSelected(isZoomOut);
7513
7489
  }
7514
7490
  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 }); }
7491
+ 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
7492
  }
7517
7493
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
7518
7494
  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"] }]
7495
+ 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
7496
  }], ctorParameters: () => [], propDecorators: { containerElt: [{
7521
7497
  type: ViewChild,
7522
7498
  args: ['verticalstackedchartcontainer', { static: true }]
@@ -7625,6 +7601,1242 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7625
7601
  get isAlertEnabled() {
7626
7602
  return this.chartConfiguration?.headerMenuOptions?.some((option) => option.id === 'editAlert');
7627
7603
  }
7604
+ // initializegroupChart() {
7605
+ // var self = this;
7606
+ // let data = [];
7607
+ // let metaData: any = null;
7608
+ // let keyList = null;
7609
+ // let lineData = null;
7610
+ // let colorMap = {};
7611
+ // var formatFromBackend;
7612
+ // var formatForHugeNumbers;
7613
+ // const isMobile = window.innerWidth < 576;
7614
+ // const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
7615
+ // const isDesktop = window.innerWidth >= 992;
7616
+ // let isria = this.customChartConfiguration.isRia
7617
+ // var x: any;
7618
+ // var alternate_text = false;
7619
+ // var short_tick_length = 4;
7620
+ // var long_tick_length = 16;
7621
+ // /**
7622
+ // * longer tick length needed for weekly charts
7623
+ // */
7624
+ // var short_tick_length_bg = 5;
7625
+ // var long_tick_length_bg = 30;
7626
+ // var leftAndRightSpaces = 50;
7627
+ // var rightSvgWidth = 60;
7628
+ // var tempScale;
7629
+ // for (var i in this.defaultConfiguration) {
7630
+ // this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(
7631
+ // i,
7632
+ // this.defaultConfiguration,
7633
+ // this.customChartConfiguration
7634
+ // );
7635
+ // }
7636
+ // data = this.chartData.data;
7637
+ // metaData = this.chartData.metaData;
7638
+ // lineData = this.chartData.lineData;
7639
+ // // if (lineData || this.chartData.targetLineData) {
7640
+ // // rightSvgWidth = 60;
7641
+ // // }
7642
+ // if (!metaData.colorAboveTarget) {
7643
+ // metaData['colorAboveTarget'] = metaData.colors;
7644
+ // }
7645
+ // colorMap = metaData.colors;
7646
+ // keyList = metaData.keyList;
7647
+ // var chartContainer = d3.select(this.containerElt.nativeElement);
7648
+ // var verticalstackedcontainer = d3.select(
7649
+ // this.groupcontainerElt.nativeElement
7650
+ // );
7651
+ // var margin = this.chartConfiguration.margin;
7652
+ // const { width, height } = this.calculateChartDimensions(
7653
+ // chartContainer,
7654
+ // verticalstackedcontainer,
7655
+ // margin,
7656
+ // self
7657
+ // );
7658
+ // /**
7659
+ // * for hiding header
7660
+ // * used by weekly charts
7661
+ // */
7662
+ // if (this.chartConfiguration.isHeaderVisible != undefined)
7663
+ // this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
7664
+ // /**
7665
+ // * for hiding legends
7666
+ // * used by weekly charts
7667
+ // */
7668
+ // if (this.chartConfiguration.legendVisible != undefined) {
7669
+ // this.legendVisible = this.chartConfiguration.legendVisible;
7670
+ // }
7671
+ // /**
7672
+ // * for removing background color so that it can take parents color
7673
+ // *
7674
+ // */
7675
+ // if (this.chartConfiguration.isTransparentBackground != undefined) {
7676
+ // this.isTransparentBackground =
7677
+ // this.chartConfiguration.isTransparentBackground;
7678
+ // }
7679
+ // /**
7680
+ // * format data values based on configuration received
7681
+ // */
7682
+ // if (this.chartConfiguration.textFormatter != undefined) {
7683
+ // formatFromBackend = ChartHelper.dataValueFormatter(
7684
+ // this.chartConfiguration.textFormatter
7685
+ // );
7686
+ // formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
7687
+ // }
7688
+ // const {
7689
+ // outerContainer,
7690
+ // svgYAxisLeft,
7691
+ // svgYAxisRight,
7692
+ // innerContainer,
7693
+ // svg
7694
+ // } = this.createChartContainers(chartContainer, margin, height, rightSvgWidth, self, width);
7695
+ // var subgroups: any = keyList;
7696
+ // var groups = d3
7697
+ // .map(data, function (d) {
7698
+ // return d.name;
7699
+ // })
7700
+ // .keys();
7701
+ // /**
7702
+ // * x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
7703
+ // */
7704
+ // if (this.chartConfiguration.isMultiChartGridLine != undefined) {
7705
+ // x = d3
7706
+ // .scaleBand()
7707
+ // .rangeRound([width, 0])
7708
+ // .align(0.5)
7709
+ // .padding([0.5])
7710
+ // .domain(
7711
+ // data.map(function (d: any) {
7712
+ // return d.name.toLowerCase();
7713
+ // })
7714
+ // );
7715
+ // } else {
7716
+ // x = d3
7717
+ // .scaleBand()
7718
+ // .domain(groups)
7719
+ // .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
7720
+ // .padding([0.3]);
7721
+ // }
7722
+ // // x.bandwidth(96);
7723
+ // var xScaleFromOrigin = d3
7724
+ // .scaleBand()
7725
+ // .domain(groups)
7726
+ // .range([0, width - rightSvgWidth]);
7727
+ // // .padding([0.2]);
7728
+ // if (this.chartConfiguration.isMultiChartGridLine == undefined) {
7729
+ // /**
7730
+ // * normal ticks for all dashboard charts
7731
+ // */
7732
+ // svg
7733
+ // .append('g')
7734
+ // .attr('class', 'x1 axis1')
7735
+ // .attr('transform', 'translate(0,' + height + ')')
7736
+ // .call(d3.axisBottom(x))
7737
+ // .call((g) => g.select('.domain').remove());
7738
+ // svg.selectAll('g.x1.axis1 g.tick line').remove();
7739
+ // // Only move x-axis labels further down for grouped charts if there is no xLabel
7740
+ // if (subgroups.length > 1 && !metaData.xLabel) {
7741
+ // svg
7742
+ // .selectAll('g.x1.axis1 g.tick text')
7743
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7744
+ // .style('fill', 'var(--chart-text-color)')
7745
+ // .attr('y', 32); // Increase distance from bars (default is ~9)
7746
+ // } else {
7747
+ // svg
7748
+ // .selectAll('g.x1.axis1 g.tick text')
7749
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7750
+ // .style('fill', 'var(--chart-text-color)');
7751
+ // }
7752
+ // }
7753
+ // else {
7754
+ // /**
7755
+ // * bigger ticks for weekly charts and more space from x axis to labels
7756
+ // */
7757
+ // /**
7758
+ // * draw x axis
7759
+ // */
7760
+ // svg
7761
+ // .append('g')
7762
+ // .attr('class', 'x1 axis1')
7763
+ // .attr('transform', 'translate(0,' + height + ')')
7764
+ // .call(d3.axisBottom(x).tickSize(0))
7765
+ // .call((g) => g.select('.domain').attr('fill', 'none'));
7766
+ // /**
7767
+ // * tick line size in alternate fashion
7768
+ // */
7769
+ // svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
7770
+ // if (
7771
+ // alternate_text &&
7772
+ // self.chartConfiguration.isNoAlternateXaxisText == undefined
7773
+ // ) {
7774
+ // alternate_text = false;
7775
+ // return long_tick_length_bg - 7;
7776
+ // } else {
7777
+ // alternate_text = true;
7778
+ // return short_tick_length_bg - 4;
7779
+ // }
7780
+ // });
7781
+ // /**
7782
+ // * reset the flag so that values can be shown in same alternate fashion
7783
+ // */
7784
+ // alternate_text = false;
7785
+ // /**
7786
+ // * print x-axis label texts
7787
+ // * used by weekly charts
7788
+ // */
7789
+ // svg
7790
+ // .selectAll('g.x1.axis1 g.tick text')
7791
+ // .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
7792
+ // .attr('y', function () {
7793
+ // // Minimize gap in maximized (fullscreen) view for weekly charts
7794
+ // if (self.chartConfiguration.isFullScreen) {
7795
+ // return short_tick_length_bg;
7796
+ // }
7797
+ // if (alternate_text) {
7798
+ // alternate_text = false;
7799
+ // return long_tick_length_bg;
7800
+ // } else {
7801
+ // alternate_text = true;
7802
+ // return short_tick_length_bg;
7803
+ // }
7804
+ // });
7805
+ // }
7806
+ // if (self.chartConfiguration.xLabelsOnSameLine) {
7807
+ // const xAxisLabels = svg
7808
+ // .selectAll('g.x1.axis1 g.tick text')
7809
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7810
+ // .style('font-size', this.isHeaderVisible ? '18px' : '14px')
7811
+ // .attr('text-anchor', 'middle')
7812
+ // .attr('y', function(d) {
7813
+ // // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
7814
+ // if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
7815
+ // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7816
+ // if (self.chartConfiguration.isFullScreen) {
7817
+ // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7818
+ // }
7819
+ // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7820
+ // }
7821
+ // // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
7822
+ // if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
7823
+ // const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
7824
+ // if (self.chartConfiguration.isFullScreen) {
7825
+ // // Reduce extra gap in maximized view
7826
+ // return short_tick_length_bg + 2;
7827
+ // }
7828
+ // return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
7829
+ // }
7830
+ // // Default/fallback logic for other cases
7831
+ // let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
7832
+ // if (
7833
+ // subgroups.length > 1 &&
7834
+ // !metaData.xLabel &&
7835
+ // (/\d{2,4}[-\/]\d{2}[-\/]\d{2,4}/.test(d) || /\d{2,4}[-\/]\d{2,4}/.test(d))
7836
+ // ) {
7837
+ // baseY = self.isHeaderVisible ? short_tick_length_bg + 15 : short_tick_length_bg + 25;
7838
+ // }
7839
+ // if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
7840
+ // baseY += 4;
7841
+ // }
7842
+ // // In maximized view, reduce baseY slightly for grouped bars
7843
+ // if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
7844
+ // baseY = Math.max(short_tick_length_bg, baseY - 10);
7845
+ // }
7846
+ // return baseY;
7847
+ // })
7848
+ // .attr('x', function (d) {
7849
+ // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7850
+ // return 1; // Move first line text slightly to the left in zoom-in view for better alignment
7851
+ // }
7852
+ // return 0; // Default position
7853
+ // })
7854
+ // .text(function (d) {
7855
+ // var isValueToBeIgnored = false;
7856
+ // if (isMobile && !self.isHeaderVisible) {
7857
+ // let firstPart = d.split(/[\s\-]+/)[0];
7858
+ // return firstPart.substring(0, 3).toLowerCase();
7859
+ // }
7860
+ // (data as any[]).map((indiv: any) => {
7861
+ // if (
7862
+ // indiv.name &&
7863
+ // indiv.name.toLowerCase() == d.trim().toLowerCase() &&
7864
+ // indiv[metaData.keyList[0]] == -1
7865
+ // ) {
7866
+ // isValueToBeIgnored = true;
7867
+ // }
7868
+ // });
7869
+ // if (isValueToBeIgnored) {
7870
+ // return '';
7871
+ // }
7872
+ // // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
7873
+ // // Apply for grouped bar charts and single bar charts, header visible, single line
7874
+ // const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
7875
+ // if (dateRangeRegex.test(d.trim())) {
7876
+ // return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
7877
+ // }
7878
+ // // Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
7879
+ // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7880
+ // const isWeekLabel = /week|wk|w\d+/i.test(d);
7881
+ // if (
7882
+ // subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)
7883
+ // ) {
7884
+ // var first = d.substring(0, d.indexOf(' '));
7885
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7886
+ // return first + '\n' + second;
7887
+ // }
7888
+ // // Also keep previous logic for minimized view
7889
+ // if (isDateLabel) {
7890
+ // if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
7891
+ // var first = d.substring(0, d.indexOf(' '));
7892
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7893
+ // return first + '\n' + second;
7894
+ // } else {
7895
+ // return d;
7896
+ // }
7897
+ // }
7898
+ // if (d.trim().indexOf(' ') > -1) {
7899
+ // return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
7900
+ // }
7901
+ // return d.toLowerCase();
7902
+ // // If label looks like a date (contains digits and - or /)
7903
+ // const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
7904
+ // // Only split date/week labels if there are many grouped bars and header is not visible
7905
+ // if (isDateLabel) {
7906
+ // if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
7907
+ // var first = d.substring(0, d.indexOf(' '));
7908
+ // var second = d.substring(d.indexOf(' ') + 1).trim();
7909
+ // return first + '\n' + second;
7910
+ // } else {
7911
+ // return d;
7912
+ // }
7913
+ // }
7914
+ // if (d.trim().indexOf(' ') > -1) {
7915
+ // return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
7916
+ // }
7917
+ // return d.toLowerCase();
7918
+ // });
7919
+ // // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
7920
+ // xAxisLabels.each(function(this: SVGTextElement, d: any) {
7921
+ // // Only apply writing-mode for exact date labels, not those containing 'week' or similar
7922
+ // const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
7923
+ // const isWeekLabel = /week|wk|w\d+/i.test(d);
7924
+ // if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
7925
+ // d3.select(this).style('writing-mode', 'sideways-lr');
7926
+ // }
7927
+ // });
7928
+ // if (!isMobile) {
7929
+ // svg
7930
+ // .selectAll('g.x1.axis1 g.tick')
7931
+ // .filter(function (d) {
7932
+ // return !/\d{2,4}[-\/]/.test(d); // Only process non-date labels
7933
+ // })
7934
+ // .append('text')
7935
+ // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7936
+ // .attr('y', long_tick_length_bg)
7937
+ // .attr('fill', 'var(--chart-text-color)')
7938
+ // .attr('x', function (d) {
7939
+ // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7940
+ // return 1; // Move text slightly to the left
7941
+ // }
7942
+ // return 0; // Default position
7943
+ // })
7944
+ // .text(function (d) {
7945
+ // if (d.trim().indexOf(' ') > -1) {
7946
+ // return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
7947
+ // }
7948
+ // return '';
7949
+ // });
7950
+ // }
7951
+ // }
7952
+ // if (isria && self.chartData.data.length > 8) {
7953
+ // svg
7954
+ // .selectAll('g.x1.axis1 g.tick text')
7955
+ // .classed('mobile-xaxis-override', true)
7956
+ // .text(function (d: string) {
7957
+ // return d.substring(0, 3);
7958
+ // })
7959
+ // .style('font-size', '12px')
7960
+ // .attr('y', 5)
7961
+ // .attr('x', 5)
7962
+ // .style('text-anchor', 'middle');
7963
+ // }
7964
+ // if (isMobile && !this.isHeaderVisible) {
7965
+ // svg
7966
+ // .selectAll('g.x1.axis1 g.tick text')
7967
+ // .classed('mobile-xaxis-override', true);
7968
+ // }
7969
+ // /**y scale for left y axis */
7970
+ // var y = d3.scaleLinear().rangeRound([height, 0]);
7971
+ // var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
7972
+ // if (maxValue == 0) {
7973
+ // if (this.chartData.targetLineData) {
7974
+ // maxValue = this.chartData.targetLineData.target + 20;
7975
+ // } else {
7976
+ // maxValue = 100;
7977
+ // }
7978
+ // }
7979
+ // if (this.chartConfiguration.customYscale) {
7980
+ // /**
7981
+ // * increase y-scale so that values wont cross or exceed out of range
7982
+ // * used in weekly charts
7983
+ // */
7984
+ // maxValue = maxValue * this.chartConfiguration.customYscale;
7985
+ // }
7986
+ // if (
7987
+ // this.chartData.targetLineData &&
7988
+ // maxValue < this.chartData.targetLineData.target
7989
+ // ) {
7990
+ // maxValue =
7991
+ // maxValue < 10 && this.chartData.targetLineData.target < 10
7992
+ // ? this.chartData.targetLineData.target + 3
7993
+ // : this.chartData.targetLineData.target + 20;
7994
+ // }
7995
+ // y.domain([0, maxValue]).nice();
7996
+ // let lineYscale;
7997
+ // if (lineData != null) {
7998
+ // let maxLineValue = d3.max(lineData, function (d) {
7999
+ // return +d.value;
8000
+ // });
8001
+ // maxLineValue = maxLineValue * this.chartConfiguration.customYscale;
8002
+ // let minLineValue = d3.min(lineData, function (d) {
8003
+ // return +d.value;
8004
+ // });
8005
+ // if (maxLineValue > 0) minLineValue = minLineValue - 3;
8006
+ // if (minLineValue > 0) {
8007
+ // minLineValue = 0;
8008
+ // }
8009
+ // lineYscale = d3
8010
+ // .scaleLinear()
8011
+ // .domain([minLineValue, maxLineValue])
8012
+ // .range([height, minLineValue]);
8013
+ // }
8014
+ // let yLineAxis;
8015
+ // if (lineYscale != null) {
8016
+ // yLineAxis = d3
8017
+ // .axisRight(lineYscale)
8018
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8019
+ // .tickSize(0)
8020
+ // .tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
8021
+ // }
8022
+ // /**
8023
+ // * show x-axis grid between labels
8024
+ // * used by weekly charts
8025
+ // */
8026
+ // if (self.chartConfiguration.isXgridBetweenLabels) {
8027
+ // svg
8028
+ // .append('g')
8029
+ // .attr('class', 'grid')
8030
+ // .attr(
8031
+ // 'transform',
8032
+ // 'translate(' + x.bandwidth() / 2 + ',' + height + ')'
8033
+ // )
8034
+ // .call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
8035
+ // .style('stroke-dasharray', '5 5')
8036
+ // .style('color', 'var(--chart-grid-color, #999999)') // Use CSS variable
8037
+ // .call((g) => g.select('.domain').remove());
8038
+ // }
8039
+ // if (this.chartConfiguration.yAxisGrid) {
8040
+ // svg
8041
+ // .append('g')
8042
+ // .call(
8043
+ // d3
8044
+ // .axisLeft(y)
8045
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8046
+ // .tickSize(-width)
8047
+ // )
8048
+ // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8049
+ // .style('opacity', '0.5')
8050
+ // .call((g) => {
8051
+ // g.select('.domain')
8052
+ // .remove()
8053
+ // .style('stroke', 'var(--chart-domain-color, #000000)'); // Add CSS variable for domain
8054
+ // });
8055
+ // } else {
8056
+ // svg
8057
+ // .append('g')
8058
+ // .call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
8059
+ // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8060
+ // .style('opacity', '0.5')
8061
+ // .call((g) => {
8062
+ // g.select('.domain')
8063
+ // .style('stroke', 'var(--chart-domain-color, #000000)') // Add CSS variable for domain
8064
+ // .style('stroke-width', '1px'); // Ensure visibility
8065
+ // });
8066
+ // }
8067
+ // var xSubgroup = d3.scaleBand().domain(subgroups);
8068
+ // if (subgroups.length > 1 && !this.isZoomedOut) {
8069
+ // // For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
8070
+ // xSubgroup.range([0, x.bandwidth()]);
8071
+ // } else if (subgroups.length === 1 && !this.isZoomedOut) {
8072
+ // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
8073
+ // xSubgroup.range([0, 100]);
8074
+ // } else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
8075
+ // xSubgroup.range([0, x.bandwidth()]);
8076
+ // } else {
8077
+ // // used to make grouped bars with lesser width as we are not using padding for width
8078
+ // xSubgroup.range([0, x.bandwidth()]);
8079
+ // }
8080
+ // // if (this.chartConfiguration.isDrilldownChart) {
8081
+ // // }
8082
+ // var color = d3
8083
+ // .scaleOrdinal()
8084
+ // .domain(subgroups)
8085
+ // .range(Object.values(metaData.colors));
8086
+ // // var colorAboveTarget = d3
8087
+ // // .scaleOrdinal()
8088
+ // // .domain(subgroups)
8089
+ // // .range(Object.values(metaData.colorAboveTarget));
8090
+ // var state = svg
8091
+ // .append('g')
8092
+ // .selectAll('.state')
8093
+ // .data(data)
8094
+ // .enter()
8095
+ // .append('g')
8096
+ // .attr('transform', function (d) {
8097
+ // return 'translate(' + x(d.name) + ',0)';
8098
+ // });
8099
+ // state
8100
+ // .selectAll('rect')
8101
+ // .data(function (d) {
8102
+ // let newList: any = [];
8103
+ // subgroups.map(function (key) {
8104
+ // // if (key !== "group") {
8105
+ // let obj: any = { key: key, value: d[key], name: d.name };
8106
+ // newList.push(obj);
8107
+ // // }
8108
+ // });
8109
+ // return newList;
8110
+ // })
8111
+ // .enter()
8112
+ // .append('rect')
8113
+ // .attr('class', 'bars')
8114
+ // .on('click', function (d) {
8115
+ // if (d.key != 'Target') {
8116
+ // if (
8117
+ // !metaData.barWithoutClick ||
8118
+ // !metaData.barWithoutClick.length ||
8119
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8120
+ // !metaData.barWithoutClick.includes(d?.key))
8121
+ // )
8122
+ // // self.handleClick(d.data.name);
8123
+ // self.handleClick(d);
8124
+ // }
8125
+ // })
8126
+ // .attr('x', function (d) {
8127
+ // if (self.chartConfiguration.isDrilldownChart) {
8128
+ // data.map((indiv: any) => {
8129
+ // if (indiv.name == d.name) {
8130
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8131
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8132
+ // if (x.bandwidth() > 100) {
8133
+ // // Increase bar width a bit in zoom-in view
8134
+ // let reducedBarWidth = 60;
8135
+ // if (!self.isZoomedOut) {
8136
+ // reducedBarWidth = 30;
8137
+ // }
8138
+ // if (self.chartData.data.length == 1) {
8139
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8140
+ // tempScale.range([
8141
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8142
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8143
+ // ]);
8144
+ // } else
8145
+ // tempScale.range([
8146
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8147
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8148
+ // ]);
8149
+ // } else
8150
+ // tempScale.range([
8151
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8152
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8153
+ // ]);
8154
+ // }
8155
+ // }
8156
+ // });
8157
+ // return tempScale(d.key);
8158
+ // }
8159
+ // return xSubgroup(d.key);
8160
+ // })
8161
+ // .attr('y', function (d) {
8162
+ // if (d.value == -1) {
8163
+ // return y(0);
8164
+ // }
8165
+ // if (d.value >= 0) {
8166
+ // const barHeight = height - y(d.value);
8167
+ // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8168
+ // return barHeight < minHeight ? y(0) - minHeight : y(d.value);
8169
+ // }
8170
+ // return y(0);
8171
+ // })
8172
+ // .attr('width', function (d) {
8173
+ // // For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
8174
+ // if (subgroups.length > 1 && !self.isZoomedOut) {
8175
+ // return 50;
8176
+ // }
8177
+ // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
8178
+ // if (subgroups.length === 1 && !self.isZoomedOut) {
8179
+ // return 80;
8180
+ // }
8181
+ // let tempScale = d3.scaleBand().domain([]).range([0, 0]);
8182
+ // // Default logic for other chart types
8183
+ // if (self.chartConfiguration.isDrilldownChart) {
8184
+ // data.map((indiv: any) => {
8185
+ // if (indiv.name == d.name) {
8186
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8187
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8188
+ // if (x.bandwidth() > 100) {
8189
+ // // Increase bar width a bit in zoom-in view
8190
+ // let reducedBarWidth = 60;
8191
+ // if (!self.isZoomedOut) {
8192
+ // reducedBarWidth = 100;
8193
+ // }
8194
+ // if (self.chartData.data.length == 1) {
8195
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8196
+ // tempScale.range([
8197
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8198
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8199
+ // ]);
8200
+ // } else
8201
+ // tempScale.range([
8202
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8203
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8204
+ // ]);
8205
+ // } else
8206
+ // tempScale.range([
8207
+ // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8208
+ // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8209
+ // ]);
8210
+ // }
8211
+ // }
8212
+ // });
8213
+ // return self.isZoomedOut
8214
+ // ? tempScale.bandwidth()
8215
+ // : self.chartData.data.length && self.chartData.data.length > 8
8216
+ // ? tempScale.bandwidth()
8217
+ // : tempScale.bandwidth();
8218
+ // }
8219
+ // return self.isZoomedOut
8220
+ // ? tempScale.bandwidth()
8221
+ // : self.chartData.data.length && self.chartData.data.length > 8
8222
+ // ? tempScale.bandwidth()
8223
+ // : tempScale.bandwidth();
8224
+ // })
8225
+ // .attr('height', function (d) {
8226
+ // if (d.value == -1) {
8227
+ // return height - y(0);
8228
+ // }
8229
+ // if (d.value >= 0) {
8230
+ // const barHeight = height - y(d.value);
8231
+ // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8232
+ // return Math.max(barHeight, minHeight);
8233
+ // }
8234
+ // return height - y(0);
8235
+ // })
8236
+ // .style('cursor', function (d) {
8237
+ // if (metaData.hasDrillDown && !isria) return 'pointer';
8238
+ // else return 'default';
8239
+ // })
8240
+ // .attr('fill', function (d) {
8241
+ // if (
8242
+ // d.value &&
8243
+ // self.chartData.targetLineData &&
8244
+ // d.value >= parseFloat(self.chartData.targetLineData.target) &&
8245
+ // self.chartData.metaData.colorAboveTarget
8246
+ // ) {
8247
+ // const key = d.key.toLowerCase();
8248
+ // const colorAboveTarget = Object.keys(self.chartData.metaData.colorAboveTarget).find(
8249
+ // k => k.toLowerCase() === key
8250
+ // );
8251
+ // if (colorAboveTarget) {
8252
+ // return self.chartData.metaData.colorAboveTarget[colorAboveTarget];
8253
+ // }
8254
+ // }
8255
+ // return self.chartData.metaData.colors[d.key];
8256
+ // });
8257
+ // /**
8258
+ // * display angled texts on the bars
8259
+ // */
8260
+ // if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
8261
+ // state
8262
+ // .selectAll('text')
8263
+ // .data(function (d) {
8264
+ // let newList: any = [];
8265
+ // subgroups.map(function (key) {
8266
+ // let obj: any = { key: key, value: d[key], name: d.name };
8267
+ // newList.push(obj);
8268
+ // });
8269
+ // return newList;
8270
+ // })
8271
+ // .enter()
8272
+ // .append('text')
8273
+ // .attr('fill', 'var(--chart-text-color)')
8274
+ // .attr('x', function (d) {
8275
+ // return 0;
8276
+ // })
8277
+ // .attr('y', function (d) {
8278
+ // return 0;
8279
+ // })
8280
+ // .attr('class', 'lib-data-labels-weeklycharts')
8281
+ // .text(function (d) {
8282
+ // return d.key && d.value
8283
+ // ? d.key.length > 20
8284
+ // ? d.key.substring(0, 17) + '...'
8285
+ // : d.key
8286
+ // : '';
8287
+ // })
8288
+ // .style('fill', function (d) {
8289
+ // return '#000';
8290
+ // })
8291
+ // .style('font-weight', 'bold')
8292
+ // .style('font-size', function (d) {
8293
+ // if (self.isZoomedOut) {
8294
+ // return '9px'; // 👈 Zoomed out mode
8295
+ // }
8296
+ // if (self.chartConfiguration.isDrilldownChart) {
8297
+ // if (window.innerWidth > 1900) {
8298
+ // return '18px';
8299
+ // } else if (window.innerWidth < 1400) {
8300
+ // return '10px';
8301
+ // } else {
8302
+ // return '14px';
8303
+ // }
8304
+ // } else {
8305
+ // return '14px';
8306
+ // }
8307
+ // })
8308
+ // .attr('transform', function (d) {
8309
+ // data.map((indiv: any) => {
8310
+ // if (indiv.name == d.name) {
8311
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8312
+ // var temp;
8313
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8314
+ // if (x.bandwidth() > 100) {
8315
+ // if (self.chartData.data.length == 1) {
8316
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8317
+ // tempScale.range([
8318
+ // 0 + (x.bandwidth() - 200) / 2,
8319
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8320
+ // ]);
8321
+ // // .padding(0.05);
8322
+ // } else
8323
+ // tempScale.range([
8324
+ // 0 + (x.bandwidth() - 300) / 2,
8325
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8326
+ // ]);
8327
+ // // .padding(0.05);
8328
+ // } else
8329
+ // tempScale.range([
8330
+ // 0 + (x.bandwidth() - 125) / 2,
8331
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8332
+ // ]);
8333
+ // }
8334
+ // }
8335
+ // });
8336
+ // /**
8337
+ // * if set, then all texts ll be horizontal
8338
+ // */
8339
+ // if (self.chartConfiguration.textAlwaysHorizontal) {
8340
+ // return (
8341
+ // 'translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')'
8342
+ // );
8343
+ // }
8344
+ // /**
8345
+ // * rotate texts having more than one digits
8346
+ // */
8347
+ // // if (d.value > 9)
8348
+ // if (!isNaN(tempScale(d.key)))
8349
+ // return (
8350
+ // 'translate(' +
8351
+ // (tempScale(d.key) + tempScale.bandwidth() * 0.55) +
8352
+ // ',' +
8353
+ // (y(0) - 10) +
8354
+ // ') rotate(270)'
8355
+ // );
8356
+ // return 'translate(0,0)';
8357
+ // // else
8358
+ // // return (
8359
+ // // 'translate(' +
8360
+ // // (tempScale(d.key) + tempScale.bandwidth() / 2) +
8361
+ // // ',' +
8362
+ // // y(0) +
8363
+ // // ')'
8364
+ // // );
8365
+ // })
8366
+ // .on('click', function (d) {
8367
+ // if (
8368
+ // !metaData.barWithoutClick ||
8369
+ // !metaData.barWithoutClick.length ||
8370
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8371
+ // !metaData.barWithoutClick.includes(d?.key))
8372
+ // )
8373
+ // self.handleClick(d);
8374
+ // });
8375
+ // if (!isria) {
8376
+ // state
8377
+ // .selectAll('.lib-data-labels-weeklycharts')
8378
+ // .on('mouseout', handleMouseOut)
8379
+ // .on('mouseover', handleMouseOver);
8380
+ // }
8381
+ // }
8382
+ // if (this.chartConfiguration.displayTitleOnTop || (
8383
+ // this.chartConfiguration.textsOnBar == undefined &&
8384
+ // this.chartConfiguration.displayTitleOnTop == undefined
8385
+ // )) {
8386
+ // if (!isria) {
8387
+ // state
8388
+ // .selectAll('rect')
8389
+ // .on('mouseout', handleMouseOut)
8390
+ // .on('mouseover', handleMouseOver);
8391
+ // }
8392
+ // }
8393
+ // function handleMouseOver(d, i) {
8394
+ // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8395
+ // svg
8396
+ // .append('foreignObject')
8397
+ // .attr('x', function () {
8398
+ // // ...existing code for tempScale calculation...
8399
+ // var elementsCounter;
8400
+ // data.map((indiv: any) => {
8401
+ // if (indiv.name == d.name) {
8402
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8403
+ // elementsCounter = keys.length;
8404
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8405
+ // if (x.bandwidth() > 100) {
8406
+ // if (self.chartData.data.length == 1) {
8407
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8408
+ // tempScale.range([
8409
+ // 0 + (x.bandwidth() - 200) / 2,
8410
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8411
+ // ]);
8412
+ // } else
8413
+ // tempScale.range([
8414
+ // 0 + (x.bandwidth() - 300) / 2,
8415
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8416
+ // ]);
8417
+ // } else
8418
+ // tempScale.range([
8419
+ // 0 + (x.bandwidth() - 125) / 2,
8420
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8421
+ // ]);
8422
+ // }
8423
+ // }
8424
+ // });
8425
+ // if (metaData.hasDrillDown) {
8426
+ // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8427
+ // return (
8428
+ // x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90
8429
+ // );
8430
+ // }
8431
+ // return (
8432
+ // x(d.name) +
8433
+ // tempScale(d.key) -
8434
+ // (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
8435
+ // tempScale.bandwidth() / 2
8436
+ // );
8437
+ // } else return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
8438
+ // })
8439
+ // .attr('class', 'lib-verticalstack-title-ontop')
8440
+ // .attr('y', function () {
8441
+ // return y(d.value) - 3 - 40 - 10;
8442
+ // })
8443
+ // .attr('dy', function () {
8444
+ // return d.class;
8445
+ // })
8446
+ // .attr('width', function () {
8447
+ // data.map((indiv: any) => {
8448
+ // if (indiv.name == d.name) {
8449
+ // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8450
+ // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8451
+ // if (x.bandwidth() > 100) {
8452
+ // if (self.chartData.data.length == 1) {
8453
+ // if (Object.keys(self.chartData.data[0]).length == 2) {
8454
+ // tempScale.range([
8455
+ // 0 + (x.bandwidth() - 200) / 2,
8456
+ // x.bandwidth() - (x.bandwidth() - 200) / 2,
8457
+ // ]);
8458
+ // } else
8459
+ // tempScale.range([
8460
+ // 0 + (x.bandwidth() - 300) / 2,
8461
+ // x.bandwidth() - (x.bandwidth() - 300) / 2,
8462
+ // ]);
8463
+ // } else
8464
+ // tempScale.range([
8465
+ // 0 + (x.bandwidth() - 125) / 2,
8466
+ // x.bandwidth() - (x.bandwidth() - 125) / 2,
8467
+ // ]);
8468
+ // }
8469
+ // }
8470
+ // });
8471
+ // if (metaData.hasDrillDown) {
8472
+ // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8473
+ // return '180px';
8474
+ // }
8475
+ // return tempScale.bandwidth() + leftAndRightSpaces * 2;
8476
+ // } else return tempScale.bandwidth() + leftAndRightSpaces * 2;
8477
+ // })
8478
+ // .attr('height', 50)
8479
+ // .append('xhtml:div')
8480
+ // .attr('class', 'title')
8481
+ // .style('z-index', 99)
8482
+ // .html(function () {
8483
+ // let barLabel = d.key;
8484
+ // let dataType = metaData.dataType ? metaData.dataType : '';
8485
+ // let value = d.value;
8486
+ // let desiredText =
8487
+ // '<span class="title-bar-name">' + barLabel + '</span>';
8488
+ // desiredText +=
8489
+ // '<span class="title-bar-value"><span>' +
8490
+ // value +
8491
+ // '</span>' +
8492
+ // dataType +
8493
+ // '</span>';
8494
+ // return desiredText;
8495
+ // });
8496
+ // }
8497
+ // function handleMouseOut(d, i) {
8498
+ // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8499
+ // }
8500
+ // svg
8501
+ // .append('g')
8502
+ // .attr('class', 'x2 axis2')
8503
+ // .attr('transform', 'translate(0,' + height + ')')
8504
+ // .style('color', 'var(--chart-axis-color, #000)') // Use CSS variable instead of hardcoded #000
8505
+ // .call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
8506
+ // .call((g) => g.select('.domain').attr('fill', 'none'));
8507
+ // svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
8508
+ // svg
8509
+ // .append('g')
8510
+ // .attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
8511
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8512
+ // .attr('transform', 'translate(0,0)')
8513
+ // .call(y)
8514
+ // .style('display', 'none');
8515
+ // svgYAxisLeft
8516
+ // .append('g')
8517
+ // .append('g')
8518
+ // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8519
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8520
+ // .attr('transform', 'translate(0,0)')
8521
+ // .call(
8522
+ // d3
8523
+ // .axisLeft(y)
8524
+ // .tickSize(0)
8525
+ // .ticks(self.chartConfiguration.numberOfYTicks)
8526
+ // .tickFormat(function (d) {
8527
+ // const formatted = self.chartConfiguration.yAxisLabelFomatter
8528
+ // ? self.chartConfiguration.yAxisLabelFomatter(d)
8529
+ // : d;
8530
+ // return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
8531
+ // })
8532
+ // )
8533
+ // .call((g) => {
8534
+ // // Style the domain line for theme support
8535
+ // g.select('.domain')
8536
+ // .style('stroke', 'var(--chart-domain-color, #000000)')
8537
+ // .style('stroke-width', '1px');
8538
+ // })
8539
+ // .selectAll('text')
8540
+ // .style('fill', 'var(--chart-text-color)');
8541
+ // svgYAxisRight
8542
+ // .append('g')
8543
+ // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8544
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8545
+ // .attr('transform', 'translate(0,0)')
8546
+ // .call(y)
8547
+ // .style('display', 'none');
8548
+ // /**
8549
+ // * hide x axis labels
8550
+ // * config is there for future use
8551
+ // * used by weekly charts
8552
+ // */
8553
+ // if (
8554
+ // this.chartConfiguration.isXaxisLabelHidden != undefined &&
8555
+ // this.chartConfiguration.isXaxisLabelHidden
8556
+ // ) {
8557
+ // d3.selectAll('g.lib-line-x-axis-text > g > text').attr(
8558
+ // 'class',
8559
+ // 'lib-display-hidden'
8560
+ // );
8561
+ // }
8562
+ // /**
8563
+ // * hide y axis labels
8564
+ // * used by weekly charts
8565
+ // */
8566
+ // if (
8567
+ // this.chartConfiguration.isYaxisLabelHidden != undefined &&
8568
+ // this.chartConfiguration.isYaxisLabelHidden
8569
+ // ) {
8570
+ // d3.selectAll('.yaxis-dashed > g > text').attr(
8571
+ // 'class',
8572
+ // 'lib-display-hidden'
8573
+ // );
8574
+ // }
8575
+ // /**
8576
+ // * hide y axis labels
8577
+ // * config is there for future use
8578
+ // */
8579
+ // if (
8580
+ // this.chartConfiguration.isYaxisHidden != undefined &&
8581
+ // this.chartConfiguration.isYaxisHidden
8582
+ // ) {
8583
+ // d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
8584
+ // }
8585
+ // /**
8586
+ // * dashed y axis
8587
+ // * used by weekly charts
8588
+ // */
8589
+ // if (
8590
+ // this.chartConfiguration.isYaxisDashed != undefined &&
8591
+ // this.chartConfiguration.isYaxisDashed
8592
+ // ) {
8593
+ // d3.selectAll('.yaxis-dashed')
8594
+ // .style('stroke-dasharray', '5 5')
8595
+ // .style('color', 'var(--chart-axis-color, #999999)'); // Use CSS variable
8596
+ // }
8597
+ // if (lineData != null) {
8598
+ // if (lineData && self.chartConfiguration.showLineChartAxis) {
8599
+ // svgYAxisRight
8600
+ // .append('g')
8601
+ // .attr('class', 'lib-stacked-y-axis-text1')
8602
+ // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8603
+ // .attr('transform', 'translate(' + 0 + ',0)')
8604
+ // .call(yLineAxis);
8605
+ // }
8606
+ // }
8607
+ // /**
8608
+ // * used to display y label
8609
+ // */
8610
+ // // if (this.isZoomedOut) {
8611
+ // // svg
8612
+ // // .selectAll('.lib-xaxis-labels-texts-drilldown')
8613
+ // // .attr('class', 'lib-display-hidden');
8614
+ // // }
8615
+ // if (this.isZoomedOut) {
8616
+ // svg
8617
+ // .selectAll('.lib-xaxis-labels-texts-drilldown')
8618
+ // .each((d, i, nodes) => {
8619
+ // const text = d3.select(nodes[i]);
8620
+ // const label = text.text();
8621
+ // if (label.indexOf('\n') > -1) {
8622
+ // const lines = label.split('\n');
8623
+ // text.text(null);
8624
+ // lines.forEach((line, idx) => {
8625
+ // text.append('tspan')
8626
+ // .text(line)
8627
+ // .attr('x', 0)
8628
+ // .attr('dy', idx === 0 ? '1em' : '1.1em');
8629
+ // });
8630
+ // } else {
8631
+ // const words = label.split(' ');
8632
+ // text.text(null);
8633
+ // words.forEach((word, index) => {
8634
+ // text.append('tspan').text(word);
8635
+ // });
8636
+ // }
8637
+ // })
8638
+ // .style('fill', 'var(--chart-text-color)')
8639
+ // .attr('transform', null);
8640
+ // svg
8641
+ // .select('.x-axis')
8642
+ // .attr('transform', `translate(0, ${height - margin.bottom + 10})`);
8643
+ // }
8644
+ // /**
8645
+ // * used to write y labels based on configuration
8646
+ // */
8647
+ // if (metaData.yLabel) {
8648
+ // const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
8649
+ // svgYAxisLeft
8650
+ // .append('text')
8651
+ // .attr('class', 'lib-axis-group-label font-size-1')
8652
+ // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8653
+ // .attr('transform', 'rotate(-90)')
8654
+ // .attr('y', yPosition)
8655
+ // .attr('x', 0 - height / 2)
8656
+ // .attr('dy', '1em')
8657
+ // .style('text-anchor', 'middle')
8658
+ // .attr('fill', 'var(--chart-text-color)');
8659
+ // if (this.chartConfiguration.isMultiChartGridLine === undefined) {
8660
+ // svgYAxisLeft
8661
+ // .selectAll('.lib-axis-group-label')
8662
+ // .style('font-size', 'smaller')
8663
+ // .text(metaData.yLabel);
8664
+ // } else {
8665
+ // svg
8666
+ // .selectAll('.lib-axis-group-label')
8667
+ // .attr('class', 'lib-ylabel-weeklyCharts')
8668
+ // .text(metaData.yLabel.toLowerCase());
8669
+ // }
8670
+ // }
8671
+ // if (this.chartData.targetLineData) {
8672
+ // const yZero = y(this.chartData.targetLineData.target);
8673
+ // svg
8674
+ // .append('line')
8675
+ // .attr('x1', 0)
8676
+ // .attr('x2', width)
8677
+ // .attr('y1', yZero)
8678
+ // .attr('y2', yZero)
8679
+ // .style('stroke-dasharray', '5 5')
8680
+ // .style('stroke', this.chartData.targetLineData.color);
8681
+ // // svgYAxisRight
8682
+ // // .append('line')
8683
+ // // .attr('x1', 0)
8684
+ // // .attr('x2', rightSvgWidth)
8685
+ // // .attr('y1', yZero)
8686
+ // // .attr('y2', yZero)
8687
+ // // .style('stroke', this.chartData.targetLineData.color);
8688
+ // svgYAxisRight
8689
+ // .append('foreignObject')
8690
+ // .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
8691
+ // .attr('width', rightSvgWidth)
8692
+ // .attr('height', 50)
8693
+ // .append('xhtml:div')
8694
+ // .attr('class', 'target-display')
8695
+ // .style('color', 'var(--chart-text-color)')
8696
+ // .html(function () {
8697
+ // let dataTypeTemp = '';
8698
+ // let targetLineName = 'target';
8699
+ // if (metaData.dataType) {
8700
+ // dataTypeTemp = metaData.dataType;
8701
+ // }
8702
+ // if (
8703
+ // self.chartData.targetLineData &&
8704
+ // self.chartData.targetLineData.targetName
8705
+ // ) {
8706
+ // targetLineName = self.chartData.targetLineData.targetName;
8707
+ // }
8708
+ // return (
8709
+ // `<div>${targetLineName}</div>` +
8710
+ // '<div>' +
8711
+ // self.chartData.targetLineData.target +
8712
+ // '' +
8713
+ // dataTypeTemp +
8714
+ // '</div>'
8715
+ // );
8716
+ // });
8717
+ // }
8718
+ // if (this.chartConfiguration.isDrilldownChart) {
8719
+ // /**
8720
+ // * used by drilldown charts
8721
+ // */
8722
+ // // svg
8723
+ // // .selectAll('.lib-axis-group-label')
8724
+ // // .attr('class', 'lib-ylabel-drilldowncharts')
8725
+ // // .text(metaData.yLabel.toLowerCase());
8726
+ // svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
8727
+ // }
8728
+ // if (metaData.xLabel) {
8729
+ // function isAcronym(label) {
8730
+ // return (
8731
+ // (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
8732
+ // (label === label.toUpperCase() && /[A-Z]/.test(label))
8733
+ // );
8734
+ // }
8735
+ // const xLabelText = metaData.xLabel;
8736
+ // const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
8737
+ // const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
8738
+ // svg
8739
+ // .append('text')
8740
+ // .attr('class', function () {
8741
+ // let baseClass = 'lib-axis-group-label font-size-1';
8742
+ // if (self.chartConfiguration.isDrilldownChart)
8743
+ // return baseClass + ' lib-xlabel-drilldowncharts';
8744
+ // if (self.chartConfiguration.isMultiChartGridLine != undefined)
8745
+ // return baseClass + ' lib-xlabel-weeklyCharts';
8746
+ // return baseClass + ' lib-axis-waterfall-label';
8747
+ // })
8748
+ // .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
8749
+ // .attr(
8750
+ // 'transform',
8751
+ // 'translate(' + width / 2 + ' ,' + xPosition + ')'
8752
+ // )
8753
+ // .style('text-anchor', 'middle')
8754
+ // .style('fill', 'var(--chart-text-color)')
8755
+ // .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
8756
+ // .style('text-transform', isAcr ? 'none' : 'capitalize');
8757
+ // }
8758
+ // if (metaData.lineyLabel) {
8759
+ // svgYAxisRight
8760
+ // .append('text')
8761
+ // .attr('class', 'lib-axis-group-label lib-line-axis')
8762
+ // .attr('fill', 'var(--chart-text-color)')
8763
+ // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8764
+ // .attr('transform', 'translate(0,0) rotate(90)')
8765
+ // .attr('y', 0 - 100)
8766
+ // .attr('x', 0 + 100)
8767
+ // .attr('dy', '5em')
8768
+ // .style('text-anchor', 'middle')
8769
+ // .style('font-size', 'smaller')
8770
+ // .text(metaData.lineyLabel);
8771
+ // }
8772
+ // if (lineData) {
8773
+ // svg
8774
+ // .append('path')
8775
+ // .datum(lineData)
8776
+ // .attr('fill', 'none')
8777
+ // .attr('stroke', self.chartConfiguration.lineGraphColor)
8778
+ // .attr('stroke-width', 1.5)
8779
+ // .attr(
8780
+ // 'd',
8781
+ // d3
8782
+ // .line()
8783
+ // .x(function (d) {
8784
+ // return x(d.name) + x.bandwidth() / 2;
8785
+ // })
8786
+ // .y(function (d) {
8787
+ // return lineYscale(d.value);
8788
+ // })
8789
+ // );
8790
+ // var dot = svg
8791
+ // .selectAll('myCircles')
8792
+ // .data(lineData)
8793
+ // .enter()
8794
+ // .append('g')
8795
+ // .on('click', function (d) {
8796
+ // if (
8797
+ // !metaData.barWithoutClick ||
8798
+ // !metaData.barWithoutClick.length ||
8799
+ // (!metaData.barWithoutClick.includes(d?.name) &&
8800
+ // !metaData.barWithoutClick.includes(d?.key))
8801
+ // )
8802
+ // self.handleClick(d);
8803
+ // });
8804
+ // dot
8805
+ // .append('circle')
8806
+ // .attr('fill', function (d) {
8807
+ // return self.chartConfiguration.lineGraphColor;
8808
+ // })
8809
+ // .attr('stroke', 'none')
8810
+ // .attr('cx', function (d) {
8811
+ // return x(d.name) + x.bandwidth() / 2;
8812
+ // })
8813
+ // .attr('cy', function (d) {
8814
+ // return lineYscale(d.value);
8815
+ // })
8816
+ // .style('cursor', () =>
8817
+ // self.chartData.metaData.hasDrillDown ? 'pointer' : 'default'
8818
+ // )
8819
+ // .attr('r', 3);
8820
+ // if (self.chartConfiguration.lineGraphColor) {
8821
+ // dot
8822
+ // .append('text')
8823
+ // .attr('class', 'dot')
8824
+ // .attr('fill', 'var(--chart-text-color)')
8825
+ // .attr('color', self.chartConfiguration.lineGraphColor)
8826
+ // .attr('style', 'font-size: ' + '.85em')
8827
+ // .attr('x', function (d, i) {
8828
+ // return x(d.name) + x.bandwidth() / 2;
8829
+ // })
8830
+ // .attr('y', function (d) {
8831
+ // return lineYscale(d.value);
8832
+ // })
8833
+ // .attr('dy', '-1em')
8834
+ // .text(function (d) {
8835
+ // return self.chartConfiguration.labelFormatter(d.value);
8836
+ // });
8837
+ // }
8838
+ // }
8839
+ // }
7628
8840
  initializegroupChart() {
7629
8841
  // ==================== VARIABLE DECLARATIONS ====================
7630
8842
  const self = this;
@@ -7735,7 +8947,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7735
8947
  .domain(groups)
7736
8948
  .range([0, width - RIGHT_SVG_WIDTH]);
7737
8949
  // ==================== X-AXIS RENDERING ====================
7738
- this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile, isTablet);
8950
+ this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile);
7739
8951
  // ==================== Y-AXIS SETUP ====================
7740
8952
  const y = d3.scaleLinear().rangeRound([height, 0]);
7741
8953
  let maxValue = this.calculateMaxValue(data, keyList);
@@ -7786,18 +8998,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7786
8998
  }
7787
8999
  }
7788
9000
  // ==================== HELPER METHODS ====================
7789
- renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile, isTablet) {
9001
+ renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile) {
7790
9002
  let alternate_text = false;
7791
9003
  if (this.chartConfiguration.isMultiChartGridLine === undefined) {
7792
9004
  // 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
9005
  svg.append('g')
7799
9006
  .attr('class', 'x1 axis1')
7800
- .attr('transform', `translate(0,${translateY})`)
9007
+ .attr('transform', `translate(0,${height})`)
7801
9008
  .call(d3.axisBottom(x))
7802
9009
  .call((g) => g.select('.domain').remove());
7803
9010
  svg.selectAll('g.x1.axis1 g.tick line').remove();
@@ -7857,7 +9064,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7857
9064
  .attr('x', 5)
7858
9065
  .style('text-anchor', 'middle');
7859
9066
  }
7860
- // Mobile/tablet override - check for single-group date charts first
9067
+ // Mobile override - check for single-group date charts first
7861
9068
  if (isMobile) {
7862
9069
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
7863
9070
  const groupsCount = data.length || 0;
@@ -7871,14 +9078,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7871
9078
  hasDateValues = true;
7872
9079
  }
7873
9080
  });
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
9081
+ if (hasDateValues && subgroups && subgroups.length < 3) {
9082
+ // For single chart with dates, ensure horizontal display
7882
9083
  textNodes
7883
9084
  .style('writing-mode', 'horizontal-tb') // Explicitly set horizontal
7884
9085
  .classed('mobile-xaxis-override', false) // Remove vertical class
@@ -7888,19 +9089,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7888
9089
  .attr('dx', '0') // Reset any x offset
7889
9090
  .attr('dy', '0'); // Reset any y offset
7890
9091
  }
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
9092
  else if (!this.isHeaderVisible) {
7901
9093
  // Default mobile behavior for non-date or multi-group
7902
9094
  textNodes.classed('mobile-xaxis-override', true);
7903
9095
  }
9096
+ // If there are many groups on mobile, rotate labels to sideways to
9097
+ // avoid overlapping and make them readable. Use a lower threshold
9098
+ // (3) so even small mobile screens get rotated labels when needed.
9099
+ if (groupsCount > 3) {
9100
+ svg.selectAll('g.x1.axis1 g.tick text')
9101
+ .style('writing-mode', 'sideways-lr')
9102
+ .style('text-anchor', 'middle')
9103
+ .attr('y', 0);
9104
+ }
7904
9105
  }
7905
9106
  }
7906
9107
  applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
@@ -7965,49 +9166,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7965
9166
  return baseY;
7966
9167
  }
7967
9168
  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
9169
+ // Mobile handling: keep date labels intact for single-series charts (do not trim)
7988
9170
  if (isMobile) {
7989
- // If header is hidden (compact mobile)
9171
+ const isDateLabel = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(d) || !isNaN(Date.parse(d));
9172
+ if (isDateLabel && subgroups && subgroups.length < 3) {
9173
+ // For single-series charts on mobile, show full date labels (no trimming)
9174
+ return d;
9175
+ }
9176
+ // If header is hidden (compact mobile), trim non-date labels as before
7990
9177
  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
9178
  const firstPart = d.split(/[\s\-]+/)[0];
8012
9179
  return firstPart.substring(0, 3).toLowerCase();
8013
9180
  }
@@ -8023,15 +9190,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8023
9190
  if (dateRangeRegex.test(d.trim())) {
8024
9191
  return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
8025
9192
  }
8026
- // Handle splitting of multi-part labels
9193
+ // Split date and week labels into two lines
9194
+ const isDateLabel = /\d{2,4}[-\/]/.test(d);
9195
+ const isWeekLabel = /week|wk|w\d+/i.test(d);
8027
9196
  if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 &&
8028
- d.indexOf(' ') > -1 && (labelInfo.isDate || labelInfo.isWeek)) {
9197
+ d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
8029
9198
  const first = d.substring(0, d.indexOf(' '));
8030
9199
  const second = d.substring(d.indexOf(' ') + 1).trim();
8031
9200
  return `${first}\n${second}`;
8032
9201
  }
8033
9202
  // Handle date labels in minimized view
8034
- if (labelInfo.isDate) {
9203
+ if (isDateLabel) {
8035
9204
  if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
8036
9205
  const first = d.substring(0, d.indexOf(' '));
8037
9206
  const second = d.substring(d.indexOf(' ') + 1).trim();
@@ -8630,7 +9799,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8630
9799
  // Minimum width per bar group based on device and number of subgroups
8631
9800
  const minWidthPerGroup = (() => {
8632
9801
  if (subgroupsCount > 2) {
8633
- return isMobile ? 100 : isTablet ? 100 : 120; // Wider for multiple subgroups
9802
+ return isMobile ? 80 : isTablet ? 100 : 120; // Wider for multiple subgroups
8634
9803
  }
8635
9804
  return isMobile ? 40 : isTablet ? 60 : 80; // Normal width for 1-2 subgroups
8636
9805
  })();