axidio-styleguide-library1-v2 0.0.799 → 0.0.801

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.
@@ -9587,6 +9587,29 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9587
9587
  .style('font-size', 'smaller')
9588
9588
  .text(metaData.lineyLabel);
9589
9589
  }
9590
+ if (metaData.xLabel) {
9591
+ function isAcronym(label) {
9592
+ return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
9593
+ }
9594
+ const xLabelText = metaData.xLabel;
9595
+ const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
9596
+ svg
9597
+ .append('text')
9598
+ .attr('class', function () {
9599
+ if (self.chartConfiguration.isDrilldownChart)
9600
+ return 'lib-xlabel-drilldowncharts';
9601
+ if (self.chartConfiguration.isMultiChartGridLine != undefined)
9602
+ return 'lib-xlabel-weeklyCharts';
9603
+ return 'lib-axis-waterfall-label font-size-1';
9604
+ })
9605
+ .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
9606
+ .attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
9607
+ .style('text-anchor', 'middle')
9608
+ .style('fill', 'var(--chart-text-color)')
9609
+ .style('color', 'var(--chart-text-color)')
9610
+ .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
9611
+ .style('text-transform', isAcr ? 'none' : 'capitalize');
9612
+ }
9590
9613
  if (lineData) {
9591
9614
  svg
9592
9615
  .append('path')