axidio-styleguide-library1-v2 0.2.91 → 0.2.93

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.
@@ -7857,8 +7857,8 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7857
7857
  .attr('x', 5)
7858
7858
  .style('text-anchor', 'middle');
7859
7859
  }
7860
- // Mobile/tablet override - check for date labels and apply appropriate rotation
7861
- if (isMobile || isTablet) {
7860
+ // Mobile/tablet override - check for single-group date charts first
7861
+ if (isMobile) {
7862
7862
  const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
7863
7863
  const groupsCount = data.length || 0;
7864
7864
  // Check if we have dates in x-axis and single group
@@ -7871,30 +7871,19 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7871
7871
  hasDateValues = true;
7872
7872
  }
7873
7873
  });
7874
- if (hasDateValues) {
7875
- if (isTablet) {
7876
- // For tablet view with dates, rotate vertically
7877
- textNodes
7878
- .style('writing-mode', 'sideways-lr')
7879
- .style('text-anchor', 'middle')
7880
- .attr('y', 0)
7881
- .attr('dx', '0')
7882
- .attr('dy', '0');
7883
- }
7884
- else if (isMobile && subgroups && subgroups.length < 3) {
7885
- // For mobile single chart with dates, keep horizontal
7886
- textNodes
7887
- .style('writing-mode', 'horizontal-tb')
7888
- .classed('mobile-xaxis-override', false)
7889
- .attr('transform', 'rotate(0)')
7890
- .attr('text-anchor', 'middle')
7891
- .attr('y', 20)
7892
- .attr('dx', '0')
7893
- .attr('dy', '0');
7894
- }
7874
+ if (hasDateValues && subgroups && subgroups.length < 3) {
7875
+ // For single chart with dates, ensure horizontal display
7876
+ textNodes
7877
+ .style('writing-mode', 'horizontal-tb') // Explicitly set horizontal
7878
+ .classed('mobile-xaxis-override', false) // Remove vertical class
7879
+ .attr('transform', 'rotate(0)') // Remove any rotation
7880
+ .attr('text-anchor', 'middle') // Center align
7881
+ .attr('y', 20) // Push down a bit
7882
+ .attr('dx', '0') // Reset any x offset
7883
+ .attr('dy', '0'); // Reset any y offset
7895
7884
  }
7896
7885
  else if (!this.isHeaderVisible) {
7897
- // Default mobile/tablet behavior for non-date labels
7886
+ // Default mobile behavior for non-date or multi-group
7898
7887
  textNodes.classed('mobile-xaxis-override', true);
7899
7888
  }
7900
7889
  }
@@ -7971,9 +7960,26 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7971
7960
  };
7972
7961
  const labelInfo = hasDateAndTime(d);
7973
7962
  // Apply date-week trimming only for mobile and tablet screens
7974
- if (isSmallScreen && labelInfo.isDate && labelInfo.isWeek) {
7975
- const datePart = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
7976
- return datePart ? datePart[0] : d;
7963
+ // Mobile: show full date (including year). Tablet: show only month/day.
7964
+ const isMobileScreen = window.innerWidth < 576;
7965
+ const isTabletScreen = window.innerWidth >= 576 && window.innerWidth < 992;
7966
+ if ((isMobileScreen || isTabletScreen) && labelInfo.isDate && labelInfo.isWeek) {
7967
+ const datePartMatch = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
7968
+ if (!datePartMatch)
7969
+ return d;
7970
+ const datePart = datePartMatch[0];
7971
+ if (isTabletScreen) {
7972
+ // Return only MM/DD (handle both YYYY/MM/DD and MM/DD/YYYY)
7973
+ const parts = datePart.split(/[-\/]/);
7974
+ if (parts[0].length === 4) {
7975
+ // YYYY/MM/DD -> MM/DD
7976
+ return `${parts[1]}/${parts[2]}`;
7977
+ }
7978
+ // MM/DD/YYYY -> MM/DD
7979
+ return `${parts[0]}/${parts[1]}`;
7980
+ }
7981
+ // Mobile: return full date including year
7982
+ return datePart;
7977
7983
  }
7978
7984
  // Mobile handling: keep date labels intact for single-series charts (do not trim)
7979
7985
  if (isMobile) {