axidio-styleguide-library1-v2 0.3.4 → 0.3.6

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,9 +6488,11 @@ 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
- 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)
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
6494
6496
  ZOOM_THRESHOLD: 30,
6495
6497
  ZOOM_IN_THRESHOLD: 8,
6496
6498
  };
@@ -6555,6 +6557,48 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6555
6557
  removeExistingChart() {
6556
6558
  d3.select('#' + this.uniqueId).remove();
6557
6559
  }
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
+ }
6558
6602
  mergeConfigurations() {
6559
6603
  for (const key in this.defaultConfiguration) {
6560
6604
  this.chartConfiguration[key] = ChartHelper.getValueByConfigurationType(key, this.defaultConfiguration, this.customChartConfiguration);
@@ -6573,20 +6617,26 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6573
6617
  }
6574
6618
  return metaData;
6575
6619
  }
6576
- calculateDimensions(chartContainer, verticalContainer, margin, dataLength) {
6620
+ calculateDimensions(chartContainer, verticalContainer, margin, device, dataLength) {
6577
6621
  const containerWidth = chartContainer.node().getBoundingClientRect().width;
6578
6622
  const containerHeight = verticalContainer.node().getBoundingClientRect().height;
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;
6623
+ let width = containerWidth - margin.left - margin.right;
6583
6624
  let height = containerHeight * (this.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
6625
+ // Responsive zoom handling
6584
6626
  if (dataLength > this.CONSTANTS.ZOOM_THRESHOLD && this.isZoomedOut) {
6585
- const minWidth = dataLength * 25;
6627
+ const minWidth = device.isMobile
6628
+ ? dataLength * 12
6629
+ : device.isTablet
6630
+ ? dataLength * 20
6631
+ : dataLength * 25;
6586
6632
  width = Math.max(width, minWidth);
6587
6633
  }
6588
6634
  if (dataLength > this.CONSTANTS.ZOOM_IN_THRESHOLD && !this.isZoomedOut) {
6589
- width = dataLength * 130;
6635
+ width = device.isMobile
6636
+ ? dataLength * 50
6637
+ : device.isTablet
6638
+ ? dataLength * 90
6639
+ : dataLength * 130;
6590
6640
  }
6591
6641
  if (this.chartConfiguration.isFullScreen) {
6592
6642
  height = this.chartConfiguration.svgHeight !== 80
@@ -6594,41 +6644,28 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6594
6644
  : containerHeight;
6595
6645
  }
6596
6646
  if (this.chartConfiguration.isDrilldownChart) {
6597
- height = containerHeight - margin.top - margin.bottom - 130;
6647
+ const offset = device.isMobile ? 60 : device.isTablet ? 90 : 130;
6648
+ height = containerHeight - margin.top - margin.bottom - offset;
6598
6649
  }
6599
- const isMobileOrTablet = window.innerWidth < 1024;
6600
6650
  let barWidth;
6601
6651
  let barPadding;
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
- }
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);
6623
6663
  }
6624
6664
  else {
6625
- barWidth = this.CONSTANTS.DESKTOP_BAR_WIDTH;
6626
- barPadding = this.CONSTANTS.BAR_GAP;
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;
6627
6668
  }
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);
6632
6669
  return {
6633
6670
  width,
6634
6671
  height,
@@ -6640,64 +6677,39 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6640
6677
  };
6641
6678
  }
6642
6679
  createSvgContainers(chartContainer, dimensions, margin) {
6643
- // Main wrapper
6644
- const chartWrapper = chartContainer
6680
+ const outerContainer = chartContainer
6645
6681
  .append('div')
6646
6682
  .attr('id', this.uniqueId)
6647
- .attr('class', 'chart-wrapper-main')
6648
- .style('position', 'relative')
6683
+ .attr('class', 'outer-container')
6649
6684
  .style('width', '100%')
6650
- .style('height', `${dimensions.height + margin.top + margin.bottom}px`);
6651
- // Left Y-axis - Fixed
6652
- const leftAxisContainer = chartWrapper
6653
- .append('div')
6654
- .attr('class', 'left-axis-container')
6655
- .style('position', 'absolute')
6656
- .style('left', '0')
6657
- .style('top', '0')
6658
- .style('width', '80px')
6659
- .style('height', `${dimensions.height + margin.top + margin.bottom}px`)
6660
- .style('background-color', 'var(--card-bg)')
6661
- .style('z-index', '10');
6662
- const svgYAxisLeft = leftAxisContainer
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
6663
6691
  .append('svg')
6664
6692
  .attr('width', '80')
6665
6693
  .attr('height', dimensions.height + margin.top + margin.bottom)
6694
+ .style('position', 'absolute')
6695
+ .style('left', '0')
6696
+ .style('z-index', 1)
6666
6697
  .append('g')
6667
6698
  .attr('transform', `translate(${margin.left + 10},${margin.top})`);
6668
- // Right Y-axis - Fixed
6669
- const rightAxisContainer = chartWrapper
6670
- .append('div')
6671
- .attr('class', 'right-axis-container')
6672
- .style('position', 'absolute')
6673
- .style('right', '0')
6674
- .style('top', '0')
6675
- .style('width', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`)
6676
- .style('height', `${dimensions.height + margin.top + margin.bottom}px`)
6677
- .style('background-color', 'var(--card-bg)')
6678
- .style('z-index', '10');
6679
- const svgYAxisRight = rightAxisContainer
6699
+ const svgYAxisRight = outerContainer
6680
6700
  .append('svg')
6681
6701
  .attr('width', this.CONSTANTS.RIGHT_SVG_WIDTH)
6682
6702
  .attr('height', dimensions.height + margin.top + margin.bottom)
6703
+ .style('position', 'absolute')
6704
+ .style('right', '2px')
6705
+ .style('z-index', 1)
6683
6706
  .append('g')
6684
6707
  .attr('transform', `translate(0,${margin.top})`);
6685
- // Scrollable middle area
6686
- const scrollableContainer = chartWrapper
6687
- .append('div')
6688
- .attr('class', 'scrollable-chart-container')
6689
- .style('position', 'absolute')
6690
- .style('left', '80px')
6691
- .style('right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`)
6692
- .style('top', '0')
6693
- .style('width', 'auto')
6694
- .style('height', `${dimensions.height + margin.top + margin.bottom}px`)
6695
- .style('overflow-x', 'auto')
6696
- .style('overflow-y', 'hidden');
6697
- const innerContainer = scrollableContainer
6708
+ const innerContainer = outerContainer
6698
6709
  .append('div')
6699
- .attr('class', 'inner-chart-container')
6700
- .style('min-width', '100%');
6710
+ .attr('class', 'inner-container')
6711
+ .style('width', '100%')
6712
+ .style('overflow-x', 'auto');
6701
6713
  const svg = innerContainer
6702
6714
  .append('svg')
6703
6715
  .attr('width', dimensions.requiredSvgWidth)
@@ -6706,25 +6718,21 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6706
6718
  .attr('transform', `translate(0,${margin.top})`);
6707
6719
  return { svg, svgYAxisLeft, svgYAxisRight, innerContainer };
6708
6720
  }
6709
- createScales(data, layers, lineData, dimensions) {
6721
+ createScales(data, layers, lineData, dimensions, device) {
6710
6722
  const { width, height, barWidth, barPadding } = dimensions;
6711
- // Calculate bar positioning
6712
- const totalBarsWidth = data.length * barWidth;
6713
- const totalSpacing = (data.length - 1) * barPadding;
6714
- const requiredWidth = totalBarsWidth + totalSpacing + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
6715
- const effectiveWidth = Math.max(width, requiredWidth);
6716
- const paddingRatio = barPadding / (barWidth + barPadding);
6717
- // X-scale starts from 0 (no left spacing for grid alignment)
6723
+ // Adjust padding based on device
6724
+ const padding = device.isMobile ? 0.15 : device.isTablet ? 0.3 : 0.5;
6718
6725
  const xScale = d3
6719
6726
  .scaleBand()
6720
- .rangeRound([0, dimensions.requiredSvgWidth]) // Full width from 0
6727
+ .rangeRound([
6728
+ this.CONSTANTS.LEFT_RIGHT_SPACES,
6729
+ width - this.CONSTANTS.RIGHT_SVG_WIDTH - this.CONSTANTS.LEFT_RIGHT_SPACES
6730
+ ])
6721
6731
  .domain(data.map(d => d.name).reverse())
6722
- .paddingInner(paddingRatio)
6723
- .paddingOuter(0.5)
6724
- .align(0.5);
6732
+ .padding(padding);
6725
6733
  const xScaleFromOrigin = d3
6726
6734
  .scaleBand()
6727
- .rangeRound([width, 0])
6735
+ .rangeRound([width - this.CONSTANTS.RIGHT_SVG_WIDTH, 0])
6728
6736
  .domain(data.map(d => d.name).reverse());
6729
6737
  const yScale = d3.scaleLinear().rangeRound([height, 0]);
6730
6738
  let maxValue = d3.max(layers, (d) => d3.max(d, (d) => d[1]));
@@ -6770,7 +6778,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6770
6778
  }
6771
6779
  return { xAxis, yAxis, yLineAxis };
6772
6780
  }
6773
- renderBars(svg, layers, scales, metaData, dimensions) {
6781
+ renderBars(svg, layers, scales, metaData, dimensions, device) {
6774
6782
  const layer = svg
6775
6783
  .selectAll('.layer')
6776
6784
  .data(layers)
@@ -6782,11 +6790,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6782
6790
  .selectAll('rect')
6783
6791
  .data((d) => d)
6784
6792
  .enter();
6785
- this.appendRectangles(rect, scales, metaData, dimensions);
6793
+ this.appendRectangles(rect, scales, metaData, dimensions, device);
6786
6794
  this.addInteractions(rect, svg, metaData, scales);
6787
6795
  return rect;
6788
6796
  }
6789
- appendRectangles(rect, scales, metaData, dimensions) {
6797
+ appendRectangles(rect, scales, metaData, dimensions, device) {
6790
6798
  const { barWidth, barPadding } = dimensions;
6791
6799
  const { xScale, yScale } = scales;
6792
6800
  rect
@@ -6805,17 +6813,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6805
6813
  }
6806
6814
  return 0;
6807
6815
  })
6808
- .attr('x', (d) => {
6809
- const xPosition = xScale(d.data.name);
6810
- const bandwidth = xScale.bandwidth();
6816
+ .attr('x', (d, i) => {
6817
+ if (device.isMobile) {
6818
+ return this.CONSTANTS.LEFT_RIGHT_SPACES + i * (barWidth + barPadding);
6819
+ }
6811
6820
  if (!this.chartConfiguration.isMultiChartGridLine) {
6812
- return xPosition + (bandwidth - barWidth) / 2;
6821
+ return xScale(d.data.name);
6813
6822
  }
6814
6823
  if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
6815
- return xPosition + bandwidth / 2 - 35;
6824
+ return xScale(d.data.name) + xScale.bandwidth() / 2 - 35;
6816
6825
  }
6817
- const calculatedWidth = bandwidth * 0.8;
6818
- return xPosition + (bandwidth - calculatedWidth) / 2;
6826
+ return xScale(d.data.name) + xScale.bandwidth() * 0.1;
6819
6827
  })
6820
6828
  .attr('height', (d) => {
6821
6829
  if (!isNaN(d[0]) && !isNaN(d[1])) {
@@ -6825,8 +6833,10 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6825
6833
  return 0;
6826
6834
  })
6827
6835
  .attr('width', (d) => {
6828
- if (!this.chartConfiguration.isMultiChartGridLine)
6836
+ if (device.isMobile)
6829
6837
  return barWidth;
6838
+ if (!this.chartConfiguration.isMultiChartGridLine)
6839
+ return xScale.bandwidth();
6830
6840
  if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
6831
6841
  return 70;
6832
6842
  }
@@ -6882,13 +6892,23 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
6882
6892
  const value = d[1] - d[0];
6883
6893
  if (isNaN(value))
6884
6894
  return;
6895
+ const device = this.getDeviceConfig();
6885
6896
  const bandwidth = xScale.bandwidth();
6886
- // Fixed tooltip width for all resolutions
6887
- const width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
6888
- ? '250px'
6889
- : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
6890
- ? '180px'
6891
- : bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
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
+ }
6892
6912
  svg
6893
6913
  .append('foreignObject')
6894
6914
  .attr('x', this.calculateTooltipX(d, xScale, width))
@@ -7006,10 +7026,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7006
7026
  }
7007
7027
  }
7008
7028
  initializeStackedChart() {
7009
- // Use fixed configuration for all resolutions
7010
- this.chartConfiguration.margin = { top: 20, right: 20, bottom: 40, left: 40 };
7011
- this.chartConfiguration.numberOfYTicks = 5;
7012
- this.chartConfiguration.svgHeight = 70;
7029
+ const device = this.getDeviceConfig();
7030
+ this.configureResponsiveSettings(device);
7013
7031
  this.mergeConfigurations();
7014
7032
  this.applyConfigurationFlags();
7015
7033
  const data = this.chartData.data;
@@ -7020,16 +7038,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7020
7038
  const chartContainer = d3.select(this.containerElt.nativeElement);
7021
7039
  const verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
7022
7040
  const margin = this.chartConfiguration.margin;
7023
- const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, data.length);
7041
+ const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, device, data.length);
7024
7042
  const { svg, svgYAxisLeft, svgYAxisRight } = this.createSvgContainers(chartContainer, dimensions, margin);
7025
7043
  const stack = d3.stack().keys(keyList).offset(d3.stackOffsetNone);
7026
7044
  const layers = stack(data);
7027
7045
  data.sort((a, b) => b.total - a.total);
7028
- const scales = this.createScales(data, layers, lineData, dimensions);
7046
+ const scales = this.createScales(data, layers, lineData, dimensions, device);
7029
7047
  const axes = this.createAxes(scales);
7030
7048
  this.renderGrids(svg, scales, dimensions);
7031
- const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
7032
- this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
7049
+ const rect = this.renderBars(svg, layers, scales, metaData, dimensions, device);
7050
+ this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, device, data);
7033
7051
  this.renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin);
7034
7052
  this.renderTargetLine(svg, svgYAxisRight, scales, dimensions, metaData);
7035
7053
  this.renderDataLabels(rect, scales, metaData, dimensions);
@@ -7039,7 +7057,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7039
7057
  if (this.chartConfiguration.isXgridBetweenLabels) {
7040
7058
  svg
7041
7059
  .append('g')
7042
- .attr('class', 'grid vertical-grid')
7060
+ .attr('class', 'grid')
7043
7061
  .attr('transform', `translate(${scales.xScale.bandwidth() / 2},${dimensions.height})`)
7044
7062
  .call(d3.axisBottom(scales.xScale).tickSize(-dimensions.height).tickFormat(''))
7045
7063
  .style('stroke-dasharray', '5 5')
@@ -7047,22 +7065,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7047
7065
  .call((g) => g.select('.domain').remove());
7048
7066
  }
7049
7067
  if (this.chartConfiguration.yAxisGrid) {
7050
- // Grid lines start from x=0 (no gap with Y-axis)
7051
- const gridWidth = dimensions.requiredSvgWidth;
7052
7068
  svg
7053
7069
  .append('g')
7054
- .attr('class', 'grid horizontal-grid')
7055
- .attr('transform', 'translate(0,0)') // Start from x=0
7070
+ .attr('class', 'grid')
7056
7071
  .call(d3
7057
7072
  .axisLeft(scales.yScale)
7058
7073
  .ticks(this.chartConfiguration.numberOfYTicks)
7059
- .tickSize(-gridWidth)
7074
+ .tickSize(-dimensions.width)
7060
7075
  .tickFormat(''))
7061
7076
  .style('color', 'var(--chart-grid-color)')
7062
- .style('opacity', '1')
7063
- .call((g) => {
7064
- g.select('.domain').remove();
7065
- });
7077
+ .style('opacity', '1');
7066
7078
  }
7067
7079
  if (this.chartConfiguration.xAxisGrid) {
7068
7080
  for (let j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
@@ -7076,7 +7088,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7076
7088
  }
7077
7089
  }
7078
7090
  }
7079
- renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data) {
7091
+ renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, device, data) {
7080
7092
  if (this.chartConfiguration.showXaxisTop) {
7081
7093
  svg
7082
7094
  .append('g')
@@ -7086,7 +7098,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7086
7098
  svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
7087
7099
  }
7088
7100
  if (!this.chartConfiguration.isMultiChartGridLine) {
7089
- this.renderStandardAxes(svg, axes, scales, dimensions, data);
7101
+ this.renderStandardAxes(svg, axes, scales, dimensions, device, data);
7090
7102
  }
7091
7103
  else if (this.chartConfiguration.isDrilldownChart) {
7092
7104
  this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions);
@@ -7097,34 +7109,24 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7097
7109
  this.applyAxisStyling(svg, svgYAxisLeft, svgYAxisRight);
7098
7110
  this.applyAxisConfigurations(svg, scales, dimensions, data);
7099
7111
  }
7100
- renderStandardAxes(svg, axes, scales, dimensions, data) {
7101
- const isMobileOrTablet = window.innerWidth < 1024;
7102
- // X-axis with labels
7103
- const xAxisGroup = svg
7104
- .append('g')
7105
- .attr('transform', `translate(0,${dimensions.height})`)
7106
- .attr('class', 'lib-stacked-x-axis-text')
7107
- .call(axes.xAxis);
7108
- // Style X-axis labels
7109
- xAxisGroup
7110
- .selectAll('text')
7111
- .style('fill', 'var(--chart-text-color)')
7112
- .style('font-size', isMobileOrTablet ? '10px' : '12px')
7113
- .attr('text-anchor', 'middle')
7114
- .attr('dy', '1em')
7115
- .each(function (d) {
7116
- const textElement = d3.select(this);
7117
- const text = textElement.text();
7118
- if (isMobileOrTablet && text.length > 12) {
7119
- textElement.text(text.substring(0, 10) + '...');
7120
- }
7121
- });
7122
- // Ensure X-axis line is visible
7123
- xAxisGroup
7124
- .select('.domain')
7125
- .style('stroke', 'var(--chart-axis-color)')
7126
- .style('stroke-width', '1px');
7127
- // Y-axis
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
+ }
7128
7130
  svg
7129
7131
  .append('g')
7130
7132
  .attr('class', 'lib-stacked-y-axis-text')
@@ -7133,6 +7135,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7133
7135
  .selectAll('text')
7134
7136
  .style('fill', 'var(--chart-text-color)');
7135
7137
  }
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
+ }
7136
7159
  renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions) {
7137
7160
  svg
7138
7161
  .append('g')
@@ -7214,6 +7237,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7214
7237
  }
7215
7238
  }
7216
7239
  renderCustomXAxis(svg, scales, dimensions, data) {
7240
+ const device = this.getDeviceConfig();
7217
7241
  svg
7218
7242
  .append('g')
7219
7243
  .attr('class', 'x1 axis1')
@@ -7221,12 +7245,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7221
7245
  .style('color', '#000')
7222
7246
  .call(d3.axisBottom(scales.xScale).tickSize(0))
7223
7247
  .call((g) => g.select('.domain').attr('fill', 'none'));
7224
- this.styleCustomXAxisTicks(svg, data);
7248
+ this.styleCustomXAxisTicks(svg, data, device);
7225
7249
  if (this.chartConfiguration.xLabelsOnSameLine) {
7226
- this.applyXLabelsOnSameLine(svg);
7250
+ this.applyXLabelsOnSameLine(svg, device);
7227
7251
  }
7228
7252
  }
7229
- styleCustomXAxisTicks(svg, data) {
7253
+ styleCustomXAxisTicks(svg, data, device) {
7230
7254
  let alternateText = false;
7231
7255
  svg.selectAll('.x1.axis1 .tick line').attr('y2', () => {
7232
7256
  if (this.chartConfiguration.hideXaxisTick)
@@ -7258,17 +7282,28 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7258
7282
  return this.CONSTANTS.SHORT_TICK_LENGTH_BG;
7259
7283
  });
7260
7284
  }
7261
- applyXLabelsOnSameLine(svg) {
7285
+ applyXLabelsOnSameLine(svg, device) {
7262
7286
  svg
7263
7287
  .selectAll('g.x1.axis1 g.tick text')
7264
7288
  .attr('class', 'lib-xaxis-labels-texts-drilldown')
7265
7289
  .attr('y', this.CONSTANTS.SHORT_TICK_LENGTH_BG)
7266
7290
  .text((d) => {
7291
+ if (device.isMobile) {
7292
+ return d.split(' ')[0].substring(0, 3);
7293
+ }
7267
7294
  const trimmed = d.trim();
7268
7295
  const spaceIndex = trimmed.indexOf(' ');
7269
7296
  return spaceIndex > -1
7270
7297
  ? trimmed.substring(0, spaceIndex).toLowerCase()
7271
7298
  : 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;
7272
7307
  });
7273
7308
  svg
7274
7309
  .selectAll('g.x1.axis1 g.tick')
@@ -7277,11 +7312,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7277
7312
  .attr('y', this.CONSTANTS.LONG_TICK_LENGTH_BG)
7278
7313
  .attr('fill', 'currentColor')
7279
7314
  .text((d) => {
7315
+ if (device.isMobile)
7316
+ return '';
7280
7317
  const trimmed = d.trim();
7281
7318
  const spaceIndex = trimmed.indexOf(' ');
7282
7319
  return spaceIndex > -1
7283
7320
  ? trimmed.substring(spaceIndex).toLowerCase()
7284
7321
  : '';
7322
+ })
7323
+ .attr('transform', (d, i) => {
7324
+ return device.isMobile && i === 0 ? 'translate(20,0)' : null;
7285
7325
  });
7286
7326
  }
7287
7327
  renderDataLabels(rect, scales, metaData, dimensions) {
@@ -7472,11 +7512,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
7472
7512
  this.isZoomOutSelected(isZoomOut);
7473
7513
  }
7474
7514
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
7475
- 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 }); }
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 }); }
7476
7516
  }
7477
7517
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
7478
7518
  type: Component,
7479
- 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"] }]
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"] }]
7480
7520
  }], ctorParameters: () => [], propDecorators: { containerElt: [{
7481
7521
  type: ViewChild,
7482
7522
  args: ['verticalstackedchartcontainer', { static: true }]
@@ -7585,1242 +7625,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7585
7625
  get isAlertEnabled() {
7586
7626
  return this.chartConfiguration?.headerMenuOptions?.some((option) => option.id === 'editAlert');
7587
7627
  }
7588
- // initializegroupChart() {
7589
- // var self = this;
7590
- // let data = [];
7591
- // let metaData: any = null;
7592
- // let keyList = null;
7593
- // let lineData = null;
7594
- // let colorMap = {};
7595
- // var formatFromBackend;
7596
- // var formatForHugeNumbers;
7597
- // const isMobile = window.innerWidth < 576;
7598
- // const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
7599
- // const isDesktop = window.innerWidth >= 992;
7600
- // let isria = this.customChartConfiguration.isRia
7601
- // var x: any;
7602
- // var alternate_text = false;
7603
- // var short_tick_length = 4;
7604
- // var long_tick_length = 16;
7605
- // /**
7606
- // * longer tick length needed for weekly charts
7607
- // */
7608
- // var short_tick_length_bg = 5;
7609
- // var long_tick_length_bg = 30;
7610
- // var leftAndRightSpaces = 50;
7611
- // var rightSvgWidth = 60;
7612
- // var tempScale;
7613
- // for (var i in this.defaultConfiguration) {
7614
- // this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(
7615
- // i,
7616
- // this.defaultConfiguration,
7617
- // this.customChartConfiguration
7618
- // );
7619
- // }
7620
- // data = this.chartData.data;
7621
- // metaData = this.chartData.metaData;
7622
- // lineData = this.chartData.lineData;
7623
- // // if (lineData || this.chartData.targetLineData) {
7624
- // // rightSvgWidth = 60;
7625
- // // }
7626
- // if (!metaData.colorAboveTarget) {
7627
- // metaData['colorAboveTarget'] = metaData.colors;
7628
- // }
7629
- // colorMap = metaData.colors;
7630
- // keyList = metaData.keyList;
7631
- // var chartContainer = d3.select(this.containerElt.nativeElement);
7632
- // var verticalstackedcontainer = d3.select(
7633
- // this.groupcontainerElt.nativeElement
7634
- // );
7635
- // var margin = this.chartConfiguration.margin;
7636
- // const { width, height } = this.calculateChartDimensions(
7637
- // chartContainer,
7638
- // verticalstackedcontainer,
7639
- // margin,
7640
- // self
7641
- // );
7642
- // /**
7643
- // * for hiding header
7644
- // * used by weekly charts
7645
- // */
7646
- // if (this.chartConfiguration.isHeaderVisible != undefined)
7647
- // this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
7648
- // /**
7649
- // * for hiding legends
7650
- // * used by weekly charts
7651
- // */
7652
- // if (this.chartConfiguration.legendVisible != undefined) {
7653
- // this.legendVisible = this.chartConfiguration.legendVisible;
7654
- // }
7655
- // /**
7656
- // * for removing background color so that it can take parents color
7657
- // *
7658
- // */
7659
- // if (this.chartConfiguration.isTransparentBackground != undefined) {
7660
- // this.isTransparentBackground =
7661
- // this.chartConfiguration.isTransparentBackground;
7662
- // }
7663
- // /**
7664
- // * format data values based on configuration received
7665
- // */
7666
- // if (this.chartConfiguration.textFormatter != undefined) {
7667
- // formatFromBackend = ChartHelper.dataValueFormatter(
7668
- // this.chartConfiguration.textFormatter
7669
- // );
7670
- // formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
7671
- // }
7672
- // const {
7673
- // outerContainer,
7674
- // svgYAxisLeft,
7675
- // svgYAxisRight,
7676
- // innerContainer,
7677
- // svg
7678
- // } = this.createChartContainers(chartContainer, margin, height, rightSvgWidth, self, width);
7679
- // var subgroups: any = keyList;
7680
- // var groups = d3
7681
- // .map(data, function (d) {
7682
- // return d.name;
7683
- // })
7684
- // .keys();
7685
- // /**
7686
- // * x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
7687
- // */
7688
- // if (this.chartConfiguration.isMultiChartGridLine != undefined) {
7689
- // x = d3
7690
- // .scaleBand()
7691
- // .rangeRound([width, 0])
7692
- // .align(0.5)
7693
- // .padding([0.5])
7694
- // .domain(
7695
- // data.map(function (d: any) {
7696
- // return d.name.toLowerCase();
7697
- // })
7698
- // );
7699
- // } else {
7700
- // x = d3
7701
- // .scaleBand()
7702
- // .domain(groups)
7703
- // .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
7704
- // .padding([0.3]);
7705
- // }
7706
- // // x.bandwidth(96);
7707
- // var xScaleFromOrigin = d3
7708
- // .scaleBand()
7709
- // .domain(groups)
7710
- // .range([0, width - rightSvgWidth]);
7711
- // // .padding([0.2]);
7712
- // if (this.chartConfiguration.isMultiChartGridLine == undefined) {
7713
- // /**
7714
- // * normal ticks for all dashboard charts
7715
- // */
7716
- // svg
7717
- // .append('g')
7718
- // .attr('class', 'x1 axis1')
7719
- // .attr('transform', 'translate(0,' + height + ')')
7720
- // .call(d3.axisBottom(x))
7721
- // .call((g) => g.select('.domain').remove());
7722
- // svg.selectAll('g.x1.axis1 g.tick line').remove();
7723
- // // Only move x-axis labels further down for grouped charts if there is no xLabel
7724
- // if (subgroups.length > 1 && !metaData.xLabel) {
7725
- // svg
7726
- // .selectAll('g.x1.axis1 g.tick text')
7727
- // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7728
- // .style('fill', 'var(--chart-text-color)')
7729
- // .attr('y', 32); // Increase distance from bars (default is ~9)
7730
- // } else {
7731
- // svg
7732
- // .selectAll('g.x1.axis1 g.tick text')
7733
- // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7734
- // .style('fill', 'var(--chart-text-color)');
7735
- // }
7736
- // }
7737
- // else {
7738
- // /**
7739
- // * bigger ticks for weekly charts and more space from x axis to labels
7740
- // */
7741
- // /**
7742
- // * draw x axis
7743
- // */
7744
- // svg
7745
- // .append('g')
7746
- // .attr('class', 'x1 axis1')
7747
- // .attr('transform', 'translate(0,' + height + ')')
7748
- // .call(d3.axisBottom(x).tickSize(0))
7749
- // .call((g) => g.select('.domain').attr('fill', 'none'));
7750
- // /**
7751
- // * tick line size in alternate fashion
7752
- // */
7753
- // svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
7754
- // if (
7755
- // alternate_text &&
7756
- // self.chartConfiguration.isNoAlternateXaxisText == undefined
7757
- // ) {
7758
- // alternate_text = false;
7759
- // return long_tick_length_bg - 7;
7760
- // } else {
7761
- // alternate_text = true;
7762
- // return short_tick_length_bg - 4;
7763
- // }
7764
- // });
7765
- // /**
7766
- // * reset the flag so that values can be shown in same alternate fashion
7767
- // */
7768
- // alternate_text = false;
7769
- // /**
7770
- // * print x-axis label texts
7771
- // * used by weekly charts
7772
- // */
7773
- // svg
7774
- // .selectAll('g.x1.axis1 g.tick text')
7775
- // .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
7776
- // .attr('y', function () {
7777
- // // Minimize gap in maximized (fullscreen) view for weekly charts
7778
- // if (self.chartConfiguration.isFullScreen) {
7779
- // return short_tick_length_bg;
7780
- // }
7781
- // if (alternate_text) {
7782
- // alternate_text = false;
7783
- // return long_tick_length_bg;
7784
- // } else {
7785
- // alternate_text = true;
7786
- // return short_tick_length_bg;
7787
- // }
7788
- // });
7789
- // }
7790
- // if (self.chartConfiguration.xLabelsOnSameLine) {
7791
- // const xAxisLabels = svg
7792
- // .selectAll('g.x1.axis1 g.tick text')
7793
- // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7794
- // .style('font-size', this.isHeaderVisible ? '18px' : '14px')
7795
- // .attr('text-anchor', 'middle')
7796
- // .attr('y', function(d) {
7797
- // // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
7798
- // if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
7799
- // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7800
- // if (self.chartConfiguration.isFullScreen) {
7801
- // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7802
- // }
7803
- // return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
7804
- // }
7805
- // // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
7806
- // if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
7807
- // const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
7808
- // if (self.chartConfiguration.isFullScreen) {
7809
- // // Reduce extra gap in maximized view
7810
- // return short_tick_length_bg + 2;
7811
- // }
7812
- // return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
7813
- // }
7814
- // // Default/fallback logic for other cases
7815
- // let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
7816
- // if (
7817
- // subgroups.length > 1 &&
7818
- // !metaData.xLabel &&
7819
- // (/\d{2,4}[-\/]\d{2}[-\/]\d{2,4}/.test(d) || /\d{2,4}[-\/]\d{2,4}/.test(d))
7820
- // ) {
7821
- // baseY = self.isHeaderVisible ? short_tick_length_bg + 15 : short_tick_length_bg + 25;
7822
- // }
7823
- // if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
7824
- // baseY += 4;
7825
- // }
7826
- // // In maximized view, reduce baseY slightly for grouped bars
7827
- // if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
7828
- // baseY = Math.max(short_tick_length_bg, baseY - 10);
7829
- // }
7830
- // return baseY;
7831
- // })
7832
- // .attr('x', function (d) {
7833
- // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7834
- // return 1; // Move first line text slightly to the left in zoom-in view for better alignment
7835
- // }
7836
- // return 0; // Default position
7837
- // })
7838
- // .text(function (d) {
7839
- // var isValueToBeIgnored = false;
7840
- // if (isMobile && !self.isHeaderVisible) {
7841
- // let firstPart = d.split(/[\s\-]+/)[0];
7842
- // return firstPart.substring(0, 3).toLowerCase();
7843
- // }
7844
- // (data as any[]).map((indiv: any) => {
7845
- // if (
7846
- // indiv.name &&
7847
- // indiv.name.toLowerCase() == d.trim().toLowerCase() &&
7848
- // indiv[metaData.keyList[0]] == -1
7849
- // ) {
7850
- // isValueToBeIgnored = true;
7851
- // }
7852
- // });
7853
- // if (isValueToBeIgnored) {
7854
- // return '';
7855
- // }
7856
- // // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
7857
- // // Apply for grouped bar charts and single bar charts, header visible, single line
7858
- // const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
7859
- // if (dateRangeRegex.test(d.trim())) {
7860
- // return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
7861
- // }
7862
- // // Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
7863
- // const isDateLabel = /\d{2,4}[-\/]/.test(d);
7864
- // const isWeekLabel = /week|wk|w\d+/i.test(d);
7865
- // if (
7866
- // subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)
7867
- // ) {
7868
- // var first = d.substring(0, d.indexOf(' '));
7869
- // var second = d.substring(d.indexOf(' ') + 1).trim();
7870
- // return first + '\n' + second;
7871
- // }
7872
- // // Also keep previous logic for minimized view
7873
- // if (isDateLabel) {
7874
- // if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
7875
- // var first = d.substring(0, d.indexOf(' '));
7876
- // var second = d.substring(d.indexOf(' ') + 1).trim();
7877
- // return first + '\n' + second;
7878
- // } else {
7879
- // return d;
7880
- // }
7881
- // }
7882
- // if (d.trim().indexOf(' ') > -1) {
7883
- // return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
7884
- // }
7885
- // return d.toLowerCase();
7886
- // // If label looks like a date (contains digits and - or /)
7887
- // const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
7888
- // // Only split date/week labels if there are many grouped bars and header is not visible
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
- // });
7903
- // // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
7904
- // xAxisLabels.each(function(this: SVGTextElement, d: any) {
7905
- // // Only apply writing-mode for exact date labels, not those containing 'week' or similar
7906
- // const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
7907
- // const isWeekLabel = /week|wk|w\d+/i.test(d);
7908
- // if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
7909
- // d3.select(this).style('writing-mode', 'sideways-lr');
7910
- // }
7911
- // });
7912
- // if (!isMobile) {
7913
- // svg
7914
- // .selectAll('g.x1.axis1 g.tick')
7915
- // .filter(function (d) {
7916
- // return !/\d{2,4}[-\/]/.test(d); // Only process non-date labels
7917
- // })
7918
- // .append('text')
7919
- // .attr('class', 'lib-xaxis-labels-texts-drilldown')
7920
- // .attr('y', long_tick_length_bg)
7921
- // .attr('fill', 'var(--chart-text-color)')
7922
- // .attr('x', function (d) {
7923
- // if (self.chartData.data.length > 8 && !self.isZoomedOut) {
7924
- // return 1; // Move text slightly to the left
7925
- // }
7926
- // return 0; // Default position
7927
- // })
7928
- // .text(function (d) {
7929
- // if (d.trim().indexOf(' ') > -1) {
7930
- // return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
7931
- // }
7932
- // return '';
7933
- // });
7934
- // }
7935
- // }
7936
- // if (isria && self.chartData.data.length > 8) {
7937
- // svg
7938
- // .selectAll('g.x1.axis1 g.tick text')
7939
- // .classed('mobile-xaxis-override', true)
7940
- // .text(function (d: string) {
7941
- // return d.substring(0, 3);
7942
- // })
7943
- // .style('font-size', '12px')
7944
- // .attr('y', 5)
7945
- // .attr('x', 5)
7946
- // .style('text-anchor', 'middle');
7947
- // }
7948
- // if (isMobile && !this.isHeaderVisible) {
7949
- // svg
7950
- // .selectAll('g.x1.axis1 g.tick text')
7951
- // .classed('mobile-xaxis-override', true);
7952
- // }
7953
- // /**y scale for left y axis */
7954
- // var y = d3.scaleLinear().rangeRound([height, 0]);
7955
- // var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
7956
- // if (maxValue == 0) {
7957
- // if (this.chartData.targetLineData) {
7958
- // maxValue = this.chartData.targetLineData.target + 20;
7959
- // } else {
7960
- // maxValue = 100;
7961
- // }
7962
- // }
7963
- // if (this.chartConfiguration.customYscale) {
7964
- // /**
7965
- // * increase y-scale so that values wont cross or exceed out of range
7966
- // * used in weekly charts
7967
- // */
7968
- // maxValue = maxValue * this.chartConfiguration.customYscale;
7969
- // }
7970
- // if (
7971
- // this.chartData.targetLineData &&
7972
- // maxValue < this.chartData.targetLineData.target
7973
- // ) {
7974
- // maxValue =
7975
- // maxValue < 10 && this.chartData.targetLineData.target < 10
7976
- // ? this.chartData.targetLineData.target + 3
7977
- // : this.chartData.targetLineData.target + 20;
7978
- // }
7979
- // y.domain([0, maxValue]).nice();
7980
- // let lineYscale;
7981
- // if (lineData != null) {
7982
- // let maxLineValue = d3.max(lineData, function (d) {
7983
- // return +d.value;
7984
- // });
7985
- // maxLineValue = maxLineValue * this.chartConfiguration.customYscale;
7986
- // let minLineValue = d3.min(lineData, function (d) {
7987
- // return +d.value;
7988
- // });
7989
- // if (maxLineValue > 0) minLineValue = minLineValue - 3;
7990
- // if (minLineValue > 0) {
7991
- // minLineValue = 0;
7992
- // }
7993
- // lineYscale = d3
7994
- // .scaleLinear()
7995
- // .domain([minLineValue, maxLineValue])
7996
- // .range([height, minLineValue]);
7997
- // }
7998
- // let yLineAxis;
7999
- // if (lineYscale != null) {
8000
- // yLineAxis = d3
8001
- // .axisRight(lineYscale)
8002
- // .ticks(self.chartConfiguration.numberOfYTicks)
8003
- // .tickSize(0)
8004
- // .tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
8005
- // }
8006
- // /**
8007
- // * show x-axis grid between labels
8008
- // * used by weekly charts
8009
- // */
8010
- // if (self.chartConfiguration.isXgridBetweenLabels) {
8011
- // svg
8012
- // .append('g')
8013
- // .attr('class', 'grid')
8014
- // .attr(
8015
- // 'transform',
8016
- // 'translate(' + x.bandwidth() / 2 + ',' + height + ')'
8017
- // )
8018
- // .call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
8019
- // .style('stroke-dasharray', '5 5')
8020
- // .style('color', 'var(--chart-grid-color, #999999)') // Use CSS variable
8021
- // .call((g) => g.select('.domain').remove());
8022
- // }
8023
- // if (this.chartConfiguration.yAxisGrid) {
8024
- // svg
8025
- // .append('g')
8026
- // .call(
8027
- // d3
8028
- // .axisLeft(y)
8029
- // .ticks(self.chartConfiguration.numberOfYTicks)
8030
- // .tickSize(-width)
8031
- // )
8032
- // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8033
- // .style('opacity', '0.5')
8034
- // .call((g) => {
8035
- // g.select('.domain')
8036
- // .remove()
8037
- // .style('stroke', 'var(--chart-domain-color, #000000)'); // Add CSS variable for domain
8038
- // });
8039
- // } else {
8040
- // svg
8041
- // .append('g')
8042
- // .call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
8043
- // .style('color', 'var(--chart-axis-color, #B9B9B9)')
8044
- // .style('opacity', '0.5')
8045
- // .call((g) => {
8046
- // g.select('.domain')
8047
- // .style('stroke', 'var(--chart-domain-color, #000000)') // Add CSS variable for domain
8048
- // .style('stroke-width', '1px'); // Ensure visibility
8049
- // });
8050
- // }
8051
- // var xSubgroup = d3.scaleBand().domain(subgroups);
8052
- // if (subgroups.length > 1 && !this.isZoomedOut) {
8053
- // // For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
8054
- // xSubgroup.range([0, x.bandwidth()]);
8055
- // } else if (subgroups.length === 1 && !this.isZoomedOut) {
8056
- // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
8057
- // xSubgroup.range([0, 100]);
8058
- // } else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
8059
- // xSubgroup.range([0, x.bandwidth()]);
8060
- // } else {
8061
- // // used to make grouped bars with lesser width as we are not using padding for width
8062
- // xSubgroup.range([0, x.bandwidth()]);
8063
- // }
8064
- // // if (this.chartConfiguration.isDrilldownChart) {
8065
- // // }
8066
- // var color = d3
8067
- // .scaleOrdinal()
8068
- // .domain(subgroups)
8069
- // .range(Object.values(metaData.colors));
8070
- // // var colorAboveTarget = d3
8071
- // // .scaleOrdinal()
8072
- // // .domain(subgroups)
8073
- // // .range(Object.values(metaData.colorAboveTarget));
8074
- // var state = svg
8075
- // .append('g')
8076
- // .selectAll('.state')
8077
- // .data(data)
8078
- // .enter()
8079
- // .append('g')
8080
- // .attr('transform', function (d) {
8081
- // return 'translate(' + x(d.name) + ',0)';
8082
- // });
8083
- // state
8084
- // .selectAll('rect')
8085
- // .data(function (d) {
8086
- // let newList: any = [];
8087
- // subgroups.map(function (key) {
8088
- // // if (key !== "group") {
8089
- // let obj: any = { key: key, value: d[key], name: d.name };
8090
- // newList.push(obj);
8091
- // // }
8092
- // });
8093
- // return newList;
8094
- // })
8095
- // .enter()
8096
- // .append('rect')
8097
- // .attr('class', 'bars')
8098
- // .on('click', function (d) {
8099
- // if (d.key != 'Target') {
8100
- // if (
8101
- // !metaData.barWithoutClick ||
8102
- // !metaData.barWithoutClick.length ||
8103
- // (!metaData.barWithoutClick.includes(d?.name) &&
8104
- // !metaData.barWithoutClick.includes(d?.key))
8105
- // )
8106
- // // self.handleClick(d.data.name);
8107
- // self.handleClick(d);
8108
- // }
8109
- // })
8110
- // .attr('x', function (d) {
8111
- // if (self.chartConfiguration.isDrilldownChart) {
8112
- // data.map((indiv: any) => {
8113
- // if (indiv.name == d.name) {
8114
- // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8115
- // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8116
- // if (x.bandwidth() > 100) {
8117
- // // Increase bar width a bit in zoom-in view
8118
- // let reducedBarWidth = 60;
8119
- // if (!self.isZoomedOut) {
8120
- // reducedBarWidth = 30;
8121
- // }
8122
- // if (self.chartData.data.length == 1) {
8123
- // if (Object.keys(self.chartData.data[0]).length == 2) {
8124
- // tempScale.range([
8125
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8126
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8127
- // ]);
8128
- // } else
8129
- // tempScale.range([
8130
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8131
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8132
- // ]);
8133
- // } else
8134
- // tempScale.range([
8135
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8136
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8137
- // ]);
8138
- // }
8139
- // }
8140
- // });
8141
- // return tempScale(d.key);
8142
- // }
8143
- // return xSubgroup(d.key);
8144
- // })
8145
- // .attr('y', function (d) {
8146
- // if (d.value == -1) {
8147
- // return y(0);
8148
- // }
8149
- // if (d.value >= 0) {
8150
- // const barHeight = height - y(d.value);
8151
- // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8152
- // return barHeight < minHeight ? y(0) - minHeight : y(d.value);
8153
- // }
8154
- // return y(0);
8155
- // })
8156
- // .attr('width', function (d) {
8157
- // // For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
8158
- // if (subgroups.length > 1 && !self.isZoomedOut) {
8159
- // return 50;
8160
- // }
8161
- // // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
8162
- // if (subgroups.length === 1 && !self.isZoomedOut) {
8163
- // return 80;
8164
- // }
8165
- // let tempScale = d3.scaleBand().domain([]).range([0, 0]);
8166
- // // Default logic for other chart types
8167
- // if (self.chartConfiguration.isDrilldownChart) {
8168
- // data.map((indiv: any) => {
8169
- // if (indiv.name == d.name) {
8170
- // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8171
- // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8172
- // if (x.bandwidth() > 100) {
8173
- // // Increase bar width a bit in zoom-in view
8174
- // let reducedBarWidth = 60;
8175
- // if (!self.isZoomedOut) {
8176
- // reducedBarWidth = 100;
8177
- // }
8178
- // if (self.chartData.data.length == 1) {
8179
- // if (Object.keys(self.chartData.data[0]).length == 2) {
8180
- // tempScale.range([
8181
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8182
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8183
- // ]);
8184
- // } else
8185
- // tempScale.range([
8186
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8187
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8188
- // ]);
8189
- // } else
8190
- // tempScale.range([
8191
- // 0 + (x.bandwidth() - reducedBarWidth) / 2,
8192
- // x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
8193
- // ]);
8194
- // }
8195
- // }
8196
- // });
8197
- // return self.isZoomedOut
8198
- // ? tempScale.bandwidth()
8199
- // : self.chartData.data.length && self.chartData.data.length > 8
8200
- // ? tempScale.bandwidth()
8201
- // : tempScale.bandwidth();
8202
- // }
8203
- // return self.isZoomedOut
8204
- // ? tempScale.bandwidth()
8205
- // : self.chartData.data.length && self.chartData.data.length > 8
8206
- // ? tempScale.bandwidth()
8207
- // : tempScale.bandwidth();
8208
- // })
8209
- // .attr('height', function (d) {
8210
- // if (d.value == -1) {
8211
- // return height - y(0);
8212
- // }
8213
- // if (d.value >= 0) {
8214
- // const barHeight = height - y(d.value);
8215
- // const minHeight = self.chartConfiguration.defaultBarHeight || 2;
8216
- // return Math.max(barHeight, minHeight);
8217
- // }
8218
- // return height - y(0);
8219
- // })
8220
- // .style('cursor', function (d) {
8221
- // if (metaData.hasDrillDown && !isria) return 'pointer';
8222
- // else return 'default';
8223
- // })
8224
- // .attr('fill', function (d) {
8225
- // if (
8226
- // d.value &&
8227
- // self.chartData.targetLineData &&
8228
- // d.value >= parseFloat(self.chartData.targetLineData.target) &&
8229
- // self.chartData.metaData.colorAboveTarget
8230
- // ) {
8231
- // const key = d.key.toLowerCase();
8232
- // const colorAboveTarget = Object.keys(self.chartData.metaData.colorAboveTarget).find(
8233
- // k => k.toLowerCase() === key
8234
- // );
8235
- // if (colorAboveTarget) {
8236
- // return self.chartData.metaData.colorAboveTarget[colorAboveTarget];
8237
- // }
8238
- // }
8239
- // return self.chartData.metaData.colors[d.key];
8240
- // });
8241
- // /**
8242
- // * display angled texts on the bars
8243
- // */
8244
- // if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
8245
- // state
8246
- // .selectAll('text')
8247
- // .data(function (d) {
8248
- // let newList: any = [];
8249
- // subgroups.map(function (key) {
8250
- // let obj: any = { key: key, value: d[key], name: d.name };
8251
- // newList.push(obj);
8252
- // });
8253
- // return newList;
8254
- // })
8255
- // .enter()
8256
- // .append('text')
8257
- // .attr('fill', 'var(--chart-text-color)')
8258
- // .attr('x', function (d) {
8259
- // return 0;
8260
- // })
8261
- // .attr('y', function (d) {
8262
- // return 0;
8263
- // })
8264
- // .attr('class', 'lib-data-labels-weeklycharts')
8265
- // .text(function (d) {
8266
- // return d.key && d.value
8267
- // ? d.key.length > 20
8268
- // ? d.key.substring(0, 17) + '...'
8269
- // : d.key
8270
- // : '';
8271
- // })
8272
- // .style('fill', function (d) {
8273
- // return '#000';
8274
- // })
8275
- // .style('font-weight', 'bold')
8276
- // .style('font-size', function (d) {
8277
- // if (self.isZoomedOut) {
8278
- // return '9px'; // 👈 Zoomed out mode
8279
- // }
8280
- // if (self.chartConfiguration.isDrilldownChart) {
8281
- // if (window.innerWidth > 1900) {
8282
- // return '18px';
8283
- // } else if (window.innerWidth < 1400) {
8284
- // return '10px';
8285
- // } else {
8286
- // return '14px';
8287
- // }
8288
- // } else {
8289
- // return '14px';
8290
- // }
8291
- // })
8292
- // .attr('transform', function (d) {
8293
- // data.map((indiv: any) => {
8294
- // if (indiv.name == d.name) {
8295
- // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8296
- // var temp;
8297
- // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8298
- // if (x.bandwidth() > 100) {
8299
- // if (self.chartData.data.length == 1) {
8300
- // if (Object.keys(self.chartData.data[0]).length == 2) {
8301
- // tempScale.range([
8302
- // 0 + (x.bandwidth() - 200) / 2,
8303
- // x.bandwidth() - (x.bandwidth() - 200) / 2,
8304
- // ]);
8305
- // // .padding(0.05);
8306
- // } else
8307
- // tempScale.range([
8308
- // 0 + (x.bandwidth() - 300) / 2,
8309
- // x.bandwidth() - (x.bandwidth() - 300) / 2,
8310
- // ]);
8311
- // // .padding(0.05);
8312
- // } else
8313
- // tempScale.range([
8314
- // 0 + (x.bandwidth() - 125) / 2,
8315
- // x.bandwidth() - (x.bandwidth() - 125) / 2,
8316
- // ]);
8317
- // }
8318
- // }
8319
- // });
8320
- // /**
8321
- // * if set, then all texts ll be horizontal
8322
- // */
8323
- // if (self.chartConfiguration.textAlwaysHorizontal) {
8324
- // return (
8325
- // 'translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')'
8326
- // );
8327
- // }
8328
- // /**
8329
- // * rotate texts having more than one digits
8330
- // */
8331
- // // if (d.value > 9)
8332
- // if (!isNaN(tempScale(d.key)))
8333
- // return (
8334
- // 'translate(' +
8335
- // (tempScale(d.key) + tempScale.bandwidth() * 0.55) +
8336
- // ',' +
8337
- // (y(0) - 10) +
8338
- // ') rotate(270)'
8339
- // );
8340
- // return 'translate(0,0)';
8341
- // // else
8342
- // // return (
8343
- // // 'translate(' +
8344
- // // (tempScale(d.key) + tempScale.bandwidth() / 2) +
8345
- // // ',' +
8346
- // // y(0) +
8347
- // // ')'
8348
- // // );
8349
- // })
8350
- // .on('click', function (d) {
8351
- // if (
8352
- // !metaData.barWithoutClick ||
8353
- // !metaData.barWithoutClick.length ||
8354
- // (!metaData.barWithoutClick.includes(d?.name) &&
8355
- // !metaData.barWithoutClick.includes(d?.key))
8356
- // )
8357
- // self.handleClick(d);
8358
- // });
8359
- // if (!isria) {
8360
- // state
8361
- // .selectAll('.lib-data-labels-weeklycharts')
8362
- // .on('mouseout', handleMouseOut)
8363
- // .on('mouseover', handleMouseOver);
8364
- // }
8365
- // }
8366
- // if (this.chartConfiguration.displayTitleOnTop || (
8367
- // this.chartConfiguration.textsOnBar == undefined &&
8368
- // this.chartConfiguration.displayTitleOnTop == undefined
8369
- // )) {
8370
- // if (!isria) {
8371
- // state
8372
- // .selectAll('rect')
8373
- // .on('mouseout', handleMouseOut)
8374
- // .on('mouseover', handleMouseOver);
8375
- // }
8376
- // }
8377
- // function handleMouseOver(d, i) {
8378
- // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8379
- // svg
8380
- // .append('foreignObject')
8381
- // .attr('x', function () {
8382
- // // ...existing code for tempScale calculation...
8383
- // var elementsCounter;
8384
- // data.map((indiv: any) => {
8385
- // if (indiv.name == d.name) {
8386
- // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8387
- // elementsCounter = keys.length;
8388
- // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8389
- // if (x.bandwidth() > 100) {
8390
- // if (self.chartData.data.length == 1) {
8391
- // if (Object.keys(self.chartData.data[0]).length == 2) {
8392
- // tempScale.range([
8393
- // 0 + (x.bandwidth() - 200) / 2,
8394
- // x.bandwidth() - (x.bandwidth() - 200) / 2,
8395
- // ]);
8396
- // } else
8397
- // tempScale.range([
8398
- // 0 + (x.bandwidth() - 300) / 2,
8399
- // x.bandwidth() - (x.bandwidth() - 300) / 2,
8400
- // ]);
8401
- // } else
8402
- // tempScale.range([
8403
- // 0 + (x.bandwidth() - 125) / 2,
8404
- // x.bandwidth() - (x.bandwidth() - 125) / 2,
8405
- // ]);
8406
- // }
8407
- // }
8408
- // });
8409
- // if (metaData.hasDrillDown) {
8410
- // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8411
- // return (
8412
- // x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90
8413
- // );
8414
- // }
8415
- // return (
8416
- // x(d.name) +
8417
- // tempScale(d.key) -
8418
- // (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
8419
- // tempScale.bandwidth() / 2
8420
- // );
8421
- // } else return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
8422
- // })
8423
- // .attr('class', 'lib-verticalstack-title-ontop')
8424
- // .attr('y', function () {
8425
- // return y(d.value) - 3 - 40 - 10;
8426
- // })
8427
- // .attr('dy', function () {
8428
- // return d.class;
8429
- // })
8430
- // .attr('width', function () {
8431
- // data.map((indiv: any) => {
8432
- // if (indiv.name == d.name) {
8433
- // let keys = Object.keys(indiv).filter((temp, i) => i != 0);
8434
- // tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
8435
- // if (x.bandwidth() > 100) {
8436
- // if (self.chartData.data.length == 1) {
8437
- // if (Object.keys(self.chartData.data[0]).length == 2) {
8438
- // tempScale.range([
8439
- // 0 + (x.bandwidth() - 200) / 2,
8440
- // x.bandwidth() - (x.bandwidth() - 200) / 2,
8441
- // ]);
8442
- // } else
8443
- // tempScale.range([
8444
- // 0 + (x.bandwidth() - 300) / 2,
8445
- // x.bandwidth() - (x.bandwidth() - 300) / 2,
8446
- // ]);
8447
- // } else
8448
- // tempScale.range([
8449
- // 0 + (x.bandwidth() - 125) / 2,
8450
- // x.bandwidth() - (x.bandwidth() - 125) / 2,
8451
- // ]);
8452
- // }
8453
- // }
8454
- // });
8455
- // if (metaData.hasDrillDown) {
8456
- // if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
8457
- // return '180px';
8458
- // }
8459
- // return tempScale.bandwidth() + leftAndRightSpaces * 2;
8460
- // } else return tempScale.bandwidth() + leftAndRightSpaces * 2;
8461
- // })
8462
- // .attr('height', 50)
8463
- // .append('xhtml:div')
8464
- // .attr('class', 'title')
8465
- // .style('z-index', 99)
8466
- // .html(function () {
8467
- // let barLabel = d.key;
8468
- // let dataType = metaData.dataType ? metaData.dataType : '';
8469
- // let value = d.value;
8470
- // let desiredText =
8471
- // '<span class="title-bar-name">' + barLabel + '</span>';
8472
- // desiredText +=
8473
- // '<span class="title-bar-value"><span>' +
8474
- // value +
8475
- // '</span>' +
8476
- // dataType +
8477
- // '</span>';
8478
- // return desiredText;
8479
- // });
8480
- // }
8481
- // function handleMouseOut(d, i) {
8482
- // svg.selectAll('.lib-verticalstack-title-ontop').remove();
8483
- // }
8484
- // svg
8485
- // .append('g')
8486
- // .attr('class', 'x2 axis2')
8487
- // .attr('transform', 'translate(0,' + height + ')')
8488
- // .style('color', 'var(--chart-axis-color, #000)') // Use CSS variable instead of hardcoded #000
8489
- // .call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
8490
- // .call((g) => g.select('.domain').attr('fill', 'none'));
8491
- // svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
8492
- // svg
8493
- // .append('g')
8494
- // .attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
8495
- // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8496
- // .attr('transform', 'translate(0,0)')
8497
- // .call(y)
8498
- // .style('display', 'none');
8499
- // svgYAxisLeft
8500
- // .append('g')
8501
- // .append('g')
8502
- // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8503
- // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8504
- // .attr('transform', 'translate(0,0)')
8505
- // .call(
8506
- // d3
8507
- // .axisLeft(y)
8508
- // .tickSize(0)
8509
- // .ticks(self.chartConfiguration.numberOfYTicks)
8510
- // .tickFormat(function (d) {
8511
- // const formatted = self.chartConfiguration.yAxisLabelFomatter
8512
- // ? self.chartConfiguration.yAxisLabelFomatter(d)
8513
- // : d;
8514
- // return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
8515
- // })
8516
- // )
8517
- // .call((g) => {
8518
- // // Style the domain line for theme support
8519
- // g.select('.domain')
8520
- // .style('stroke', 'var(--chart-domain-color, #000000)')
8521
- // .style('stroke-width', '1px');
8522
- // })
8523
- // .selectAll('text')
8524
- // .style('fill', 'var(--chart-text-color)');
8525
- // svgYAxisRight
8526
- // .append('g')
8527
- // .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
8528
- // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8529
- // .attr('transform', 'translate(0,0)')
8530
- // .call(y)
8531
- // .style('display', 'none');
8532
- // /**
8533
- // * hide x axis labels
8534
- // * config is there for future use
8535
- // * used by weekly charts
8536
- // */
8537
- // if (
8538
- // this.chartConfiguration.isXaxisLabelHidden != undefined &&
8539
- // this.chartConfiguration.isXaxisLabelHidden
8540
- // ) {
8541
- // d3.selectAll('g.lib-line-x-axis-text > g > text').attr(
8542
- // 'class',
8543
- // 'lib-display-hidden'
8544
- // );
8545
- // }
8546
- // /**
8547
- // * hide y axis labels
8548
- // * used by weekly charts
8549
- // */
8550
- // if (
8551
- // this.chartConfiguration.isYaxisLabelHidden != undefined &&
8552
- // this.chartConfiguration.isYaxisLabelHidden
8553
- // ) {
8554
- // d3.selectAll('.yaxis-dashed > g > text').attr(
8555
- // 'class',
8556
- // 'lib-display-hidden'
8557
- // );
8558
- // }
8559
- // /**
8560
- // * hide y axis labels
8561
- // * config is there for future use
8562
- // */
8563
- // if (
8564
- // this.chartConfiguration.isYaxisHidden != undefined &&
8565
- // this.chartConfiguration.isYaxisHidden
8566
- // ) {
8567
- // d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
8568
- // }
8569
- // /**
8570
- // * dashed y axis
8571
- // * used by weekly charts
8572
- // */
8573
- // if (
8574
- // this.chartConfiguration.isYaxisDashed != undefined &&
8575
- // this.chartConfiguration.isYaxisDashed
8576
- // ) {
8577
- // d3.selectAll('.yaxis-dashed')
8578
- // .style('stroke-dasharray', '5 5')
8579
- // .style('color', 'var(--chart-axis-color, #999999)'); // Use CSS variable
8580
- // }
8581
- // if (lineData != null) {
8582
- // if (lineData && self.chartConfiguration.showLineChartAxis) {
8583
- // svgYAxisRight
8584
- // .append('g')
8585
- // .attr('class', 'lib-stacked-y-axis-text1')
8586
- // .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
8587
- // .attr('transform', 'translate(' + 0 + ',0)')
8588
- // .call(yLineAxis);
8589
- // }
8590
- // }
8591
- // /**
8592
- // * used to display y label
8593
- // */
8594
- // // if (this.isZoomedOut) {
8595
- // // svg
8596
- // // .selectAll('.lib-xaxis-labels-texts-drilldown')
8597
- // // .attr('class', 'lib-display-hidden');
8598
- // // }
8599
- // if (this.isZoomedOut) {
8600
- // svg
8601
- // .selectAll('.lib-xaxis-labels-texts-drilldown')
8602
- // .each((d, i, nodes) => {
8603
- // const text = d3.select(nodes[i]);
8604
- // const label = text.text();
8605
- // if (label.indexOf('\n') > -1) {
8606
- // const lines = label.split('\n');
8607
- // text.text(null);
8608
- // lines.forEach((line, idx) => {
8609
- // text.append('tspan')
8610
- // .text(line)
8611
- // .attr('x', 0)
8612
- // .attr('dy', idx === 0 ? '1em' : '1.1em');
8613
- // });
8614
- // } else {
8615
- // const words = label.split(' ');
8616
- // text.text(null);
8617
- // words.forEach((word, index) => {
8618
- // text.append('tspan').text(word);
8619
- // });
8620
- // }
8621
- // })
8622
- // .style('fill', 'var(--chart-text-color)')
8623
- // .attr('transform', null);
8624
- // svg
8625
- // .select('.x-axis')
8626
- // .attr('transform', `translate(0, ${height - margin.bottom + 10})`);
8627
- // }
8628
- // /**
8629
- // * used to write y labels based on configuration
8630
- // */
8631
- // if (metaData.yLabel) {
8632
- // const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
8633
- // svgYAxisLeft
8634
- // .append('text')
8635
- // .attr('class', 'lib-axis-group-label font-size-1')
8636
- // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8637
- // .attr('transform', 'rotate(-90)')
8638
- // .attr('y', yPosition)
8639
- // .attr('x', 0 - height / 2)
8640
- // .attr('dy', '1em')
8641
- // .style('text-anchor', 'middle')
8642
- // .attr('fill', 'var(--chart-text-color)');
8643
- // if (this.chartConfiguration.isMultiChartGridLine === undefined) {
8644
- // svgYAxisLeft
8645
- // .selectAll('.lib-axis-group-label')
8646
- // .style('font-size', 'smaller')
8647
- // .text(metaData.yLabel);
8648
- // } else {
8649
- // svg
8650
- // .selectAll('.lib-axis-group-label')
8651
- // .attr('class', 'lib-ylabel-weeklyCharts')
8652
- // .text(metaData.yLabel.toLowerCase());
8653
- // }
8654
- // }
8655
- // if (this.chartData.targetLineData) {
8656
- // const yZero = y(this.chartData.targetLineData.target);
8657
- // svg
8658
- // .append('line')
8659
- // .attr('x1', 0)
8660
- // .attr('x2', width)
8661
- // .attr('y1', yZero)
8662
- // .attr('y2', yZero)
8663
- // .style('stroke-dasharray', '5 5')
8664
- // .style('stroke', this.chartData.targetLineData.color);
8665
- // // svgYAxisRight
8666
- // // .append('line')
8667
- // // .attr('x1', 0)
8668
- // // .attr('x2', rightSvgWidth)
8669
- // // .attr('y1', yZero)
8670
- // // .attr('y2', yZero)
8671
- // // .style('stroke', this.chartData.targetLineData.color);
8672
- // svgYAxisRight
8673
- // .append('foreignObject')
8674
- // .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
8675
- // .attr('width', rightSvgWidth)
8676
- // .attr('height', 50)
8677
- // .append('xhtml:div')
8678
- // .attr('class', 'target-display')
8679
- // .style('color', 'var(--chart-text-color)')
8680
- // .html(function () {
8681
- // let dataTypeTemp = '';
8682
- // let targetLineName = 'target';
8683
- // if (metaData.dataType) {
8684
- // dataTypeTemp = metaData.dataType;
8685
- // }
8686
- // if (
8687
- // self.chartData.targetLineData &&
8688
- // self.chartData.targetLineData.targetName
8689
- // ) {
8690
- // targetLineName = self.chartData.targetLineData.targetName;
8691
- // }
8692
- // return (
8693
- // `<div>${targetLineName}</div>` +
8694
- // '<div>' +
8695
- // self.chartData.targetLineData.target +
8696
- // '' +
8697
- // dataTypeTemp +
8698
- // '</div>'
8699
- // );
8700
- // });
8701
- // }
8702
- // if (this.chartConfiguration.isDrilldownChart) {
8703
- // /**
8704
- // * used by drilldown charts
8705
- // */
8706
- // // svg
8707
- // // .selectAll('.lib-axis-group-label')
8708
- // // .attr('class', 'lib-ylabel-drilldowncharts')
8709
- // // .text(metaData.yLabel.toLowerCase());
8710
- // svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
8711
- // }
8712
- // if (metaData.xLabel) {
8713
- // function isAcronym(label) {
8714
- // return (
8715
- // (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
8716
- // (label === label.toUpperCase() && /[A-Z]/.test(label))
8717
- // );
8718
- // }
8719
- // const xLabelText = metaData.xLabel;
8720
- // const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
8721
- // const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
8722
- // svg
8723
- // .append('text')
8724
- // .attr('class', function () {
8725
- // let baseClass = 'lib-axis-group-label font-size-1';
8726
- // if (self.chartConfiguration.isDrilldownChart)
8727
- // return baseClass + ' lib-xlabel-drilldowncharts';
8728
- // if (self.chartConfiguration.isMultiChartGridLine != undefined)
8729
- // return baseClass + ' lib-xlabel-weeklyCharts';
8730
- // return baseClass + ' lib-axis-waterfall-label';
8731
- // })
8732
- // .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
8733
- // .attr(
8734
- // 'transform',
8735
- // 'translate(' + width / 2 + ' ,' + xPosition + ')'
8736
- // )
8737
- // .style('text-anchor', 'middle')
8738
- // .style('fill', 'var(--chart-text-color)')
8739
- // .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
8740
- // .style('text-transform', isAcr ? 'none' : 'capitalize');
8741
- // }
8742
- // if (metaData.lineyLabel) {
8743
- // svgYAxisRight
8744
- // .append('text')
8745
- // .attr('class', 'lib-axis-group-label lib-line-axis')
8746
- // .attr('fill', 'var(--chart-text-color)')
8747
- // .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
8748
- // .attr('transform', 'translate(0,0) rotate(90)')
8749
- // .attr('y', 0 - 100)
8750
- // .attr('x', 0 + 100)
8751
- // .attr('dy', '5em')
8752
- // .style('text-anchor', 'middle')
8753
- // .style('font-size', 'smaller')
8754
- // .text(metaData.lineyLabel);
8755
- // }
8756
- // if (lineData) {
8757
- // svg
8758
- // .append('path')
8759
- // .datum(lineData)
8760
- // .attr('fill', 'none')
8761
- // .attr('stroke', self.chartConfiguration.lineGraphColor)
8762
- // .attr('stroke-width', 1.5)
8763
- // .attr(
8764
- // 'd',
8765
- // d3
8766
- // .line()
8767
- // .x(function (d) {
8768
- // return x(d.name) + x.bandwidth() / 2;
8769
- // })
8770
- // .y(function (d) {
8771
- // return lineYscale(d.value);
8772
- // })
8773
- // );
8774
- // var dot = svg
8775
- // .selectAll('myCircles')
8776
- // .data(lineData)
8777
- // .enter()
8778
- // .append('g')
8779
- // .on('click', function (d) {
8780
- // if (
8781
- // !metaData.barWithoutClick ||
8782
- // !metaData.barWithoutClick.length ||
8783
- // (!metaData.barWithoutClick.includes(d?.name) &&
8784
- // !metaData.barWithoutClick.includes(d?.key))
8785
- // )
8786
- // self.handleClick(d);
8787
- // });
8788
- // dot
8789
- // .append('circle')
8790
- // .attr('fill', function (d) {
8791
- // return self.chartConfiguration.lineGraphColor;
8792
- // })
8793
- // .attr('stroke', 'none')
8794
- // .attr('cx', function (d) {
8795
- // return x(d.name) + x.bandwidth() / 2;
8796
- // })
8797
- // .attr('cy', function (d) {
8798
- // return lineYscale(d.value);
8799
- // })
8800
- // .style('cursor', () =>
8801
- // self.chartData.metaData.hasDrillDown ? 'pointer' : 'default'
8802
- // )
8803
- // .attr('r', 3);
8804
- // if (self.chartConfiguration.lineGraphColor) {
8805
- // dot
8806
- // .append('text')
8807
- // .attr('class', 'dot')
8808
- // .attr('fill', 'var(--chart-text-color)')
8809
- // .attr('color', self.chartConfiguration.lineGraphColor)
8810
- // .attr('style', 'font-size: ' + '.85em')
8811
- // .attr('x', function (d, i) {
8812
- // return x(d.name) + x.bandwidth() / 2;
8813
- // })
8814
- // .attr('y', function (d) {
8815
- // return lineYscale(d.value);
8816
- // })
8817
- // .attr('dy', '-1em')
8818
- // .text(function (d) {
8819
- // return self.chartConfiguration.labelFormatter(d.value);
8820
- // });
8821
- // }
8822
- // }
8823
- // }
8824
7628
  initializegroupChart() {
8825
7629
  // ==================== VARIABLE DECLARATIONS ====================
8826
7630
  const self = this;
@@ -8931,7 +7735,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8931
7735
  .domain(groups)
8932
7736
  .range([0, width - RIGHT_SVG_WIDTH]);
8933
7737
  // ==================== X-AXIS RENDERING ====================
8934
- this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile);
7738
+ this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile, isTablet);
8935
7739
  // ==================== Y-AXIS SETUP ====================
8936
7740
  const y = d3.scaleLinear().rangeRound([height, 0]);
8937
7741
  let maxValue = this.calculateMaxValue(data, keyList);
@@ -8982,13 +7786,18 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
8982
7786
  }
8983
7787
  }
8984
7788
  // ==================== HELPER METHODS ====================
8985
- renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile) {
7789
+ renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile, isTablet) {
8986
7790
  let alternate_text = false;
8987
7791
  if (this.chartConfiguration.isMultiChartGridLine === undefined) {
8988
7792
  // Normal ticks for dashboard charts
7793
+ // Dynamically adjust Y translation for mobile
7794
+ let translateY = height;
7795
+ if (isMobile) {
7796
+ translateY = height + 24; // Add extra space at the top for mobile
7797
+ }
8989
7798
  svg.append('g')
8990
7799
  .attr('class', 'x1 axis1')
8991
- .attr('transform', `translate(0,${height})`)
7800
+ .attr('transform', `translate(0,${translateY})`)
8992
7801
  .call(d3.axisBottom(x))
8993
7802
  .call((g) => g.select('.domain').remove());
8994
7803
  svg.selectAll('g.x1.axis1 g.tick line').remove();
@@ -9048,7 +7857,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9048
7857
  .attr('x', 5)
9049
7858
  .style('text-anchor', 'middle');
9050
7859
  }
9051
- // Mobile override - check for single-group date charts first
7860
+ // Mobile/tablet override - check for single-group date charts first
9052
7861
  if (isMobile) {
9053
7862
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
9054
7863
  const groupsCount = data.length || 0;
@@ -9077,15 +7886,6 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9077
7886
  // Default mobile behavior for non-date or multi-group
9078
7887
  textNodes.classed('mobile-xaxis-override', true);
9079
7888
  }
9080
- // If there are many groups on mobile, rotate labels to sideways to
9081
- // avoid overlapping and make them readable. Use a lower threshold
9082
- // (3) so even small mobile screens get rotated labels when needed.
9083
- if (groupsCount > 3) {
9084
- svg.selectAll('g.x1.axis1 g.tick text')
9085
- .style('writing-mode', 'sideways-lr')
9086
- .style('text-anchor', 'middle')
9087
- .attr('y', 0);
9088
- }
9089
7889
  }
9090
7890
  }
9091
7891
  applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
@@ -9150,15 +7950,49 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9150
7950
  return baseY;
9151
7951
  }
9152
7952
  formatXLabelText(d, data, metaData, subgroups, self, isMobile) {
9153
- // Mobile handling: keep date labels intact for single-series charts (do not trim)
7953
+ // Check if we're on mobile or tablet
7954
+ const isSmallScreen = window.innerWidth < 992; // Less than 992px (mobile or tablet)
7955
+ // Helper to extract and format week number
7956
+ const extractWeekNumber = (text) => {
7957
+ const match = text.match(/(?:week|wk|w)\s*(\d+)/i);
7958
+ return match ? `W${match[1]}` : null;
7959
+ };
7960
+ // Helper to extract date part
7961
+ const extractDate = (text) => {
7962
+ const match = text.match(/\d{2}[-\/]\d{2}[-\/]\d{2,4}/);
7963
+ return match ? match[0] : null;
7964
+ };
7965
+ // Check if label contains both date and week information
7966
+ const hasDateAndTime = (text) => {
7967
+ const dateMatch = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(text);
7968
+ const weekMatch = /(?:week|wk|w)\s*\d+/i.test(text);
7969
+ return { isDate: dateMatch, isWeek: weekMatch };
7970
+ };
7971
+ const labelInfo = hasDateAndTime(d);
7972
+ // Mobile handling: format date and week parts
9154
7973
  if (isMobile) {
9155
- const isDateLabel = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(d) || !isNaN(Date.parse(d));
9156
- if (isDateLabel && subgroups && subgroups.length < 3) {
9157
- // For single-series charts on mobile, show full date labels (no trimming)
9158
- return d;
9159
- }
9160
- // If header is hidden (compact mobile), trim non-date labels as before
7974
+ // If header is hidden (compact mobile)
9161
7975
  if (!self.isHeaderVisible) {
7976
+ // If it has both date and week, format appropriately
7977
+ if (labelInfo.isDate && labelInfo.isWeek) {
7978
+ const datePart = extractDate(d);
7979
+ const weekPart = extractWeekNumber(d);
7980
+ if (datePart && weekPart) {
7981
+ return `${datePart}\n${weekPart}`;
7982
+ }
7983
+ }
7984
+ // If it's just a date, return it unchanged
7985
+ if (labelInfo.isDate) {
7986
+ return extractDate(d) || d;
7987
+ }
7988
+ // If it has just week number, format it as W##
7989
+ if (labelInfo.isWeek) {
7990
+ const weekPart = extractWeekNumber(d);
7991
+ if (weekPart) {
7992
+ return weekPart;
7993
+ }
7994
+ }
7995
+ // For non-date labels, trim as before
9162
7996
  const firstPart = d.split(/[\s\-]+/)[0];
9163
7997
  return firstPart.substring(0, 3).toLowerCase();
9164
7998
  }
@@ -9174,17 +8008,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9174
8008
  if (dateRangeRegex.test(d.trim())) {
9175
8009
  return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
9176
8010
  }
9177
- // Split date and week labels into two lines
9178
- const isDateLabel = /\d{2,4}[-\/]/.test(d);
9179
- const isWeekLabel = /week|wk|w\d+/i.test(d);
8011
+ // Handle splitting of multi-part labels
9180
8012
  if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 &&
9181
- d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
8013
+ d.indexOf(' ') > -1 && (labelInfo.isDate || labelInfo.isWeek)) {
9182
8014
  const first = d.substring(0, d.indexOf(' '));
9183
8015
  const second = d.substring(d.indexOf(' ') + 1).trim();
9184
8016
  return `${first}\n${second}`;
9185
8017
  }
9186
8018
  // Handle date labels in minimized view
9187
- if (isDateLabel) {
8019
+ if (labelInfo.isDate) {
9188
8020
  if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
9189
8021
  const first = d.substring(0, d.indexOf(' '));
9190
8022
  const second = d.substring(d.indexOf(' ') + 1).trim();
@@ -9783,7 +8615,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9783
8615
  // Minimum width per bar group based on device and number of subgroups
9784
8616
  const minWidthPerGroup = (() => {
9785
8617
  if (subgroupsCount > 2) {
9786
- return isMobile ? 80 : isTablet ? 100 : 120; // Wider for multiple subgroups
8618
+ return isMobile ? 100 : isTablet ? 100 : 120; // Wider for multiple subgroups
9787
8619
  }
9788
8620
  return isMobile ? 40 : isTablet ? 60 : 80; // Normal width for 1-2 subgroups
9789
8621
  })();