axidio-styleguide-library1-v2 0.0.798 → 0.0.799

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.
@@ -8150,11 +8150,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
8150
8150
  .style('stroke-width', '1px');
8151
8151
  }
8152
8152
  styleAxisDomain();
8153
- // Always render y-axis label after axis/grid so it is visible
8154
8153
  if (metaData.yLabel) {
8155
- // Remove any previous y-axis label to avoid duplicates
8156
8154
  svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
8157
- // Helper to check if label is an acronym (all uppercase or <=4 chars and all letters)
8158
8155
  function isAcronym(label) {
8159
8156
  return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
8160
8157
  }
@@ -8240,13 +8237,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
8240
8237
  .text(metaData.lineyLabel);
8241
8238
  }
8242
8239
  if (metaData.xLabel) {
8240
+ function isAcronym(label) {
8241
+ return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
8242
+ }
8243
+ const xLabelText = metaData.xLabel;
8244
+ const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
8243
8245
  svg
8244
8246
  .append('text')
8245
- .attr('class', 'lib-axis-waterfall-label')
8246
- .attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 20) + ')')
8247
+ .attr('class', function () {
8248
+ if (self.chartConfiguration.isDrilldownChart)
8249
+ return 'lib-xlabel-drilldowncharts';
8250
+ if (self.chartConfiguration.isMultiChartGridLine != undefined)
8251
+ return 'lib-xlabel-weeklyCharts';
8252
+ return 'lib-axis-waterfall-label font-size-1';
8253
+ })
8254
+ .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
8255
+ .attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
8247
8256
  .style('text-anchor', 'middle')
8248
- .text(metaData.xLabel.toLowerCase())
8249
- .style('text-transform', 'capitalize');
8257
+ .style('fill', 'var(--chart-text-color)')
8258
+ .style('color', 'var(--chart-text-color)')
8259
+ .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
8260
+ .style('text-transform', isAcr ? 'none' : 'capitalize');
8250
8261
  }
8251
8262
  if (lineData && colors) {
8252
8263
  var dataGroup = d3