axidio-styleguide-library1-v2 0.4.3 → 0.4.5

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.
@@ -7866,14 +7866,35 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
7866
7866
  this.applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria);
7867
7867
  }
7868
7868
  // Mobile override for RIA
7869
+ // if (isria && self.chartData.data.length >=2) {
7870
+ // svg.selectAll('g.x1.axis1 g.tick text')
7871
+ // .classed('mobile-xaxis-override', true)
7872
+ // // .text((d: string) => d.substring(0, 3))
7873
+ // .text((d: string) => d.substring(0, 4).toLowerCase())
7874
+ // .style('font-size', '12px')
7875
+ // .attr('y', 5)
7876
+ // .attr('x', 5)
7877
+ // .style('text-anchor', 'middle');
7878
+ // }
7869
7879
  if (isria && self.chartData.data.length >= 2) {
7870
7880
  svg.selectAll('g.x1.axis1 g.tick text')
7871
- .classed('mobile-xaxis-override', true)
7872
- .text((d) => d.substring(0, 3).toLowerCase())
7881
+ .each((d) => {
7882
+ const textElement = d3.select(this);
7883
+ const hasSpecialChars = /[\s\-_]/.test(d); // Check for space, hyphen, or underscore
7884
+ // Only apply class if it has special characters
7885
+ textElement.classed('mobile-xaxis-override', hasSpecialChars);
7886
+ // if (hasSpecialChars) {
7887
+ // // Apply truncation for text with special chars
7888
+ // textElement.text(d.substring(0, 4).toLowerCase());
7889
+ // } else {
7890
+ // // Keep full text for simple strings
7891
+ // textElement.text(d.toLowerCase());
7892
+ // }
7893
+ })
7873
7894
  .style('font-size', '12px')
7874
7895
  .attr('y', 5)
7875
7896
  .attr('x', 5)
7876
- .style('text-anchor', 'middle');
7897
+ .attr('text-anchor', 'middle');
7877
7898
  }
7878
7899
  // ✅ Tablet View — Rotate if text > 10 characters
7879
7900
  if (isTablet) {