axidio-styleguide-library1-v2 0.0.804 → 0.0.805

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,9 +8237,28 @@ 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');
8247
+ .attr('class', function () {
8248
+ let baseClass = 'lib-axis-group-label';
8249
+ if (self.chartConfiguration.isDrilldownChart)
8250
+ return baseClass + ' lib-xlabel-drilldowncharts';
8251
+ if (self.chartConfiguration.isMultiChartGridLine != undefined)
8252
+ return baseClass + ' lib-xlabel-weeklyCharts';
8253
+ return baseClass + ' lib-axis-waterfall-label font-size-1';
8254
+ })
8255
+ .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
8256
+ .attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
8257
+ .style('text-anchor', 'middle')
8258
+ .style('fill', 'var(--chart-text-color)')
8259
+ .style('color', 'var(--chart-text-color)')
8260
+ .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
8261
+ .style('text-transform', isAcr ? 'none' : 'capitalize');
8246
8262
  }
8247
8263
  if (lineData && colors) {
8248
8264
  var dataGroup = d3
@@ -9026,13 +9042,9 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9026
9042
  }
9027
9043
  }
9028
9044
  });
9029
- return self.isZoomedOut
9030
- ? tempScale.bandwidth() * 0.5
9031
- : tempScale.bandwidth();
9045
+ return tempScale.bandwidth();
9032
9046
  }
9033
- return self.isZoomedOut
9034
- ? xSubgroup.bandwidth() * 0.5
9035
- : xSubgroup.bandwidth();
9047
+ return xSubgroup.bandwidth();
9036
9048
  })
9037
9049
  .attr('height', function (d) {
9038
9050
  if (d.value == -1) {
@@ -9311,7 +9323,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9311
9323
  .on('mouseout', function (d) {
9312
9324
  state.selectAll('.barstext').remove();
9313
9325
  })
9314
- .on('mouseover', function (d1) {
9326
+ .on('mouseover', (d1) => {
9315
9327
  state
9316
9328
  .selectAll('text')
9317
9329
  .data(function (d) {
@@ -9341,9 +9353,10 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9341
9353
  .style('fill', function (d) {
9342
9354
  return metaData.colors[d.key];
9343
9355
  })
9344
- .attr('width', self.isZoomedOut
9345
- ? xSubgroup.bandwidth() * 0.5
9346
- : xSubgroup.bandwidth())
9356
+ // .attr('width', xSubgroup.bandwidth())
9357
+ // .attr('width', this.isZoomedOut ? xSubgroup.bandwidth() : xSubgroup.bandwidth() * 0.6)
9358
+ .attr('x', (d) => xSubgroup(d.key) +
9359
+ (this.isZoomedOut ? 0 : (xSubgroup.bandwidth() * 0.4) / 2))
9347
9360
  .text(function (d) {
9348
9361
  return d.value;
9349
9362
  });
@@ -9575,6 +9588,30 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
9575
9588
  .style('font-size', 'smaller')
9576
9589
  .text(metaData.lineyLabel);
9577
9590
  }
9591
+ if (metaData.xLabel) {
9592
+ function isAcronym(label) {
9593
+ return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
9594
+ }
9595
+ const xLabelText = metaData.xLabel;
9596
+ const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
9597
+ svg
9598
+ .append('text')
9599
+ .attr('class', function () {
9600
+ let baseClass = 'lib-axis-group-label';
9601
+ if (self.chartConfiguration.isDrilldownChart)
9602
+ return baseClass + ' lib-xlabel-drilldowncharts';
9603
+ if (self.chartConfiguration.isMultiChartGridLine != undefined)
9604
+ return baseClass + ' lib-xlabel-weeklyCharts';
9605
+ return baseClass + ' lib-axis-waterfall-label font-size-1';
9606
+ })
9607
+ .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
9608
+ .attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + 40) + ')')
9609
+ .style('text-anchor', 'middle')
9610
+ .style('fill', 'var(--chart-text-color)')
9611
+ .style('color', 'var(--chart-text-color)')
9612
+ .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
9613
+ .style('text-transform', isAcr ? 'none' : 'capitalize');
9614
+ }
9578
9615
  if (lineData) {
9579
9616
  svg
9580
9617
  .append('path')