axidio-styleguide-library1-v2 0.4.12 → 0.4.14
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.
|
@@ -3387,10 +3387,15 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3387
3387
|
this.chartConfiguration = {};
|
|
3388
3388
|
this.objectKeys = Object.keys;
|
|
3389
3389
|
this.defaultConfiguration = {
|
|
3390
|
-
margin: {
|
|
3390
|
+
margin: {
|
|
3391
|
+
top: 30, // Space for top
|
|
3392
|
+
right: 40, // Right space
|
|
3393
|
+
bottom: 80, // FIXED: Increased from 20 to 80 for more space below X-axis label
|
|
3394
|
+
left: 80 // FIXED: Increased from 40 to 80 for Y-axis labels
|
|
3395
|
+
},
|
|
3391
3396
|
labelFormatter: ChartHelper.defaultFormatter,
|
|
3392
3397
|
svgHeight: 70,
|
|
3393
|
-
numberOfYTicks: 6,
|
|
3398
|
+
numberOfYTicks: 6, // FIXED: More ticks for better spacing
|
|
3394
3399
|
legendJustified: true,
|
|
3395
3400
|
yLineAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
3396
3401
|
yAxisLabelFomatter: ChartHelper.defaultFormatter,
|
|
@@ -3398,7 +3403,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3398
3403
|
showLineChartAxis: true,
|
|
3399
3404
|
showValues: true,
|
|
3400
3405
|
headerMenuOptions: HeaderConfigHelper.headerConfig.headerMenuOptions,
|
|
3401
|
-
yAxisGrid: false
|
|
3406
|
+
yAxisGrid: true, // FIXED: Changed from false to true to show grid
|
|
3402
3407
|
legendVisible: true,
|
|
3403
3408
|
isYaxisLabelHidden: false,
|
|
3404
3409
|
backgroundColor: '#FFFFFF',
|
|
@@ -3519,23 +3524,27 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3519
3524
|
(this.chartConfiguration.svgHeight / 100) -
|
|
3520
3525
|
margin.top -
|
|
3521
3526
|
margin.bottom;
|
|
3527
|
+
// FIXED: Ensure minimum height for proper Y-axis spacing
|
|
3528
|
+
const minHeight = 350; // Minimum height for good spacing
|
|
3522
3529
|
if (this.chartConfiguration.isFullScreen && this.chartConfiguration.svgHeight !== 70) {
|
|
3523
|
-
height = this.chartConfiguration.svgHeight;
|
|
3530
|
+
height = Math.max(this.chartConfiguration.svgHeight, minHeight);
|
|
3524
3531
|
}
|
|
3525
3532
|
else if (this.chartConfiguration.isFullScreen) {
|
|
3526
|
-
height = parseInt(verticalstackedcontainer.style('height'));
|
|
3533
|
+
height = Math.max(parseInt(verticalstackedcontainer.style('height')), minHeight);
|
|
3527
3534
|
}
|
|
3528
3535
|
if (this.chartConfiguration.isDrilldownChart && !this.isHeaderVisible) {
|
|
3529
|
-
height = parseInt(verticalstackedcontainer.style('height')) - margin.top - margin.bottom - 130;
|
|
3536
|
+
height = Math.max(parseInt(verticalstackedcontainer.style('height')) - margin.top - margin.bottom - 130, minHeight);
|
|
3530
3537
|
}
|
|
3531
3538
|
if (this.chartConfiguration.isHeaderVisible) {
|
|
3532
|
-
height = parseInt(verticalstackedcontainer.style('height')) - margin.top - margin.bottom - 100;
|
|
3539
|
+
height = Math.max(parseInt(verticalstackedcontainer.style('height')) - margin.top - margin.bottom - 100, minHeight);
|
|
3533
3540
|
}
|
|
3534
|
-
|
|
3541
|
+
// FIXED: If calculated height is too small, use minimum
|
|
3542
|
+
return Math.max(height, minHeight);
|
|
3535
3543
|
}
|
|
3536
3544
|
createScales(chartContext, dimensions) {
|
|
3537
3545
|
const { data, metaData, lineData, keyList } = chartContext;
|
|
3538
3546
|
const { width, height, margin } = dimensions;
|
|
3547
|
+
// FIXED: Reduce spaces for better bar distribution
|
|
3539
3548
|
const dataLength = data.length;
|
|
3540
3549
|
const leftAndRightSpaces = dataLength <= 5 ? 20 : (dataLength <= 10 ? 35 : 50);
|
|
3541
3550
|
const rightSvgWidth = 60;
|
|
@@ -3554,7 +3563,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3554
3563
|
.scaleBand()
|
|
3555
3564
|
.domain(groups)
|
|
3556
3565
|
.range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
3557
|
-
.padding(dataLength <= 5 ? 0.4 : 0.3);
|
|
3566
|
+
.padding(dataLength <= 5 ? 0.4 : 0.3); // FIXED: Better padding for fewer bars
|
|
3558
3567
|
}
|
|
3559
3568
|
const xScaleFromOrigin = d3.scaleBand().domain(groups).range([0, width - rightSvgWidth]);
|
|
3560
3569
|
const xSubgroup = d3.scaleBand().domain(keyList).range([0, x.bandwidth()]);
|
|
@@ -3761,6 +3770,7 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3761
3770
|
});
|
|
3762
3771
|
}
|
|
3763
3772
|
renderYAxis(svg, svgYAxisLeft, svgYAxisRight, y, dimensions) {
|
|
3773
|
+
// Hide the main Y-axis in the chart area (to avoid overlapping lines)
|
|
3764
3774
|
svg
|
|
3765
3775
|
.append('g')
|
|
3766
3776
|
.attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
@@ -3768,9 +3778,10 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3768
3778
|
.attr('transform', 'translate(0,0)')
|
|
3769
3779
|
.call(y)
|
|
3770
3780
|
.style('display', 'none');
|
|
3781
|
+
// FIXED: Render clean Y-axis on the left without domain line
|
|
3771
3782
|
const yAxisLeft = d3
|
|
3772
3783
|
.axisLeft(y)
|
|
3773
|
-
.tickSize(0)
|
|
3784
|
+
.tickSize(0) // FIXED: No tick lines
|
|
3774
3785
|
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
3775
3786
|
.tickFormat(this.chartConfiguration.yAxisLabelFomatter);
|
|
3776
3787
|
svgYAxisLeft
|
|
@@ -3780,12 +3791,13 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3780
3791
|
.attr('style', this.chartConfiguration.yAxisCustomTextStyles)
|
|
3781
3792
|
.attr('transform', 'translate(0,0)')
|
|
3782
3793
|
.call(yAxisLeft)
|
|
3794
|
+
.call((g) => g.select('.domain').remove()) // FIXED: Remove Y-axis line
|
|
3783
3795
|
.selectAll('text')
|
|
3784
3796
|
.style('fill', 'var(--chart-text-color)')
|
|
3785
|
-
.style('font-size', '
|
|
3797
|
+
.style('font-size', '13px')
|
|
3786
3798
|
.attr('dy', '0.32em');
|
|
3787
|
-
|
|
3788
|
-
|
|
3799
|
+
// Remove tick lines from left axis
|
|
3800
|
+
svgYAxisLeft.selectAll('.tick line').remove(); // FIXED: Remove all tick lines
|
|
3789
3801
|
svgYAxisRight
|
|
3790
3802
|
.append('g')
|
|
3791
3803
|
.attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
@@ -3810,12 +3822,21 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
3810
3822
|
}
|
|
3811
3823
|
}
|
|
3812
3824
|
renderYAxisGrid(svg, y, width) {
|
|
3825
|
+
// FIXED: Improved grid styling
|
|
3813
3826
|
svg
|
|
3814
3827
|
.append('g')
|
|
3815
|
-
.
|
|
3816
|
-
.
|
|
3817
|
-
.
|
|
3818
|
-
.
|
|
3828
|
+
.attr('class', 'y-axis-grid')
|
|
3829
|
+
.call(d3.axisLeft(y)
|
|
3830
|
+
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
3831
|
+
.tickSize(-width) // Full width grid lines
|
|
3832
|
+
.tickFormat('') // No labels on grid
|
|
3833
|
+
)
|
|
3834
|
+
.style('color', 'var(--chart-axis-color, #E0E0E0)') // FIXED: Lighter grid color
|
|
3835
|
+
.style('opacity', '0.7') // FIXED: Semi-transparent
|
|
3836
|
+
.style('stroke-dasharray', 'none') // FIXED: Solid lines instead of dashed
|
|
3837
|
+
.call((g) => g.select('.domain').remove()) // FIXED: Remove domain line
|
|
3838
|
+
.selectAll('line')
|
|
3839
|
+
.style('stroke-width', '1px'); // FIXED: Thin lines
|
|
3819
3840
|
}
|
|
3820
3841
|
renderXAxisGrid(svg, x, height) {
|
|
3821
3842
|
svg
|
|
@@ -4091,13 +4112,15 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4091
4112
|
.attr('class', 'lib-axis-group-label font-size-1')
|
|
4092
4113
|
.attr('style', this.chartConfiguration.yAxisCustomlabelStyles)
|
|
4093
4114
|
.attr('transform', 'rotate(-90)')
|
|
4094
|
-
|
|
4115
|
+
// FIXED: Better positioning for Y-axis label
|
|
4116
|
+
.attr('y', 0 - margin.left + 10) // Adjusted for new margin
|
|
4095
4117
|
.attr('x', 0 - height / 2)
|
|
4096
4118
|
.attr('dy', '1em')
|
|
4097
4119
|
.style('text-anchor', 'middle')
|
|
4120
|
+
.style('font-size', '14px') // FIXED: Explicit font size
|
|
4098
4121
|
.attr('fill', 'var(--chart-text-color)');
|
|
4099
4122
|
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
4100
|
-
svgYAxisLeft.selectAll('.lib-axis-group-label').
|
|
4123
|
+
svgYAxisLeft.selectAll('.lib-axis-group-label').text(yLabel);
|
|
4101
4124
|
}
|
|
4102
4125
|
else {
|
|
4103
4126
|
svgYAxisLeft
|
|
@@ -4122,9 +4145,11 @@ class GroupChartComponent extends ComponentUniqueId {
|
|
|
4122
4145
|
.append('text')
|
|
4123
4146
|
.attr('class', baseClass)
|
|
4124
4147
|
.attr('style', this.chartConfiguration.xAxisCustomlabelStyles)
|
|
4125
|
-
|
|
4148
|
+
// FIXED: Increased spacing below chart (was margin.top + 20, now margin.top + 45)
|
|
4149
|
+
.attr('transform', `translate(${width / 2},${height + margin.top + 45})`)
|
|
4126
4150
|
.style('text-anchor', 'middle')
|
|
4127
4151
|
.style('fill', 'var(--chart-text-color)')
|
|
4152
|
+
.style('font-size', '14px') // FIXED: Explicit font size
|
|
4128
4153
|
.text(isAcronym ? xLabel.toUpperCase() : xLabel.toLowerCase())
|
|
4129
4154
|
.style('text-transform', isAcronym ? 'none' : 'capitalize');
|
|
4130
4155
|
}
|