axidio-styleguide-library1-v2 0.0.869 → 0.0.871
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.
|
@@ -8151,31 +8151,32 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8151
8151
|
}
|
|
8152
8152
|
styleAxisDomain();
|
|
8153
8153
|
if (metaData.yLabel) {
|
|
8154
|
+
svgYAxisLeft.selectAll('.lib-axis-group-label, .lib-ylabel-drilldowncharts, .lib-ylabel-weeklyCharts').remove();
|
|
8155
|
+
function isAcronym(label) {
|
|
8156
|
+
return (label.length <= 4 && /^[A-Z]+$/.test(label)) || (label === label.toUpperCase() && /[A-Z]/.test(label));
|
|
8157
|
+
}
|
|
8158
|
+
const yLabelText = metaData.yLabel;
|
|
8159
|
+
const isAcr = isAcronym(yLabelText.replace(/[^A-Za-z]/g, ''));
|
|
8154
8160
|
svgYAxisLeft
|
|
8155
8161
|
.append('text')
|
|
8156
|
-
.attr('class',
|
|
8162
|
+
.attr('class', function () {
|
|
8163
|
+
let baseClass = 'lib-axis-group-label font-size-1';
|
|
8164
|
+
if (self.chartConfiguration.isDrilldownChart)
|
|
8165
|
+
return baseClass + ' lib-ylabel-drilldowncharts';
|
|
8166
|
+
if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
8167
|
+
return baseClass + ' lib-ylabel-weeklyCharts';
|
|
8168
|
+
return baseClass + ' lib-axis-waterfall-label';
|
|
8169
|
+
})
|
|
8157
8170
|
.attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
8158
8171
|
.attr('transform', 'rotate(-90)')
|
|
8159
8172
|
.attr('y', 0 - margin.left / 2 - 40)
|
|
8160
8173
|
.attr('x', 0 - height / 2)
|
|
8161
8174
|
.attr('dy', '1em')
|
|
8162
8175
|
.style('text-anchor', 'middle')
|
|
8163
|
-
.
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
.style('font-size', 'smaller')
|
|
8168
|
-
.text(metaData.yLabel);
|
|
8169
|
-
}
|
|
8170
|
-
else {
|
|
8171
|
-
/**
|
|
8172
|
-
* used by weekly charts
|
|
8173
|
-
*/
|
|
8174
|
-
svg
|
|
8175
|
-
.selectAll('.lib-axis-group-label')
|
|
8176
|
-
.attr('class', 'lib-ylabel-weeklyCharts')
|
|
8177
|
-
.text(metaData.yLabel.toLowerCase());
|
|
8178
|
-
}
|
|
8176
|
+
.style('fill', 'var(--chart-text-color)')
|
|
8177
|
+
.style('color', 'var(--chart-text-color)')
|
|
8178
|
+
.text(isAcr ? yLabelText.toUpperCase() : yLabelText.toLowerCase())
|
|
8179
|
+
.style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
8179
8180
|
}
|
|
8180
8181
|
if (this.chartData.targetLineData) {
|
|
8181
8182
|
const yZero = yScale(parsedNum);
|
|
@@ -8254,7 +8255,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8254
8255
|
return baseClass + ' lib-axis-waterfall-label';
|
|
8255
8256
|
})
|
|
8256
8257
|
.attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
8257
|
-
.attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + margin.bottom
|
|
8258
|
+
.attr('transform', 'translate(' + width / 2 + ' ,' + (height + margin.top + margin.bottom) + ')')
|
|
8258
8259
|
.style('text-anchor', 'middle')
|
|
8259
8260
|
.style('fill', 'var(--chart-text-color)')
|
|
8260
8261
|
.style('color', 'var(--chart-text-color)')
|