axidio-styleguide-library1-v2 0.2.93 → 0.2.94
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.
- package/esm2022/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.mjs +115 -183
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +1261 -45
- package/fesm2022/axidio-styleguide-library1-v2.mjs +1374 -226
- package/fesm2022/axidio-styleguide-library1-v2.mjs.map +1 -1
- package/lib/horizontal-bars-with-scroll-zoom/horizontal-bars-with-scroll-zoom.component.d.ts +0 -3
- package/package.json +1 -1
|
@@ -6488,11 +6488,9 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6488
6488
|
LONG_TICK_LENGTH: 16,
|
|
6489
6489
|
SHORT_TICK_LENGTH_BG: 5,
|
|
6490
6490
|
LONG_TICK_LENGTH_BG: 30,
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
MOBILE_BAR_PADDING: 10, // Reduced padding for mobile
|
|
6495
|
-
TABLET_BAR_PADDING: 8, // Added tablet-specific padding
|
|
6491
|
+
DESKTOP_BAR_WIDTH: 40, // Desktop bar width
|
|
6492
|
+
MOBILE_BAR_WIDTH: 25, // Mobile/Tablet bar width (reduced)
|
|
6493
|
+
BAR_GAP: 30, // Gap between bars (increased for better separation)
|
|
6496
6494
|
ZOOM_THRESHOLD: 30,
|
|
6497
6495
|
ZOOM_IN_THRESHOLD: 8,
|
|
6498
6496
|
};
|
|
@@ -6557,48 +6555,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6557
6555
|
removeExistingChart() {
|
|
6558
6556
|
d3.select('#' + this.uniqueId).remove();
|
|
6559
6557
|
}
|
|
6560
|
-
getDeviceConfig() {
|
|
6561
|
-
const width = window.innerWidth;
|
|
6562
|
-
return {
|
|
6563
|
-
isMobile: width < 768, // Changed from 576 to 768 for better mobile coverage
|
|
6564
|
-
isTablet: width >= 768 && width < 1024, // Changed from 576-992 to 768-1024
|
|
6565
|
-
isDesktop: width >= 1024, // Changed from 992 to 1024
|
|
6566
|
-
};
|
|
6567
|
-
}
|
|
6568
|
-
configureResponsiveSettings(device) {
|
|
6569
|
-
if (device.isMobile) {
|
|
6570
|
-
this.chartConfiguration.margin = { top: 15, right: 5, bottom: 35, left: 25 };
|
|
6571
|
-
this.chartConfiguration.numberOfYTicks = 4;
|
|
6572
|
-
this.chartConfiguration.svgHeight = 55;
|
|
6573
|
-
}
|
|
6574
|
-
else if (device.isTablet) {
|
|
6575
|
-
this.chartConfiguration.margin = { top: 20, right: 15, bottom: 40, left: 35 };
|
|
6576
|
-
this.chartConfiguration.numberOfYTicks = 5;
|
|
6577
|
-
this.chartConfiguration.svgHeight = 65;
|
|
6578
|
-
}
|
|
6579
|
-
else {
|
|
6580
|
-
// Desktop/Large screens
|
|
6581
|
-
const width = window.innerWidth;
|
|
6582
|
-
if (width >= 1920) {
|
|
6583
|
-
// Large monitors
|
|
6584
|
-
this.chartConfiguration.margin = { top: 35, right: 35, bottom: 55, left: 70 };
|
|
6585
|
-
this.chartConfiguration.numberOfYTicks = 8;
|
|
6586
|
-
this.chartConfiguration.svgHeight = 85;
|
|
6587
|
-
}
|
|
6588
|
-
else if (width >= 1366) {
|
|
6589
|
-
// Medium monitors
|
|
6590
|
-
this.chartConfiguration.margin = { top: 30, right: 30, bottom: 50, left: 60 };
|
|
6591
|
-
this.chartConfiguration.numberOfYTicks = 7;
|
|
6592
|
-
this.chartConfiguration.svgHeight = 80;
|
|
6593
|
-
}
|
|
6594
|
-
else {
|
|
6595
|
-
// Small desktops/laptops
|
|
6596
|
-
this.chartConfiguration.margin = { top: 25, right: 25, bottom: 45, left: 50 };
|
|
6597
|
-
this.chartConfiguration.numberOfYTicks = 6;
|
|
6598
|
-
this.chartConfiguration.svgHeight = 75;
|
|
6599
|
-
}
|
|
6600
|
-
}
|
|
6601
|
-
}
|
|
6602
6558
|
mergeConfigurations() {
|
|
6603
6559
|
for (const key in this.defaultConfiguration) {
|
|
6604
6560
|
this.chartConfiguration[key] = ChartHelper.getValueByConfigurationType(key, this.defaultConfiguration, this.customChartConfiguration);
|
|
@@ -6617,26 +6573,18 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6617
6573
|
}
|
|
6618
6574
|
return metaData;
|
|
6619
6575
|
}
|
|
6620
|
-
calculateDimensions(chartContainer, verticalContainer, margin,
|
|
6576
|
+
calculateDimensions(chartContainer, verticalContainer, margin, dataLength) {
|
|
6621
6577
|
const containerWidth = chartContainer.node().getBoundingClientRect().width;
|
|
6622
6578
|
const containerHeight = verticalContainer.node().getBoundingClientRect().height;
|
|
6623
6579
|
let width = containerWidth - margin.left - margin.right;
|
|
6624
6580
|
let height = containerHeight * (this.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
|
|
6625
|
-
//
|
|
6581
|
+
// Fixed zoom handling - same for all resolutions
|
|
6626
6582
|
if (dataLength > this.CONSTANTS.ZOOM_THRESHOLD && this.isZoomedOut) {
|
|
6627
|
-
const minWidth =
|
|
6628
|
-
? dataLength * 12
|
|
6629
|
-
: device.isTablet
|
|
6630
|
-
? dataLength * 20
|
|
6631
|
-
: dataLength * 25;
|
|
6583
|
+
const minWidth = dataLength * 25;
|
|
6632
6584
|
width = Math.max(width, minWidth);
|
|
6633
6585
|
}
|
|
6634
6586
|
if (dataLength > this.CONSTANTS.ZOOM_IN_THRESHOLD && !this.isZoomedOut) {
|
|
6635
|
-
width =
|
|
6636
|
-
? dataLength * 50
|
|
6637
|
-
: device.isTablet
|
|
6638
|
-
? dataLength * 90
|
|
6639
|
-
: dataLength * 130;
|
|
6587
|
+
width = dataLength * 130;
|
|
6640
6588
|
}
|
|
6641
6589
|
if (this.chartConfiguration.isFullScreen) {
|
|
6642
6590
|
height = this.chartConfiguration.svgHeight !== 80
|
|
@@ -6644,28 +6592,44 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6644
6592
|
: containerHeight;
|
|
6645
6593
|
}
|
|
6646
6594
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
6647
|
-
|
|
6648
|
-
height = containerHeight - margin.top - margin.bottom - offset;
|
|
6595
|
+
height = containerHeight - margin.top - margin.bottom - 130;
|
|
6649
6596
|
}
|
|
6597
|
+
// Responsive bar width based on screen size and number of bars
|
|
6598
|
+
const isMobileOrTablet = window.innerWidth < 1024;
|
|
6650
6599
|
let barWidth;
|
|
6651
6600
|
let barPadding;
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6601
|
+
if (isMobileOrTablet) {
|
|
6602
|
+
// Dynamic sizing for mobile/tablet based on number of bars
|
|
6603
|
+
if (dataLength === 1) {
|
|
6604
|
+
barWidth = 60; // Single bar - very wide
|
|
6605
|
+
barPadding = 0; // No gap needed
|
|
6606
|
+
}
|
|
6607
|
+
else if (dataLength === 2) {
|
|
6608
|
+
barWidth = 50; // 2 bars - wide with gap
|
|
6609
|
+
barPadding = 45; // Significant gap between 2 bars
|
|
6610
|
+
}
|
|
6611
|
+
else if (dataLength === 3) {
|
|
6612
|
+
barWidth = 45; // 3 bars - wide
|
|
6613
|
+
barPadding = 40; // Good spacing
|
|
6614
|
+
}
|
|
6615
|
+
else if (dataLength <= 5) {
|
|
6616
|
+
barWidth = 35; // Medium width for 4-5 bars
|
|
6617
|
+
barPadding = 30; // Medium spacing
|
|
6618
|
+
}
|
|
6619
|
+
else {
|
|
6620
|
+
barWidth = 25; // Narrower for many bars
|
|
6621
|
+
barPadding = 25; // Tighter spacing for many bars
|
|
6622
|
+
}
|
|
6663
6623
|
}
|
|
6664
6624
|
else {
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
}
|
|
6625
|
+
// Desktop: consistent sizing
|
|
6626
|
+
barWidth = this.CONSTANTS.DESKTOP_BAR_WIDTH;
|
|
6627
|
+
barPadding = this.CONSTANTS.BAR_GAP;
|
|
6628
|
+
}
|
|
6629
|
+
// Calculate required SVG width: bars + gaps + side spaces
|
|
6630
|
+
const totalBarsWidth = barWidth * dataLength;
|
|
6631
|
+
const totalGaps = barPadding * (dataLength - 1);
|
|
6632
|
+
const requiredSvgWidth = Math.max(width - this.CONSTANTS.RIGHT_SVG_WIDTH, totalBarsWidth + totalGaps + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2));
|
|
6669
6633
|
return {
|
|
6670
6634
|
width,
|
|
6671
6635
|
height,
|
|
@@ -6683,7 +6647,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6683
6647
|
.attr('class', 'outer-container')
|
|
6684
6648
|
.style('width', '100%')
|
|
6685
6649
|
.style('height', dimensions.height)
|
|
6686
|
-
.style('overflow-x', '
|
|
6650
|
+
.style('overflow-x', 'auto') // Enable scroll for all resolutions
|
|
6687
6651
|
.style('padding-left', `${margin.left}px`)
|
|
6688
6652
|
.style('margin-left', '10px')
|
|
6689
6653
|
.style('padding-right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`);
|
|
@@ -6709,7 +6673,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6709
6673
|
.append('div')
|
|
6710
6674
|
.attr('class', 'inner-container')
|
|
6711
6675
|
.style('width', '100%')
|
|
6712
|
-
.style('overflow-x', '
|
|
6676
|
+
.style('overflow-x', 'visible');
|
|
6713
6677
|
const svg = innerContainer
|
|
6714
6678
|
.append('svg')
|
|
6715
6679
|
.attr('width', dimensions.requiredSvgWidth)
|
|
@@ -6718,18 +6682,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6718
6682
|
.attr('transform', `translate(0,${margin.top})`);
|
|
6719
6683
|
return { svg, svgYAxisLeft, svgYAxisRight, innerContainer };
|
|
6720
6684
|
}
|
|
6721
|
-
createScales(data, layers, lineData, dimensions
|
|
6685
|
+
createScales(data, layers, lineData, dimensions) {
|
|
6722
6686
|
const { width, height, barWidth, barPadding } = dimensions;
|
|
6723
|
-
//
|
|
6724
|
-
const
|
|
6687
|
+
// Calculate total width needed for all bars with proper spacing
|
|
6688
|
+
const totalBarsWidth = data.length * barWidth;
|
|
6689
|
+
const totalSpacing = (data.length - 1) * barPadding;
|
|
6690
|
+
const requiredWidth = totalBarsWidth + totalSpacing + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
|
|
6691
|
+
// Use the larger of container width or required width for proper spacing
|
|
6692
|
+
const effectiveWidth = Math.max(width - this.CONSTANTS.RIGHT_SVG_WIDTH, requiredWidth);
|
|
6693
|
+
// Calculate padding ratio to create exact pixel gaps between bars
|
|
6694
|
+
const totalAvailableSpace = effectiveWidth;
|
|
6695
|
+
const paddingRatio = barPadding / (barWidth + barPadding);
|
|
6725
6696
|
const xScale = d3
|
|
6726
6697
|
.scaleBand()
|
|
6727
6698
|
.rangeRound([
|
|
6728
6699
|
this.CONSTANTS.LEFT_RIGHT_SPACES,
|
|
6729
|
-
|
|
6700
|
+
effectiveWidth + this.CONSTANTS.LEFT_RIGHT_SPACES - this.CONSTANTS.RIGHT_SVG_WIDTH
|
|
6730
6701
|
])
|
|
6731
6702
|
.domain(data.map(d => d.name).reverse())
|
|
6732
|
-
.
|
|
6703
|
+
.paddingInner(paddingRatio)
|
|
6704
|
+
.paddingOuter(0.5)
|
|
6705
|
+
.align(0.5); // Center alignment
|
|
6733
6706
|
const xScaleFromOrigin = d3
|
|
6734
6707
|
.scaleBand()
|
|
6735
6708
|
.rangeRound([width - this.CONSTANTS.RIGHT_SVG_WIDTH, 0])
|
|
@@ -6778,7 +6751,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6778
6751
|
}
|
|
6779
6752
|
return { xAxis, yAxis, yLineAxis };
|
|
6780
6753
|
}
|
|
6781
|
-
renderBars(svg, layers, scales, metaData, dimensions
|
|
6754
|
+
renderBars(svg, layers, scales, metaData, dimensions) {
|
|
6782
6755
|
const layer = svg
|
|
6783
6756
|
.selectAll('.layer')
|
|
6784
6757
|
.data(layers)
|
|
@@ -6790,11 +6763,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6790
6763
|
.selectAll('rect')
|
|
6791
6764
|
.data((d) => d)
|
|
6792
6765
|
.enter();
|
|
6793
|
-
this.appendRectangles(rect, scales, metaData, dimensions
|
|
6766
|
+
this.appendRectangles(rect, scales, metaData, dimensions);
|
|
6794
6767
|
this.addInteractions(rect, svg, metaData, scales);
|
|
6795
6768
|
return rect;
|
|
6796
6769
|
}
|
|
6797
|
-
appendRectangles(rect, scales, metaData, dimensions
|
|
6770
|
+
appendRectangles(rect, scales, metaData, dimensions) {
|
|
6798
6771
|
const { barWidth, barPadding } = dimensions;
|
|
6799
6772
|
const { xScale, yScale } = scales;
|
|
6800
6773
|
rect
|
|
@@ -6813,17 +6786,19 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6813
6786
|
}
|
|
6814
6787
|
return 0;
|
|
6815
6788
|
})
|
|
6816
|
-
.attr('x', (d
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6789
|
+
.attr('x', (d) => {
|
|
6790
|
+
// Center the bar within its bandwidth with proper spacing
|
|
6791
|
+
const xPosition = xScale(d.data.name);
|
|
6792
|
+
const bandwidth = xScale.bandwidth();
|
|
6820
6793
|
if (!this.chartConfiguration.isMultiChartGridLine) {
|
|
6821
|
-
|
|
6794
|
+
// Center the fixed-width bar in the available space
|
|
6795
|
+
return xPosition + (bandwidth - barWidth) / 2;
|
|
6822
6796
|
}
|
|
6823
6797
|
if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
|
|
6824
|
-
return
|
|
6798
|
+
return xPosition + bandwidth / 2 - 35;
|
|
6825
6799
|
}
|
|
6826
|
-
|
|
6800
|
+
const calculatedWidth = bandwidth * 0.8;
|
|
6801
|
+
return xPosition + (bandwidth - calculatedWidth) / 2;
|
|
6827
6802
|
})
|
|
6828
6803
|
.attr('height', (d) => {
|
|
6829
6804
|
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
@@ -6833,10 +6808,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6833
6808
|
return 0;
|
|
6834
6809
|
})
|
|
6835
6810
|
.attr('width', (d) => {
|
|
6836
|
-
if (device.isMobile)
|
|
6837
|
-
return barWidth;
|
|
6838
6811
|
if (!this.chartConfiguration.isMultiChartGridLine)
|
|
6839
|
-
return
|
|
6812
|
+
return barWidth;
|
|
6840
6813
|
if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
|
|
6841
6814
|
return 70;
|
|
6842
6815
|
}
|
|
@@ -6892,23 +6865,13 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6892
6865
|
const value = d[1] - d[0];
|
|
6893
6866
|
if (isNaN(value))
|
|
6894
6867
|
return;
|
|
6895
|
-
const device = this.getDeviceConfig();
|
|
6896
6868
|
const bandwidth = xScale.bandwidth();
|
|
6897
|
-
//
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
width = Math.min(bandwidth + 60, 200);
|
|
6904
|
-
}
|
|
6905
|
-
else {
|
|
6906
|
-
width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
|
|
6907
|
-
? '250px'
|
|
6908
|
-
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
|
|
6909
|
-
? '180px'
|
|
6910
|
-
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
|
|
6911
|
-
}
|
|
6869
|
+
// Fixed tooltip width for all resolutions
|
|
6870
|
+
const width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
|
|
6871
|
+
? '250px'
|
|
6872
|
+
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
|
|
6873
|
+
? '180px'
|
|
6874
|
+
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
|
|
6912
6875
|
svg
|
|
6913
6876
|
.append('foreignObject')
|
|
6914
6877
|
.attr('x', this.calculateTooltipX(d, xScale, width))
|
|
@@ -7026,8 +6989,10 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7026
6989
|
}
|
|
7027
6990
|
}
|
|
7028
6991
|
initializeStackedChart() {
|
|
7029
|
-
|
|
7030
|
-
this.
|
|
6992
|
+
// Use fixed configuration for all resolutions
|
|
6993
|
+
this.chartConfiguration.margin = { top: 20, right: 20, bottom: 40, left: 40 };
|
|
6994
|
+
this.chartConfiguration.numberOfYTicks = 5;
|
|
6995
|
+
this.chartConfiguration.svgHeight = 70;
|
|
7031
6996
|
this.mergeConfigurations();
|
|
7032
6997
|
this.applyConfigurationFlags();
|
|
7033
6998
|
const data = this.chartData.data;
|
|
@@ -7038,16 +7003,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7038
7003
|
const chartContainer = d3.select(this.containerElt.nativeElement);
|
|
7039
7004
|
const verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
|
|
7040
7005
|
const margin = this.chartConfiguration.margin;
|
|
7041
|
-
const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin,
|
|
7006
|
+
const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, data.length);
|
|
7042
7007
|
const { svg, svgYAxisLeft, svgYAxisRight } = this.createSvgContainers(chartContainer, dimensions, margin);
|
|
7043
7008
|
const stack = d3.stack().keys(keyList).offset(d3.stackOffsetNone);
|
|
7044
7009
|
const layers = stack(data);
|
|
7045
7010
|
data.sort((a, b) => b.total - a.total);
|
|
7046
|
-
const scales = this.createScales(data, layers, lineData, dimensions
|
|
7011
|
+
const scales = this.createScales(data, layers, lineData, dimensions);
|
|
7047
7012
|
const axes = this.createAxes(scales);
|
|
7048
7013
|
this.renderGrids(svg, scales, dimensions);
|
|
7049
|
-
const rect = this.renderBars(svg, layers, scales, metaData, dimensions
|
|
7050
|
-
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions,
|
|
7014
|
+
const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
|
|
7015
|
+
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
|
|
7051
7016
|
this.renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin);
|
|
7052
7017
|
this.renderTargetLine(svg, svgYAxisRight, scales, dimensions, metaData);
|
|
7053
7018
|
this.renderDataLabels(rect, scales, metaData, dimensions);
|
|
@@ -7088,7 +7053,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7088
7053
|
}
|
|
7089
7054
|
}
|
|
7090
7055
|
}
|
|
7091
|
-
renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions,
|
|
7056
|
+
renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data) {
|
|
7092
7057
|
if (this.chartConfiguration.showXaxisTop) {
|
|
7093
7058
|
svg
|
|
7094
7059
|
.append('g')
|
|
@@ -7098,7 +7063,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7098
7063
|
svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
7099
7064
|
}
|
|
7100
7065
|
if (!this.chartConfiguration.isMultiChartGridLine) {
|
|
7101
|
-
this.renderStandardAxes(svg, axes, scales, dimensions,
|
|
7066
|
+
this.renderStandardAxes(svg, axes, scales, dimensions, data);
|
|
7102
7067
|
}
|
|
7103
7068
|
else if (this.chartConfiguration.isDrilldownChart) {
|
|
7104
7069
|
this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions);
|
|
@@ -7109,24 +7074,29 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7109
7074
|
this.applyAxisStyling(svg, svgYAxisLeft, svgYAxisRight);
|
|
7110
7075
|
this.applyAxisConfigurations(svg, scales, dimensions, data);
|
|
7111
7076
|
}
|
|
7112
|
-
renderStandardAxes(svg, axes, scales, dimensions,
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7077
|
+
renderStandardAxes(svg, axes, scales, dimensions, data) {
|
|
7078
|
+
const isMobileOrTablet = window.innerWidth < 1024;
|
|
7079
|
+
svg
|
|
7080
|
+
.append('g')
|
|
7081
|
+
.attr('transform', `translate(0,${dimensions.height})`)
|
|
7082
|
+
.attr('class', 'lib-stacked-x-axis-text')
|
|
7083
|
+
.call(axes.xAxis)
|
|
7084
|
+
.selectAll('text')
|
|
7085
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7086
|
+
.style('font-size', isMobileOrTablet ? '10px' : '12px')
|
|
7087
|
+
.attr('text-anchor', 'middle')
|
|
7088
|
+
.attr('dx', '0')
|
|
7089
|
+
.attr('dy', '0.71em')
|
|
7090
|
+
.attr('transform', null)
|
|
7091
|
+
.each(function () {
|
|
7092
|
+
// Ensure X-axis labels are centered and don't overlap
|
|
7093
|
+
const textElement = d3.select(this);
|
|
7094
|
+
const text = textElement.text();
|
|
7095
|
+
if (isMobileOrTablet && text.length > 10) {
|
|
7096
|
+
// Truncate long labels on mobile/tablet
|
|
7097
|
+
textElement.text(text.substring(0, 8) + '...');
|
|
7098
|
+
}
|
|
7099
|
+
});
|
|
7130
7100
|
svg
|
|
7131
7101
|
.append('g')
|
|
7132
7102
|
.attr('class', 'lib-stacked-y-axis-text')
|
|
@@ -7135,27 +7105,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7135
7105
|
.selectAll('text')
|
|
7136
7106
|
.style('fill', 'var(--chart-text-color)');
|
|
7137
7107
|
}
|
|
7138
|
-
renderMobileXAxis(svg, data, dimensions) {
|
|
7139
|
-
svg.selectAll('.custom-x-label').remove();
|
|
7140
|
-
const maxLength = Math.max(...data.map(d => d.name.length));
|
|
7141
|
-
const fontSize = maxLength > 10 ? '8px' : '10px';
|
|
7142
|
-
data.forEach((d, i) => {
|
|
7143
|
-
const xVal = this.CONSTANTS.LEFT_RIGHT_SPACES +
|
|
7144
|
-
i * (dimensions.barWidth + dimensions.barPadding) +
|
|
7145
|
-
dimensions.barWidth / 2;
|
|
7146
|
-
svg
|
|
7147
|
-
.append('text')
|
|
7148
|
-
.attr('class', 'custom-x-label')
|
|
7149
|
-
.attr('x', 0)
|
|
7150
|
-
.attr('y', dimensions.height + 18)
|
|
7151
|
-
.attr('text-anchor', 'middle')
|
|
7152
|
-
.attr('transform', `translate(${xVal + 20},0)`)
|
|
7153
|
-
.style('font-size', fontSize)
|
|
7154
|
-
.style('fill', 'var(--chart-text-color)')
|
|
7155
|
-
.style('writing-mode', 'sideways-lr')
|
|
7156
|
-
.text(d.name.length > 6 ? d.name.substring(0, 4) + '...' : d.name);
|
|
7157
|
-
});
|
|
7158
|
-
}
|
|
7159
7108
|
renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions) {
|
|
7160
7109
|
svg
|
|
7161
7110
|
.append('g')
|
|
@@ -7237,7 +7186,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7237
7186
|
}
|
|
7238
7187
|
}
|
|
7239
7188
|
renderCustomXAxis(svg, scales, dimensions, data) {
|
|
7240
|
-
const device = this.getDeviceConfig();
|
|
7241
7189
|
svg
|
|
7242
7190
|
.append('g')
|
|
7243
7191
|
.attr('class', 'x1 axis1')
|
|
@@ -7245,12 +7193,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7245
7193
|
.style('color', '#000')
|
|
7246
7194
|
.call(d3.axisBottom(scales.xScale).tickSize(0))
|
|
7247
7195
|
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7248
|
-
this.styleCustomXAxisTicks(svg, data
|
|
7196
|
+
this.styleCustomXAxisTicks(svg, data);
|
|
7249
7197
|
if (this.chartConfiguration.xLabelsOnSameLine) {
|
|
7250
|
-
this.applyXLabelsOnSameLine(svg
|
|
7198
|
+
this.applyXLabelsOnSameLine(svg);
|
|
7251
7199
|
}
|
|
7252
7200
|
}
|
|
7253
|
-
styleCustomXAxisTicks(svg, data
|
|
7201
|
+
styleCustomXAxisTicks(svg, data) {
|
|
7254
7202
|
let alternateText = false;
|
|
7255
7203
|
svg.selectAll('.x1.axis1 .tick line').attr('y2', () => {
|
|
7256
7204
|
if (this.chartConfiguration.hideXaxisTick)
|
|
@@ -7282,28 +7230,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7282
7230
|
return this.CONSTANTS.SHORT_TICK_LENGTH_BG;
|
|
7283
7231
|
});
|
|
7284
7232
|
}
|
|
7285
|
-
applyXLabelsOnSameLine(svg
|
|
7233
|
+
applyXLabelsOnSameLine(svg) {
|
|
7286
7234
|
svg
|
|
7287
7235
|
.selectAll('g.x1.axis1 g.tick text')
|
|
7288
7236
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7289
7237
|
.attr('y', this.CONSTANTS.SHORT_TICK_LENGTH_BG)
|
|
7290
7238
|
.text((d) => {
|
|
7291
|
-
if (device.isMobile) {
|
|
7292
|
-
return d.split(' ')[0].substring(0, 3);
|
|
7293
|
-
}
|
|
7294
7239
|
const trimmed = d.trim();
|
|
7295
7240
|
const spaceIndex = trimmed.indexOf(' ');
|
|
7296
7241
|
return spaceIndex > -1
|
|
7297
7242
|
? trimmed.substring(0, spaceIndex).toLowerCase()
|
|
7298
7243
|
: trimmed.toLowerCase();
|
|
7299
|
-
})
|
|
7300
|
-
.attr('transform', function (d, i) {
|
|
7301
|
-
if (device.isMobile) {
|
|
7302
|
-
const parent = this.parentNode?.parentNode;
|
|
7303
|
-
const totalBars = parent ? d3.select(parent).selectAll('g.tick').size() : 0;
|
|
7304
|
-
return totalBars === 2 ? 'translate(0,0)' : `translate(${i * 30},0)`;
|
|
7305
|
-
}
|
|
7306
|
-
return null;
|
|
7307
7244
|
});
|
|
7308
7245
|
svg
|
|
7309
7246
|
.selectAll('g.x1.axis1 g.tick')
|
|
@@ -7312,16 +7249,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7312
7249
|
.attr('y', this.CONSTANTS.LONG_TICK_LENGTH_BG)
|
|
7313
7250
|
.attr('fill', 'currentColor')
|
|
7314
7251
|
.text((d) => {
|
|
7315
|
-
if (device.isMobile)
|
|
7316
|
-
return '';
|
|
7317
7252
|
const trimmed = d.trim();
|
|
7318
7253
|
const spaceIndex = trimmed.indexOf(' ');
|
|
7319
7254
|
return spaceIndex > -1
|
|
7320
7255
|
? trimmed.substring(spaceIndex).toLowerCase()
|
|
7321
7256
|
: '';
|
|
7322
|
-
})
|
|
7323
|
-
.attr('transform', (d, i) => {
|
|
7324
|
-
return device.isMobile && i === 0 ? 'translate(20,0)' : null;
|
|
7325
7257
|
});
|
|
7326
7258
|
}
|
|
7327
7259
|
renderDataLabels(rect, scales, metaData, dimensions) {
|
|
@@ -7512,11 +7444,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7512
7444
|
this.isZoomOutSelected(isZoomOut);
|
|
7513
7445
|
}
|
|
7514
7446
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7515
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}@media (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:9px!important}.lib-axis-group-label{font-size:10px!important}.dots{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr;font-size:9px!important}.target-display{font-size:9px;line-height:11px}.title-top-text{font-size:10px}.title-bar-name{font-size:12px}.zoomIcons{width:26px;height:26px}.lib-verticalstack-labels-ontop-weklycharts{font-size:9px}}@media (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.lib-axis-group-label{font-size:11px!important}.dots{font-size:9px!important}.target-display{font-size:10px;line-height:12px}.title-top-text{font-size:11px}.title-bar-name{font-size:13px}.zoomIcons{width:28px;height:28px}}@media (min-width: 1024px) and (max-width: 1365px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}.lib-axis-group-label{font-size:12px!important}.dots{font-size:10px!important}}@media (min-width: 1366px) and (max-width: 1919px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.lib-axis-group-label{font-size:13px!important}.dots{font-size:11px!important}}@media (min-width: 1920px) and (max-width: 2559px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.lib-axis-group-label{font-size:14px!important}.dots{font-size:12px!important}.target-display{font-size:13px;line-height:15px}.title-top-text{font-size:14px}.title-bar-name{font-size:16px}}@media (min-width: 2560px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.lib-axis-group-label{font-size:15px!important}.dots{font-size:14px!important}.target-display{font-size:14px;line-height:16px}.title-top-text{font-size:15px}.title-bar-name{font-size:18px}.zoomIcons{width:34px;height:34px}}@media (orientation: portrait) and (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{font-size:8px!important}}@media (orientation: landscape) and (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
7447
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: HorizontalBarsWithScrollZoomComponent, selector: "lib-horizontal-bars-with-scroll-zoom", inputs: { chartData: "chartData", customChartConfiguration: "customChartConfiguration" }, outputs: { clickEvent: "clickEvent", headerMenuclickEvent: "headerMenuclickEvent" }, viewQueries: [{ propertyName: "containerElt", first: true, predicate: ["verticalstackedchartcontainer"], descendants: true, static: true }, { propertyName: "verticalstackedcontainerElt", first: true, predicate: ["verticalstackedcontainer"], descendants: true, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}.lib-xaxis-labels-texts-drilldown,.lib-xaxis-labels-texts-drilldown-alt,.lib-xaxis-labels-texts-weeklycharts{font-size:12px}.lib-display-hidden{display:none!important}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.ResizedDirective, selector: "[resized]", outputs: ["resized"] }, { kind: "component", type: ChartHeaderV2Component, selector: "lib-chart-header-v2", inputs: ["chartData", "chartConfiguration"], outputs: ["clickEvent", "zoomInZoomOutClick"] }, { kind: "component", type: ChartHeaderV3Component, selector: "lib-chart-header-v3", inputs: ["chartData", "chartConfiguration"], outputs: ["compareByFilterSelection", "zoomInZoomOutClick"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
7516
7448
|
}
|
|
7517
7449
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
|
|
7518
7450
|
type: Component,
|
|
7519
|
-
args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}@media (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:9px!important}.lib-axis-group-label{font-size:10px!important}.dots{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{writing-mode:sideways-lr;font-size:9px!important}.target-display{font-size:9px;line-height:11px}.title-top-text{font-size:10px}.title-bar-name{font-size:12px}.zoomIcons{width:26px;height:26px}.lib-verticalstack-labels-ontop-weklycharts{font-size:9px}}@media (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:10px!important}.lib-axis-group-label{font-size:11px!important}.dots{font-size:9px!important}.target-display{font-size:10px;line-height:12px}.title-top-text{font-size:11px}.title-bar-name{font-size:13px}.zoomIcons{width:28px;height:28px}}@media (min-width: 1024px) and (max-width: 1365px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}.lib-axis-group-label{font-size:12px!important}.dots{font-size:10px!important}}@media (min-width: 1366px) and (max-width: 1919px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:12px!important}.lib-axis-group-label{font-size:13px!important}.dots{font-size:11px!important}}@media (min-width: 1920px) and (max-width: 2559px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:14px!important}.lib-axis-group-label{font-size:14px!important}.dots{font-size:12px!important}.target-display{font-size:13px;line-height:15px}.title-top-text{font-size:14px}.title-bar-name{font-size:16px}}@media (min-width: 2560px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:16px!important}.lib-axis-group-label{font-size:15px!important}.dots{font-size:14px!important}.target-display{font-size:14px;line-height:16px}.title-top-text{font-size:15px}.title-bar-name{font-size:18px}.zoomIcons{width:34px;height:34px}}@media (orientation: portrait) and (max-width: 767px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:8px!important}.lib-xaxis-labels-texts-drilldown{font-size:8px!important}}@media (orientation: landscape) and (min-width: 768px) and (max-width: 1023px){.lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-size:11px!important}}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
|
|
7451
|
+
args: [{ selector: 'lib-horizontal-bars-with-scroll-zoom', encapsulation: ViewEncapsulation.None, template: "<meta http-equiv=\"CACHE-CONTROL\" content=\"NO-CACHE\" />\r\n<meta http-equiv=\"EXPIRES\" content=\"Sat, 01 Jun 2004 11:12:01 GMT\" />\r\n<div\r\n #verticalstackedcontainer\r\n class=\"lib-chart-wrapper\"\r\n [ngClass]=\"{ 'lib-no-background': isTransparentBackground }\"\r\n style=\"background-color: var(--card-bg);\"\r\n\r\n (resized)=\"onResized($event)\"\r\n>\r\n <div class=\"header-alt\" *ngIf=\"!isHeaderVisible\">\r\n <lib-chart-header-v2\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (clickEvent)=\"handleClick($event)\"\r\n ></lib-chart-header-v2>\r\n\r\n <lib-chart-header-v3\r\n [chartData]=\"chartData\"\r\n [chartConfiguration]=\"chartConfiguration\"\r\n (compareByFilterSelection)=\"handleCompareByFilterSelection($event)\"\r\n (zoomInZoomOutClick)=\"handleZoominZoomoutClick($event)\"\r\n ></lib-chart-header-v3>\r\n </div>\r\n <div\r\n [style.height]=\"chartConfiguration.svgHeight\"\r\n id=\"verticalstackedchartcontainer\"\r\n #verticalstackedchartcontainer\r\n class=\"lib-chart-svg\"\r\n ></div>\r\n</div>\r\n", styles: [".lib-stacked-y-axis-text text,.lib-stacked-x-axis-text text{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1;font-size:12px}.lib-axis-group-label{font-size:12px;font-weight:600;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.dots{font-size:10px}.inline__display{display:flex;justify-content:space-around;padding-top:2%}.verticalbar__text{font-style:normal;font-variant:normal;font-weight:400;font-size:13px;line-height:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;opacity:1}.lib-line-label-item{display:inline-block!important;font-size:.85em;margin-right:10px;font-weight:600}.lib-line-label-wrapper-vertical{display:flex;justify-content:center}.target-display{font-size:11px;line-height:13px;font-weight:700;text-transform:uppercase;float:right}.title{background-color:#d9d9d9;height:40px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-radius:3px;line-height:1;padding:4px 8px;box-sizing:border-box}.title-top-text{color:var(--font-color)!important;font-size:12px;font-weight:600}.title-bar-name{color:var(--font-color)!important;font-size:14px;font-weight:700;text-transform:capitalize}.title-bottom-text{color:var(--font-color)!important;font-size:11px}.zoomIcons-holder{display:flex;align-items:center;margin-right:15px}.zoomIcons{border:.5px solid #b6b6b6;cursor:pointer;display:flex;justify-content:center;align-items:center;width:30px;height:30px;color:var(--color)!important}.zoom-active{background-color:#2d5ca0;opacity:1}.zoom-inactive{background-color:#d9d9d9;opacity:.5}.bottom__text{position:absolute!important;bottom:0!important;display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important}.box__heightwidth{opacity:1;height:10px;width:10px;border:none!important;border-radius:50%}.label__text{margin-right:10px;display:flex;justify-content:center;align-items:center;font-style:normal;font-variant:normal;font-weight:400;font-size:10px;line-height:13px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:.2px;color:#707070!important}.lib-verticalstack-labels-ontop-weklycharts{font-style:normal;font-variant:normal;font-weight:700;font-size:10px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.lib-verticalstack-title-ontop{font-style:normal;font-variant:normal;font-size:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.05px;text-anchor:middle;fill:#000}.marginLeft-20{margin-left:20px}.flex-inline{display:flex;justify-content:center;align-items:center;font-size:14px}.lib-xaxis-labels-texts-drilldown,.lib-xaxis-labels-texts-drilldown-alt,.lib-xaxis-labels-texts-weeklycharts{font-size:12px}.lib-display-hidden{display:none!important}\n", ".lib-chart-wrapper{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;background:#fff 0% 0% no-repeat padding-box;position:relative}.lib-chart-wrapper-wo-shadow{width:100%;height:100%;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background){background-color:#2e3640}.lib-chart-wrapper:hover .chart-header-v1:not(.header-no-background) .chart-title{color:#fff}.lib-chart-svg{width:100%}.lib-chart-header{text-align:center;background-color:#052340;color:#fff;width:100%;height:17%;word-spacing:.5px;line-height:1.8;font-weight:700;padding-top:2%;letter-spacing:0;font-size:1.2em}.lib-donut-chart-footer{width:100%;text-align:right}.lib-donut-label-text{font-size:.9em;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-weight:400;letter-spacing:0px;color:#000;opacity:1}.lib-donut-label-icon{display:inline-block;width:10px;height:10px;margin-right:20px;border-radius:3px}.lib-donut-label-item{font-weight:400;font-size:.85em;color:#2f2f2f}.lib-donut-justified-label-wrapper{width:100%;display:inline-block;text-align:center;list-style-type:none}.lib-donut-justified-label-item{font-weight:400;font-size:.85em;color:#2f2f2f;display:inline-block;text-align:left;padding:0 10px}.lib-donut-justified-label-icon{display:inline-block;width:10px;height:10px;margin-right:5px;border-radius:3px}.lib-no-background{background:none!important}.lib-display-hidden{display:none}.lib-ylabel-weeklyCharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:12px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.07px;text-transform:capitalize;color:#000}.lib-data-labels-weeklycharts{font-style:normal;font-variant:normal;font-weight:400;font-size:12px;line-height:14px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:-.06px;color:#000}.lib-data-labels-angled-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:9.5px;line-height:11px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:.4px;text-anchor:start}.lib-xaxis-labels-texts-weeklycharts{font-style:normal;font-variant:normal;font-weight:800;font-size:10px;line-height:11px;letter-spacing:-.05px;fill:#000}.lib-xaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:-1px;color:#000;opacity:1;text-transform:capitalize}.lib-white-space-nowrap{white-space:nowrap}.lib-xaxis-labels-texts-drilldown-alt{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:10px;letter-spacing:0px;color:#000;opacity:1;text-transform:capitalize}.lib-yaxis-labels-texts-drilldown{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:14px;letter-spacing:0px;color:#000!important;opacity:1}.lib-ylabel-drilldowncharts,.lib-xlabel-drilldowncharts{font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;font-size:16px;letter-spacing:-.1px;color:#000!important;opacity:1}.lib-donut-justified-label-icon-drilldown{display:inline-block;width:14px;height:14px;margin-right:10px;border-radius:50%}.marginright-2{margin-right:2%}.margintop-5{margin-top:5%}.width-100{width:100%}.float-right{float:right}.marginBottom-10{margin-bottom:10px}.header-alt{align-items:center;margin-bottom:10px}input::placeholder{font-size:20px;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto;letter-spacing:0px;color:#000;opacity:1}.padding-5{padding:5px}.hidden{visibility:hidden}.font-weight-bold{font-weight:900}.textalign-center{text-align:center}.cursor-pointer{cursor:pointer}.cursor-default{cursor:default}.font-weight-600{font-weight:600}.marginRight-15{margin-right:15px}.marginRight-20{margin-right:20px}.switch{position:relative;display:inline-block;width:46px;height:24px;margin-left:5px;margin-right:5px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#2d5ca0;-webkit-transition:.4s;transition:.4s}.slider:before{position:absolute;content:\"\";height:18px;width:18px;right:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider.round{border-radius:18px}.slider.round:before{border-radius:50%}.slider1{position:absolute;cursor:pointer;inset:0;background-color:#015ba2cf;-webkit-transition:.4s;transition:.4s}.slider1:before{position:absolute;content:\"\";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;-webkit-transition:.4s;transition:.4s}.slider1.round1{border-radius:18px}.slider1.round1:before{border-radius:50%}.lib-display-flex{display:flex}.lib-align-items-center{align-items:center}.lib-flex-direction-column{flex-direction:column}.lib-justify-content-space-between{justify-content:space-between}.lib-justify-content-space-around{justify-content:space-around}.lib-justify-content-center{justify-content:center}.lib-justify-content-start{justify-content:start}.lib-justify-content-end{justify-content:end}.lib-ml-20{margin-left:20px}.lib-position-absolute{position:absolute}.lib-z-index-9{z-index:9}.marginright-3{margin-right:3px}@media (min-height: 900px){.lib-chart-wrapper{border-radius:8px}.header-font-size-1{font-size:18px!important}.font-size-1{font-size:14px!important}.font-size-2{font-size:16px!important}.font-size-3{font-size:14px!important}.font-size-4{font-size:22px!important}.font-size-5{font-size:24px!important}}\n"] }]
|
|
7520
7452
|
}], ctorParameters: () => [], propDecorators: { containerElt: [{
|
|
7521
7453
|
type: ViewChild,
|
|
7522
7454
|
args: ['verticalstackedchartcontainer', { static: true }]
|
|
@@ -7625,6 +7557,1242 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7625
7557
|
get isAlertEnabled() {
|
|
7626
7558
|
return this.chartConfiguration?.headerMenuOptions?.some((option) => option.id === 'editAlert');
|
|
7627
7559
|
}
|
|
7560
|
+
// initializegroupChart() {
|
|
7561
|
+
// var self = this;
|
|
7562
|
+
// let data = [];
|
|
7563
|
+
// let metaData: any = null;
|
|
7564
|
+
// let keyList = null;
|
|
7565
|
+
// let lineData = null;
|
|
7566
|
+
// let colorMap = {};
|
|
7567
|
+
// var formatFromBackend;
|
|
7568
|
+
// var formatForHugeNumbers;
|
|
7569
|
+
// const isMobile = window.innerWidth < 576;
|
|
7570
|
+
// const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
|
|
7571
|
+
// const isDesktop = window.innerWidth >= 992;
|
|
7572
|
+
// let isria = this.customChartConfiguration.isRia
|
|
7573
|
+
// var x: any;
|
|
7574
|
+
// var alternate_text = false;
|
|
7575
|
+
// var short_tick_length = 4;
|
|
7576
|
+
// var long_tick_length = 16;
|
|
7577
|
+
// /**
|
|
7578
|
+
// * longer tick length needed for weekly charts
|
|
7579
|
+
// */
|
|
7580
|
+
// var short_tick_length_bg = 5;
|
|
7581
|
+
// var long_tick_length_bg = 30;
|
|
7582
|
+
// var leftAndRightSpaces = 50;
|
|
7583
|
+
// var rightSvgWidth = 60;
|
|
7584
|
+
// var tempScale;
|
|
7585
|
+
// for (var i in this.defaultConfiguration) {
|
|
7586
|
+
// this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(
|
|
7587
|
+
// i,
|
|
7588
|
+
// this.defaultConfiguration,
|
|
7589
|
+
// this.customChartConfiguration
|
|
7590
|
+
// );
|
|
7591
|
+
// }
|
|
7592
|
+
// data = this.chartData.data;
|
|
7593
|
+
// metaData = this.chartData.metaData;
|
|
7594
|
+
// lineData = this.chartData.lineData;
|
|
7595
|
+
// // if (lineData || this.chartData.targetLineData) {
|
|
7596
|
+
// // rightSvgWidth = 60;
|
|
7597
|
+
// // }
|
|
7598
|
+
// if (!metaData.colorAboveTarget) {
|
|
7599
|
+
// metaData['colorAboveTarget'] = metaData.colors;
|
|
7600
|
+
// }
|
|
7601
|
+
// colorMap = metaData.colors;
|
|
7602
|
+
// keyList = metaData.keyList;
|
|
7603
|
+
// var chartContainer = d3.select(this.containerElt.nativeElement);
|
|
7604
|
+
// var verticalstackedcontainer = d3.select(
|
|
7605
|
+
// this.groupcontainerElt.nativeElement
|
|
7606
|
+
// );
|
|
7607
|
+
// var margin = this.chartConfiguration.margin;
|
|
7608
|
+
// const { width, height } = this.calculateChartDimensions(
|
|
7609
|
+
// chartContainer,
|
|
7610
|
+
// verticalstackedcontainer,
|
|
7611
|
+
// margin,
|
|
7612
|
+
// self
|
|
7613
|
+
// );
|
|
7614
|
+
// /**
|
|
7615
|
+
// * for hiding header
|
|
7616
|
+
// * used by weekly charts
|
|
7617
|
+
// */
|
|
7618
|
+
// if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
7619
|
+
// this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
7620
|
+
// /**
|
|
7621
|
+
// * for hiding legends
|
|
7622
|
+
// * used by weekly charts
|
|
7623
|
+
// */
|
|
7624
|
+
// if (this.chartConfiguration.legendVisible != undefined) {
|
|
7625
|
+
// this.legendVisible = this.chartConfiguration.legendVisible;
|
|
7626
|
+
// }
|
|
7627
|
+
// /**
|
|
7628
|
+
// * for removing background color so that it can take parents color
|
|
7629
|
+
// *
|
|
7630
|
+
// */
|
|
7631
|
+
// if (this.chartConfiguration.isTransparentBackground != undefined) {
|
|
7632
|
+
// this.isTransparentBackground =
|
|
7633
|
+
// this.chartConfiguration.isTransparentBackground;
|
|
7634
|
+
// }
|
|
7635
|
+
// /**
|
|
7636
|
+
// * format data values based on configuration received
|
|
7637
|
+
// */
|
|
7638
|
+
// if (this.chartConfiguration.textFormatter != undefined) {
|
|
7639
|
+
// formatFromBackend = ChartHelper.dataValueFormatter(
|
|
7640
|
+
// this.chartConfiguration.textFormatter
|
|
7641
|
+
// );
|
|
7642
|
+
// formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
7643
|
+
// }
|
|
7644
|
+
// const {
|
|
7645
|
+
// outerContainer,
|
|
7646
|
+
// svgYAxisLeft,
|
|
7647
|
+
// svgYAxisRight,
|
|
7648
|
+
// innerContainer,
|
|
7649
|
+
// svg
|
|
7650
|
+
// } = this.createChartContainers(chartContainer, margin, height, rightSvgWidth, self, width);
|
|
7651
|
+
// var subgroups: any = keyList;
|
|
7652
|
+
// var groups = d3
|
|
7653
|
+
// .map(data, function (d) {
|
|
7654
|
+
// return d.name;
|
|
7655
|
+
// })
|
|
7656
|
+
// .keys();
|
|
7657
|
+
// /**
|
|
7658
|
+
// * x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
|
|
7659
|
+
// */
|
|
7660
|
+
// if (this.chartConfiguration.isMultiChartGridLine != undefined) {
|
|
7661
|
+
// x = d3
|
|
7662
|
+
// .scaleBand()
|
|
7663
|
+
// .rangeRound([width, 0])
|
|
7664
|
+
// .align(0.5)
|
|
7665
|
+
// .padding([0.5])
|
|
7666
|
+
// .domain(
|
|
7667
|
+
// data.map(function (d: any) {
|
|
7668
|
+
// return d.name.toLowerCase();
|
|
7669
|
+
// })
|
|
7670
|
+
// );
|
|
7671
|
+
// } else {
|
|
7672
|
+
// x = d3
|
|
7673
|
+
// .scaleBand()
|
|
7674
|
+
// .domain(groups)
|
|
7675
|
+
// .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
7676
|
+
// .padding([0.3]);
|
|
7677
|
+
// }
|
|
7678
|
+
// // x.bandwidth(96);
|
|
7679
|
+
// var xScaleFromOrigin = d3
|
|
7680
|
+
// .scaleBand()
|
|
7681
|
+
// .domain(groups)
|
|
7682
|
+
// .range([0, width - rightSvgWidth]);
|
|
7683
|
+
// // .padding([0.2]);
|
|
7684
|
+
// if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
7685
|
+
// /**
|
|
7686
|
+
// * normal ticks for all dashboard charts
|
|
7687
|
+
// */
|
|
7688
|
+
// svg
|
|
7689
|
+
// .append('g')
|
|
7690
|
+
// .attr('class', 'x1 axis1')
|
|
7691
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
7692
|
+
// .call(d3.axisBottom(x))
|
|
7693
|
+
// .call((g) => g.select('.domain').remove());
|
|
7694
|
+
// svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
7695
|
+
// // Only move x-axis labels further down for grouped charts if there is no xLabel
|
|
7696
|
+
// if (subgroups.length > 1 && !metaData.xLabel) {
|
|
7697
|
+
// svg
|
|
7698
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7699
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7700
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
7701
|
+
// .attr('y', 32); // Increase distance from bars (default is ~9)
|
|
7702
|
+
// } else {
|
|
7703
|
+
// svg
|
|
7704
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7705
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7706
|
+
// .style('fill', 'var(--chart-text-color)');
|
|
7707
|
+
// }
|
|
7708
|
+
// }
|
|
7709
|
+
// else {
|
|
7710
|
+
// /**
|
|
7711
|
+
// * bigger ticks for weekly charts and more space from x axis to labels
|
|
7712
|
+
// */
|
|
7713
|
+
// /**
|
|
7714
|
+
// * draw x axis
|
|
7715
|
+
// */
|
|
7716
|
+
// svg
|
|
7717
|
+
// .append('g')
|
|
7718
|
+
// .attr('class', 'x1 axis1')
|
|
7719
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
7720
|
+
// .call(d3.axisBottom(x).tickSize(0))
|
|
7721
|
+
// .call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7722
|
+
// /**
|
|
7723
|
+
// * tick line size in alternate fashion
|
|
7724
|
+
// */
|
|
7725
|
+
// svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
|
|
7726
|
+
// if (
|
|
7727
|
+
// alternate_text &&
|
|
7728
|
+
// self.chartConfiguration.isNoAlternateXaxisText == undefined
|
|
7729
|
+
// ) {
|
|
7730
|
+
// alternate_text = false;
|
|
7731
|
+
// return long_tick_length_bg - 7;
|
|
7732
|
+
// } else {
|
|
7733
|
+
// alternate_text = true;
|
|
7734
|
+
// return short_tick_length_bg - 4;
|
|
7735
|
+
// }
|
|
7736
|
+
// });
|
|
7737
|
+
// /**
|
|
7738
|
+
// * reset the flag so that values can be shown in same alternate fashion
|
|
7739
|
+
// */
|
|
7740
|
+
// alternate_text = false;
|
|
7741
|
+
// /**
|
|
7742
|
+
// * print x-axis label texts
|
|
7743
|
+
// * used by weekly charts
|
|
7744
|
+
// */
|
|
7745
|
+
// svg
|
|
7746
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7747
|
+
// .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
7748
|
+
// .attr('y', function () {
|
|
7749
|
+
// // Minimize gap in maximized (fullscreen) view for weekly charts
|
|
7750
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7751
|
+
// return short_tick_length_bg;
|
|
7752
|
+
// }
|
|
7753
|
+
// if (alternate_text) {
|
|
7754
|
+
// alternate_text = false;
|
|
7755
|
+
// return long_tick_length_bg;
|
|
7756
|
+
// } else {
|
|
7757
|
+
// alternate_text = true;
|
|
7758
|
+
// return short_tick_length_bg;
|
|
7759
|
+
// }
|
|
7760
|
+
// });
|
|
7761
|
+
// }
|
|
7762
|
+
// if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
7763
|
+
// const xAxisLabels = svg
|
|
7764
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7765
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7766
|
+
// .style('font-size', this.isHeaderVisible ? '18px' : '14px')
|
|
7767
|
+
// .attr('text-anchor', 'middle')
|
|
7768
|
+
// .attr('y', function(d) {
|
|
7769
|
+
// // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
|
|
7770
|
+
// if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
7771
|
+
// const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
7772
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7773
|
+
// return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
7774
|
+
// }
|
|
7775
|
+
// return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
7776
|
+
// }
|
|
7777
|
+
// // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
7778
|
+
// if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
7779
|
+
// const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
|
|
7780
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7781
|
+
// // Reduce extra gap in maximized view
|
|
7782
|
+
// return short_tick_length_bg + 2;
|
|
7783
|
+
// }
|
|
7784
|
+
// return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
|
|
7785
|
+
// }
|
|
7786
|
+
// // Default/fallback logic for other cases
|
|
7787
|
+
// let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
|
|
7788
|
+
// if (
|
|
7789
|
+
// subgroups.length > 1 &&
|
|
7790
|
+
// !metaData.xLabel &&
|
|
7791
|
+
// (/\d{2,4}[-\/]\d{2}[-\/]\d{2,4}/.test(d) || /\d{2,4}[-\/]\d{2,4}/.test(d))
|
|
7792
|
+
// ) {
|
|
7793
|
+
// baseY = self.isHeaderVisible ? short_tick_length_bg + 15 : short_tick_length_bg + 25;
|
|
7794
|
+
// }
|
|
7795
|
+
// if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
|
|
7796
|
+
// baseY += 4;
|
|
7797
|
+
// }
|
|
7798
|
+
// // In maximized view, reduce baseY slightly for grouped bars
|
|
7799
|
+
// if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
|
|
7800
|
+
// baseY = Math.max(short_tick_length_bg, baseY - 10);
|
|
7801
|
+
// }
|
|
7802
|
+
// return baseY;
|
|
7803
|
+
// })
|
|
7804
|
+
// .attr('x', function (d) {
|
|
7805
|
+
// if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
7806
|
+
// return 1; // Move first line text slightly to the left in zoom-in view for better alignment
|
|
7807
|
+
// }
|
|
7808
|
+
// return 0; // Default position
|
|
7809
|
+
// })
|
|
7810
|
+
// .text(function (d) {
|
|
7811
|
+
// var isValueToBeIgnored = false;
|
|
7812
|
+
// if (isMobile && !self.isHeaderVisible) {
|
|
7813
|
+
// let firstPart = d.split(/[\s\-]+/)[0];
|
|
7814
|
+
// return firstPart.substring(0, 3).toLowerCase();
|
|
7815
|
+
// }
|
|
7816
|
+
// (data as any[]).map((indiv: any) => {
|
|
7817
|
+
// if (
|
|
7818
|
+
// indiv.name &&
|
|
7819
|
+
// indiv.name.toLowerCase() == d.trim().toLowerCase() &&
|
|
7820
|
+
// indiv[metaData.keyList[0]] == -1
|
|
7821
|
+
// ) {
|
|
7822
|
+
// isValueToBeIgnored = true;
|
|
7823
|
+
// }
|
|
7824
|
+
// });
|
|
7825
|
+
// if (isValueToBeIgnored) {
|
|
7826
|
+
// return '';
|
|
7827
|
+
// }
|
|
7828
|
+
// // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
|
|
7829
|
+
// // Apply for grouped bar charts and single bar charts, header visible, single line
|
|
7830
|
+
// const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
7831
|
+
// if (dateRangeRegex.test(d.trim())) {
|
|
7832
|
+
// return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
7833
|
+
// }
|
|
7834
|
+
// // Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
|
|
7835
|
+
// const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
7836
|
+
// const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
7837
|
+
// if (
|
|
7838
|
+
// subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)
|
|
7839
|
+
// ) {
|
|
7840
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7841
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7842
|
+
// return first + '\n' + second;
|
|
7843
|
+
// }
|
|
7844
|
+
// // Also keep previous logic for minimized view
|
|
7845
|
+
// if (isDateLabel) {
|
|
7846
|
+
// if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
7847
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7848
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7849
|
+
// return first + '\n' + second;
|
|
7850
|
+
// } else {
|
|
7851
|
+
// return d;
|
|
7852
|
+
// }
|
|
7853
|
+
// }
|
|
7854
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7855
|
+
// return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
7856
|
+
// }
|
|
7857
|
+
// return d.toLowerCase();
|
|
7858
|
+
// // If label looks like a date (contains digits and - or /)
|
|
7859
|
+
// const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
|
|
7860
|
+
// // Only split date/week labels if there are many grouped bars and header is not visible
|
|
7861
|
+
// if (isDateLabel) {
|
|
7862
|
+
// if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
7863
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7864
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7865
|
+
// return first + '\n' + second;
|
|
7866
|
+
// } else {
|
|
7867
|
+
// return d;
|
|
7868
|
+
// }
|
|
7869
|
+
// }
|
|
7870
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7871
|
+
// return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
7872
|
+
// }
|
|
7873
|
+
// return d.toLowerCase();
|
|
7874
|
+
// });
|
|
7875
|
+
// // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
|
|
7876
|
+
// xAxisLabels.each(function(this: SVGTextElement, d: any) {
|
|
7877
|
+
// // Only apply writing-mode for exact date labels, not those containing 'week' or similar
|
|
7878
|
+
// const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
7879
|
+
// const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
7880
|
+
// if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
7881
|
+
// d3.select(this).style('writing-mode', 'sideways-lr');
|
|
7882
|
+
// }
|
|
7883
|
+
// });
|
|
7884
|
+
// if (!isMobile) {
|
|
7885
|
+
// svg
|
|
7886
|
+
// .selectAll('g.x1.axis1 g.tick')
|
|
7887
|
+
// .filter(function (d) {
|
|
7888
|
+
// return !/\d{2,4}[-\/]/.test(d); // Only process non-date labels
|
|
7889
|
+
// })
|
|
7890
|
+
// .append('text')
|
|
7891
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7892
|
+
// .attr('y', long_tick_length_bg)
|
|
7893
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
7894
|
+
// .attr('x', function (d) {
|
|
7895
|
+
// if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
7896
|
+
// return 1; // Move text slightly to the left
|
|
7897
|
+
// }
|
|
7898
|
+
// return 0; // Default position
|
|
7899
|
+
// })
|
|
7900
|
+
// .text(function (d) {
|
|
7901
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7902
|
+
// return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
|
|
7903
|
+
// }
|
|
7904
|
+
// return '';
|
|
7905
|
+
// });
|
|
7906
|
+
// }
|
|
7907
|
+
// }
|
|
7908
|
+
// if (isria && self.chartData.data.length > 8) {
|
|
7909
|
+
// svg
|
|
7910
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7911
|
+
// .classed('mobile-xaxis-override', true)
|
|
7912
|
+
// .text(function (d: string) {
|
|
7913
|
+
// return d.substring(0, 3);
|
|
7914
|
+
// })
|
|
7915
|
+
// .style('font-size', '12px')
|
|
7916
|
+
// .attr('y', 5)
|
|
7917
|
+
// .attr('x', 5)
|
|
7918
|
+
// .style('text-anchor', 'middle');
|
|
7919
|
+
// }
|
|
7920
|
+
// if (isMobile && !this.isHeaderVisible) {
|
|
7921
|
+
// svg
|
|
7922
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7923
|
+
// .classed('mobile-xaxis-override', true);
|
|
7924
|
+
// }
|
|
7925
|
+
// /**y scale for left y axis */
|
|
7926
|
+
// var y = d3.scaleLinear().rangeRound([height, 0]);
|
|
7927
|
+
// var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
|
|
7928
|
+
// if (maxValue == 0) {
|
|
7929
|
+
// if (this.chartData.targetLineData) {
|
|
7930
|
+
// maxValue = this.chartData.targetLineData.target + 20;
|
|
7931
|
+
// } else {
|
|
7932
|
+
// maxValue = 100;
|
|
7933
|
+
// }
|
|
7934
|
+
// }
|
|
7935
|
+
// if (this.chartConfiguration.customYscale) {
|
|
7936
|
+
// /**
|
|
7937
|
+
// * increase y-scale so that values wont cross or exceed out of range
|
|
7938
|
+
// * used in weekly charts
|
|
7939
|
+
// */
|
|
7940
|
+
// maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
7941
|
+
// }
|
|
7942
|
+
// if (
|
|
7943
|
+
// this.chartData.targetLineData &&
|
|
7944
|
+
// maxValue < this.chartData.targetLineData.target
|
|
7945
|
+
// ) {
|
|
7946
|
+
// maxValue =
|
|
7947
|
+
// maxValue < 10 && this.chartData.targetLineData.target < 10
|
|
7948
|
+
// ? this.chartData.targetLineData.target + 3
|
|
7949
|
+
// : this.chartData.targetLineData.target + 20;
|
|
7950
|
+
// }
|
|
7951
|
+
// y.domain([0, maxValue]).nice();
|
|
7952
|
+
// let lineYscale;
|
|
7953
|
+
// if (lineData != null) {
|
|
7954
|
+
// let maxLineValue = d3.max(lineData, function (d) {
|
|
7955
|
+
// return +d.value;
|
|
7956
|
+
// });
|
|
7957
|
+
// maxLineValue = maxLineValue * this.chartConfiguration.customYscale;
|
|
7958
|
+
// let minLineValue = d3.min(lineData, function (d) {
|
|
7959
|
+
// return +d.value;
|
|
7960
|
+
// });
|
|
7961
|
+
// if (maxLineValue > 0) minLineValue = minLineValue - 3;
|
|
7962
|
+
// if (minLineValue > 0) {
|
|
7963
|
+
// minLineValue = 0;
|
|
7964
|
+
// }
|
|
7965
|
+
// lineYscale = d3
|
|
7966
|
+
// .scaleLinear()
|
|
7967
|
+
// .domain([minLineValue, maxLineValue])
|
|
7968
|
+
// .range([height, minLineValue]);
|
|
7969
|
+
// }
|
|
7970
|
+
// let yLineAxis;
|
|
7971
|
+
// if (lineYscale != null) {
|
|
7972
|
+
// yLineAxis = d3
|
|
7973
|
+
// .axisRight(lineYscale)
|
|
7974
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
7975
|
+
// .tickSize(0)
|
|
7976
|
+
// .tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
7977
|
+
// }
|
|
7978
|
+
// /**
|
|
7979
|
+
// * show x-axis grid between labels
|
|
7980
|
+
// * used by weekly charts
|
|
7981
|
+
// */
|
|
7982
|
+
// if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
7983
|
+
// svg
|
|
7984
|
+
// .append('g')
|
|
7985
|
+
// .attr('class', 'grid')
|
|
7986
|
+
// .attr(
|
|
7987
|
+
// 'transform',
|
|
7988
|
+
// 'translate(' + x.bandwidth() / 2 + ',' + height + ')'
|
|
7989
|
+
// )
|
|
7990
|
+
// .call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
|
|
7991
|
+
// .style('stroke-dasharray', '5 5')
|
|
7992
|
+
// .style('color', 'var(--chart-grid-color, #999999)') // Use CSS variable
|
|
7993
|
+
// .call((g) => g.select('.domain').remove());
|
|
7994
|
+
// }
|
|
7995
|
+
// if (this.chartConfiguration.yAxisGrid) {
|
|
7996
|
+
// svg
|
|
7997
|
+
// .append('g')
|
|
7998
|
+
// .call(
|
|
7999
|
+
// d3
|
|
8000
|
+
// .axisLeft(y)
|
|
8001
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
8002
|
+
// .tickSize(-width)
|
|
8003
|
+
// )
|
|
8004
|
+
// .style('color', 'var(--chart-axis-color, #B9B9B9)')
|
|
8005
|
+
// .style('opacity', '0.5')
|
|
8006
|
+
// .call((g) => {
|
|
8007
|
+
// g.select('.domain')
|
|
8008
|
+
// .remove()
|
|
8009
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)'); // Add CSS variable for domain
|
|
8010
|
+
// });
|
|
8011
|
+
// } else {
|
|
8012
|
+
// svg
|
|
8013
|
+
// .append('g')
|
|
8014
|
+
// .call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
|
|
8015
|
+
// .style('color', 'var(--chart-axis-color, #B9B9B9)')
|
|
8016
|
+
// .style('opacity', '0.5')
|
|
8017
|
+
// .call((g) => {
|
|
8018
|
+
// g.select('.domain')
|
|
8019
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)') // Add CSS variable for domain
|
|
8020
|
+
// .style('stroke-width', '1px'); // Ensure visibility
|
|
8021
|
+
// });
|
|
8022
|
+
// }
|
|
8023
|
+
// var xSubgroup = d3.scaleBand().domain(subgroups);
|
|
8024
|
+
// if (subgroups.length > 1 && !this.isZoomedOut) {
|
|
8025
|
+
// // For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
|
|
8026
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8027
|
+
// } else if (subgroups.length === 1 && !this.isZoomedOut) {
|
|
8028
|
+
// // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
|
|
8029
|
+
// xSubgroup.range([0, 100]);
|
|
8030
|
+
// } else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
8031
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8032
|
+
// } else {
|
|
8033
|
+
// // used to make grouped bars with lesser width as we are not using padding for width
|
|
8034
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8035
|
+
// }
|
|
8036
|
+
// // if (this.chartConfiguration.isDrilldownChart) {
|
|
8037
|
+
// // }
|
|
8038
|
+
// var color = d3
|
|
8039
|
+
// .scaleOrdinal()
|
|
8040
|
+
// .domain(subgroups)
|
|
8041
|
+
// .range(Object.values(metaData.colors));
|
|
8042
|
+
// // var colorAboveTarget = d3
|
|
8043
|
+
// // .scaleOrdinal()
|
|
8044
|
+
// // .domain(subgroups)
|
|
8045
|
+
// // .range(Object.values(metaData.colorAboveTarget));
|
|
8046
|
+
// var state = svg
|
|
8047
|
+
// .append('g')
|
|
8048
|
+
// .selectAll('.state')
|
|
8049
|
+
// .data(data)
|
|
8050
|
+
// .enter()
|
|
8051
|
+
// .append('g')
|
|
8052
|
+
// .attr('transform', function (d) {
|
|
8053
|
+
// return 'translate(' + x(d.name) + ',0)';
|
|
8054
|
+
// });
|
|
8055
|
+
// state
|
|
8056
|
+
// .selectAll('rect')
|
|
8057
|
+
// .data(function (d) {
|
|
8058
|
+
// let newList: any = [];
|
|
8059
|
+
// subgroups.map(function (key) {
|
|
8060
|
+
// // if (key !== "group") {
|
|
8061
|
+
// let obj: any = { key: key, value: d[key], name: d.name };
|
|
8062
|
+
// newList.push(obj);
|
|
8063
|
+
// // }
|
|
8064
|
+
// });
|
|
8065
|
+
// return newList;
|
|
8066
|
+
// })
|
|
8067
|
+
// .enter()
|
|
8068
|
+
// .append('rect')
|
|
8069
|
+
// .attr('class', 'bars')
|
|
8070
|
+
// .on('click', function (d) {
|
|
8071
|
+
// if (d.key != 'Target') {
|
|
8072
|
+
// if (
|
|
8073
|
+
// !metaData.barWithoutClick ||
|
|
8074
|
+
// !metaData.barWithoutClick.length ||
|
|
8075
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8076
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8077
|
+
// )
|
|
8078
|
+
// // self.handleClick(d.data.name);
|
|
8079
|
+
// self.handleClick(d);
|
|
8080
|
+
// }
|
|
8081
|
+
// })
|
|
8082
|
+
// .attr('x', function (d) {
|
|
8083
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8084
|
+
// data.map((indiv: any) => {
|
|
8085
|
+
// if (indiv.name == d.name) {
|
|
8086
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8087
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8088
|
+
// if (x.bandwidth() > 100) {
|
|
8089
|
+
// // Increase bar width a bit in zoom-in view
|
|
8090
|
+
// let reducedBarWidth = 60;
|
|
8091
|
+
// if (!self.isZoomedOut) {
|
|
8092
|
+
// reducedBarWidth = 30;
|
|
8093
|
+
// }
|
|
8094
|
+
// if (self.chartData.data.length == 1) {
|
|
8095
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8096
|
+
// tempScale.range([
|
|
8097
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8098
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8099
|
+
// ]);
|
|
8100
|
+
// } else
|
|
8101
|
+
// tempScale.range([
|
|
8102
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8103
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8104
|
+
// ]);
|
|
8105
|
+
// } else
|
|
8106
|
+
// tempScale.range([
|
|
8107
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8108
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8109
|
+
// ]);
|
|
8110
|
+
// }
|
|
8111
|
+
// }
|
|
8112
|
+
// });
|
|
8113
|
+
// return tempScale(d.key);
|
|
8114
|
+
// }
|
|
8115
|
+
// return xSubgroup(d.key);
|
|
8116
|
+
// })
|
|
8117
|
+
// .attr('y', function (d) {
|
|
8118
|
+
// if (d.value == -1) {
|
|
8119
|
+
// return y(0);
|
|
8120
|
+
// }
|
|
8121
|
+
// if (d.value >= 0) {
|
|
8122
|
+
// const barHeight = height - y(d.value);
|
|
8123
|
+
// const minHeight = self.chartConfiguration.defaultBarHeight || 2;
|
|
8124
|
+
// return barHeight < minHeight ? y(0) - minHeight : y(d.value);
|
|
8125
|
+
// }
|
|
8126
|
+
// return y(0);
|
|
8127
|
+
// })
|
|
8128
|
+
// .attr('width', function (d) {
|
|
8129
|
+
// // For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
|
|
8130
|
+
// if (subgroups.length > 1 && !self.isZoomedOut) {
|
|
8131
|
+
// return 50;
|
|
8132
|
+
// }
|
|
8133
|
+
// // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
8134
|
+
// if (subgroups.length === 1 && !self.isZoomedOut) {
|
|
8135
|
+
// return 80;
|
|
8136
|
+
// }
|
|
8137
|
+
// let tempScale = d3.scaleBand().domain([]).range([0, 0]);
|
|
8138
|
+
// // Default logic for other chart types
|
|
8139
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8140
|
+
// data.map((indiv: any) => {
|
|
8141
|
+
// if (indiv.name == d.name) {
|
|
8142
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8143
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8144
|
+
// if (x.bandwidth() > 100) {
|
|
8145
|
+
// // Increase bar width a bit in zoom-in view
|
|
8146
|
+
// let reducedBarWidth = 60;
|
|
8147
|
+
// if (!self.isZoomedOut) {
|
|
8148
|
+
// reducedBarWidth = 100;
|
|
8149
|
+
// }
|
|
8150
|
+
// if (self.chartData.data.length == 1) {
|
|
8151
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8152
|
+
// tempScale.range([
|
|
8153
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8154
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8155
|
+
// ]);
|
|
8156
|
+
// } else
|
|
8157
|
+
// tempScale.range([
|
|
8158
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8159
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8160
|
+
// ]);
|
|
8161
|
+
// } else
|
|
8162
|
+
// tempScale.range([
|
|
8163
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8164
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8165
|
+
// ]);
|
|
8166
|
+
// }
|
|
8167
|
+
// }
|
|
8168
|
+
// });
|
|
8169
|
+
// return self.isZoomedOut
|
|
8170
|
+
// ? tempScale.bandwidth()
|
|
8171
|
+
// : self.chartData.data.length && self.chartData.data.length > 8
|
|
8172
|
+
// ? tempScale.bandwidth()
|
|
8173
|
+
// : tempScale.bandwidth();
|
|
8174
|
+
// }
|
|
8175
|
+
// return self.isZoomedOut
|
|
8176
|
+
// ? tempScale.bandwidth()
|
|
8177
|
+
// : self.chartData.data.length && self.chartData.data.length > 8
|
|
8178
|
+
// ? tempScale.bandwidth()
|
|
8179
|
+
// : tempScale.bandwidth();
|
|
8180
|
+
// })
|
|
8181
|
+
// .attr('height', function (d) {
|
|
8182
|
+
// if (d.value == -1) {
|
|
8183
|
+
// return height - y(0);
|
|
8184
|
+
// }
|
|
8185
|
+
// if (d.value >= 0) {
|
|
8186
|
+
// const barHeight = height - y(d.value);
|
|
8187
|
+
// const minHeight = self.chartConfiguration.defaultBarHeight || 2;
|
|
8188
|
+
// return Math.max(barHeight, minHeight);
|
|
8189
|
+
// }
|
|
8190
|
+
// return height - y(0);
|
|
8191
|
+
// })
|
|
8192
|
+
// .style('cursor', function (d) {
|
|
8193
|
+
// if (metaData.hasDrillDown && !isria) return 'pointer';
|
|
8194
|
+
// else return 'default';
|
|
8195
|
+
// })
|
|
8196
|
+
// .attr('fill', function (d) {
|
|
8197
|
+
// if (
|
|
8198
|
+
// d.value &&
|
|
8199
|
+
// self.chartData.targetLineData &&
|
|
8200
|
+
// d.value >= parseFloat(self.chartData.targetLineData.target) &&
|
|
8201
|
+
// self.chartData.metaData.colorAboveTarget
|
|
8202
|
+
// ) {
|
|
8203
|
+
// const key = d.key.toLowerCase();
|
|
8204
|
+
// const colorAboveTarget = Object.keys(self.chartData.metaData.colorAboveTarget).find(
|
|
8205
|
+
// k => k.toLowerCase() === key
|
|
8206
|
+
// );
|
|
8207
|
+
// if (colorAboveTarget) {
|
|
8208
|
+
// return self.chartData.metaData.colorAboveTarget[colorAboveTarget];
|
|
8209
|
+
// }
|
|
8210
|
+
// }
|
|
8211
|
+
// return self.chartData.metaData.colors[d.key];
|
|
8212
|
+
// });
|
|
8213
|
+
// /**
|
|
8214
|
+
// * display angled texts on the bars
|
|
8215
|
+
// */
|
|
8216
|
+
// if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
|
|
8217
|
+
// state
|
|
8218
|
+
// .selectAll('text')
|
|
8219
|
+
// .data(function (d) {
|
|
8220
|
+
// let newList: any = [];
|
|
8221
|
+
// subgroups.map(function (key) {
|
|
8222
|
+
// let obj: any = { key: key, value: d[key], name: d.name };
|
|
8223
|
+
// newList.push(obj);
|
|
8224
|
+
// });
|
|
8225
|
+
// return newList;
|
|
8226
|
+
// })
|
|
8227
|
+
// .enter()
|
|
8228
|
+
// .append('text')
|
|
8229
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8230
|
+
// .attr('x', function (d) {
|
|
8231
|
+
// return 0;
|
|
8232
|
+
// })
|
|
8233
|
+
// .attr('y', function (d) {
|
|
8234
|
+
// return 0;
|
|
8235
|
+
// })
|
|
8236
|
+
// .attr('class', 'lib-data-labels-weeklycharts')
|
|
8237
|
+
// .text(function (d) {
|
|
8238
|
+
// return d.key && d.value
|
|
8239
|
+
// ? d.key.length > 20
|
|
8240
|
+
// ? d.key.substring(0, 17) + '...'
|
|
8241
|
+
// : d.key
|
|
8242
|
+
// : '';
|
|
8243
|
+
// })
|
|
8244
|
+
// .style('fill', function (d) {
|
|
8245
|
+
// return '#000';
|
|
8246
|
+
// })
|
|
8247
|
+
// .style('font-weight', 'bold')
|
|
8248
|
+
// .style('font-size', function (d) {
|
|
8249
|
+
// if (self.isZoomedOut) {
|
|
8250
|
+
// return '9px'; // 👈 Zoomed out mode
|
|
8251
|
+
// }
|
|
8252
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8253
|
+
// if (window.innerWidth > 1900) {
|
|
8254
|
+
// return '18px';
|
|
8255
|
+
// } else if (window.innerWidth < 1400) {
|
|
8256
|
+
// return '10px';
|
|
8257
|
+
// } else {
|
|
8258
|
+
// return '14px';
|
|
8259
|
+
// }
|
|
8260
|
+
// } else {
|
|
8261
|
+
// return '14px';
|
|
8262
|
+
// }
|
|
8263
|
+
// })
|
|
8264
|
+
// .attr('transform', function (d) {
|
|
8265
|
+
// data.map((indiv: any) => {
|
|
8266
|
+
// if (indiv.name == d.name) {
|
|
8267
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8268
|
+
// var temp;
|
|
8269
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8270
|
+
// if (x.bandwidth() > 100) {
|
|
8271
|
+
// if (self.chartData.data.length == 1) {
|
|
8272
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8273
|
+
// tempScale.range([
|
|
8274
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8275
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8276
|
+
// ]);
|
|
8277
|
+
// // .padding(0.05);
|
|
8278
|
+
// } else
|
|
8279
|
+
// tempScale.range([
|
|
8280
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8281
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8282
|
+
// ]);
|
|
8283
|
+
// // .padding(0.05);
|
|
8284
|
+
// } else
|
|
8285
|
+
// tempScale.range([
|
|
8286
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8287
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8288
|
+
// ]);
|
|
8289
|
+
// }
|
|
8290
|
+
// }
|
|
8291
|
+
// });
|
|
8292
|
+
// /**
|
|
8293
|
+
// * if set, then all texts ll be horizontal
|
|
8294
|
+
// */
|
|
8295
|
+
// if (self.chartConfiguration.textAlwaysHorizontal) {
|
|
8296
|
+
// return (
|
|
8297
|
+
// 'translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')'
|
|
8298
|
+
// );
|
|
8299
|
+
// }
|
|
8300
|
+
// /**
|
|
8301
|
+
// * rotate texts having more than one digits
|
|
8302
|
+
// */
|
|
8303
|
+
// // if (d.value > 9)
|
|
8304
|
+
// if (!isNaN(tempScale(d.key)))
|
|
8305
|
+
// return (
|
|
8306
|
+
// 'translate(' +
|
|
8307
|
+
// (tempScale(d.key) + tempScale.bandwidth() * 0.55) +
|
|
8308
|
+
// ',' +
|
|
8309
|
+
// (y(0) - 10) +
|
|
8310
|
+
// ') rotate(270)'
|
|
8311
|
+
// );
|
|
8312
|
+
// return 'translate(0,0)';
|
|
8313
|
+
// // else
|
|
8314
|
+
// // return (
|
|
8315
|
+
// // 'translate(' +
|
|
8316
|
+
// // (tempScale(d.key) + tempScale.bandwidth() / 2) +
|
|
8317
|
+
// // ',' +
|
|
8318
|
+
// // y(0) +
|
|
8319
|
+
// // ')'
|
|
8320
|
+
// // );
|
|
8321
|
+
// })
|
|
8322
|
+
// .on('click', function (d) {
|
|
8323
|
+
// if (
|
|
8324
|
+
// !metaData.barWithoutClick ||
|
|
8325
|
+
// !metaData.barWithoutClick.length ||
|
|
8326
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8327
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8328
|
+
// )
|
|
8329
|
+
// self.handleClick(d);
|
|
8330
|
+
// });
|
|
8331
|
+
// if (!isria) {
|
|
8332
|
+
// state
|
|
8333
|
+
// .selectAll('.lib-data-labels-weeklycharts')
|
|
8334
|
+
// .on('mouseout', handleMouseOut)
|
|
8335
|
+
// .on('mouseover', handleMouseOver);
|
|
8336
|
+
// }
|
|
8337
|
+
// }
|
|
8338
|
+
// if (this.chartConfiguration.displayTitleOnTop || (
|
|
8339
|
+
// this.chartConfiguration.textsOnBar == undefined &&
|
|
8340
|
+
// this.chartConfiguration.displayTitleOnTop == undefined
|
|
8341
|
+
// )) {
|
|
8342
|
+
// if (!isria) {
|
|
8343
|
+
// state
|
|
8344
|
+
// .selectAll('rect')
|
|
8345
|
+
// .on('mouseout', handleMouseOut)
|
|
8346
|
+
// .on('mouseover', handleMouseOver);
|
|
8347
|
+
// }
|
|
8348
|
+
// }
|
|
8349
|
+
// function handleMouseOver(d, i) {
|
|
8350
|
+
// svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
8351
|
+
// svg
|
|
8352
|
+
// .append('foreignObject')
|
|
8353
|
+
// .attr('x', function () {
|
|
8354
|
+
// // ...existing code for tempScale calculation...
|
|
8355
|
+
// var elementsCounter;
|
|
8356
|
+
// data.map((indiv: any) => {
|
|
8357
|
+
// if (indiv.name == d.name) {
|
|
8358
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8359
|
+
// elementsCounter = keys.length;
|
|
8360
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8361
|
+
// if (x.bandwidth() > 100) {
|
|
8362
|
+
// if (self.chartData.data.length == 1) {
|
|
8363
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8364
|
+
// tempScale.range([
|
|
8365
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8366
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8367
|
+
// ]);
|
|
8368
|
+
// } else
|
|
8369
|
+
// tempScale.range([
|
|
8370
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8371
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8372
|
+
// ]);
|
|
8373
|
+
// } else
|
|
8374
|
+
// tempScale.range([
|
|
8375
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8376
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8377
|
+
// ]);
|
|
8378
|
+
// }
|
|
8379
|
+
// }
|
|
8380
|
+
// });
|
|
8381
|
+
// if (metaData.hasDrillDown) {
|
|
8382
|
+
// if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
8383
|
+
// return (
|
|
8384
|
+
// x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90
|
|
8385
|
+
// );
|
|
8386
|
+
// }
|
|
8387
|
+
// return (
|
|
8388
|
+
// x(d.name) +
|
|
8389
|
+
// tempScale(d.key) -
|
|
8390
|
+
// (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
|
|
8391
|
+
// tempScale.bandwidth() / 2
|
|
8392
|
+
// );
|
|
8393
|
+
// } else return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
|
|
8394
|
+
// })
|
|
8395
|
+
// .attr('class', 'lib-verticalstack-title-ontop')
|
|
8396
|
+
// .attr('y', function () {
|
|
8397
|
+
// return y(d.value) - 3 - 40 - 10;
|
|
8398
|
+
// })
|
|
8399
|
+
// .attr('dy', function () {
|
|
8400
|
+
// return d.class;
|
|
8401
|
+
// })
|
|
8402
|
+
// .attr('width', function () {
|
|
8403
|
+
// data.map((indiv: any) => {
|
|
8404
|
+
// if (indiv.name == d.name) {
|
|
8405
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8406
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8407
|
+
// if (x.bandwidth() > 100) {
|
|
8408
|
+
// if (self.chartData.data.length == 1) {
|
|
8409
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8410
|
+
// tempScale.range([
|
|
8411
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8412
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8413
|
+
// ]);
|
|
8414
|
+
// } else
|
|
8415
|
+
// tempScale.range([
|
|
8416
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8417
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8418
|
+
// ]);
|
|
8419
|
+
// } else
|
|
8420
|
+
// tempScale.range([
|
|
8421
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8422
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8423
|
+
// ]);
|
|
8424
|
+
// }
|
|
8425
|
+
// }
|
|
8426
|
+
// });
|
|
8427
|
+
// if (metaData.hasDrillDown) {
|
|
8428
|
+
// if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
8429
|
+
// return '180px';
|
|
8430
|
+
// }
|
|
8431
|
+
// return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
8432
|
+
// } else return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
8433
|
+
// })
|
|
8434
|
+
// .attr('height', 50)
|
|
8435
|
+
// .append('xhtml:div')
|
|
8436
|
+
// .attr('class', 'title')
|
|
8437
|
+
// .style('z-index', 99)
|
|
8438
|
+
// .html(function () {
|
|
8439
|
+
// let barLabel = d.key;
|
|
8440
|
+
// let dataType = metaData.dataType ? metaData.dataType : '';
|
|
8441
|
+
// let value = d.value;
|
|
8442
|
+
// let desiredText =
|
|
8443
|
+
// '<span class="title-bar-name">' + barLabel + '</span>';
|
|
8444
|
+
// desiredText +=
|
|
8445
|
+
// '<span class="title-bar-value"><span>' +
|
|
8446
|
+
// value +
|
|
8447
|
+
// '</span>' +
|
|
8448
|
+
// dataType +
|
|
8449
|
+
// '</span>';
|
|
8450
|
+
// return desiredText;
|
|
8451
|
+
// });
|
|
8452
|
+
// }
|
|
8453
|
+
// function handleMouseOut(d, i) {
|
|
8454
|
+
// svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
8455
|
+
// }
|
|
8456
|
+
// svg
|
|
8457
|
+
// .append('g')
|
|
8458
|
+
// .attr('class', 'x2 axis2')
|
|
8459
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
8460
|
+
// .style('color', 'var(--chart-axis-color, #000)') // Use CSS variable instead of hardcoded #000
|
|
8461
|
+
// .call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
8462
|
+
// .call((g) => g.select('.domain').attr('fill', 'none'));
|
|
8463
|
+
// svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
8464
|
+
// svg
|
|
8465
|
+
// .append('g')
|
|
8466
|
+
// .attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
8467
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8468
|
+
// .attr('transform', 'translate(0,0)')
|
|
8469
|
+
// .call(y)
|
|
8470
|
+
// .style('display', 'none');
|
|
8471
|
+
// svgYAxisLeft
|
|
8472
|
+
// .append('g')
|
|
8473
|
+
// .append('g')
|
|
8474
|
+
// .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
8475
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8476
|
+
// .attr('transform', 'translate(0,0)')
|
|
8477
|
+
// .call(
|
|
8478
|
+
// d3
|
|
8479
|
+
// .axisLeft(y)
|
|
8480
|
+
// .tickSize(0)
|
|
8481
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
8482
|
+
// .tickFormat(function (d) {
|
|
8483
|
+
// const formatted = self.chartConfiguration.yAxisLabelFomatter
|
|
8484
|
+
// ? self.chartConfiguration.yAxisLabelFomatter(d)
|
|
8485
|
+
// : d;
|
|
8486
|
+
// return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
|
|
8487
|
+
// })
|
|
8488
|
+
// )
|
|
8489
|
+
// .call((g) => {
|
|
8490
|
+
// // Style the domain line for theme support
|
|
8491
|
+
// g.select('.domain')
|
|
8492
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)')
|
|
8493
|
+
// .style('stroke-width', '1px');
|
|
8494
|
+
// })
|
|
8495
|
+
// .selectAll('text')
|
|
8496
|
+
// .style('fill', 'var(--chart-text-color)');
|
|
8497
|
+
// svgYAxisRight
|
|
8498
|
+
// .append('g')
|
|
8499
|
+
// .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
8500
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8501
|
+
// .attr('transform', 'translate(0,0)')
|
|
8502
|
+
// .call(y)
|
|
8503
|
+
// .style('display', 'none');
|
|
8504
|
+
// /**
|
|
8505
|
+
// * hide x axis labels
|
|
8506
|
+
// * config is there for future use
|
|
8507
|
+
// * used by weekly charts
|
|
8508
|
+
// */
|
|
8509
|
+
// if (
|
|
8510
|
+
// this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
8511
|
+
// this.chartConfiguration.isXaxisLabelHidden
|
|
8512
|
+
// ) {
|
|
8513
|
+
// d3.selectAll('g.lib-line-x-axis-text > g > text').attr(
|
|
8514
|
+
// 'class',
|
|
8515
|
+
// 'lib-display-hidden'
|
|
8516
|
+
// );
|
|
8517
|
+
// }
|
|
8518
|
+
// /**
|
|
8519
|
+
// * hide y axis labels
|
|
8520
|
+
// * used by weekly charts
|
|
8521
|
+
// */
|
|
8522
|
+
// if (
|
|
8523
|
+
// this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
8524
|
+
// this.chartConfiguration.isYaxisLabelHidden
|
|
8525
|
+
// ) {
|
|
8526
|
+
// d3.selectAll('.yaxis-dashed > g > text').attr(
|
|
8527
|
+
// 'class',
|
|
8528
|
+
// 'lib-display-hidden'
|
|
8529
|
+
// );
|
|
8530
|
+
// }
|
|
8531
|
+
// /**
|
|
8532
|
+
// * hide y axis labels
|
|
8533
|
+
// * config is there for future use
|
|
8534
|
+
// */
|
|
8535
|
+
// if (
|
|
8536
|
+
// this.chartConfiguration.isYaxisHidden != undefined &&
|
|
8537
|
+
// this.chartConfiguration.isYaxisHidden
|
|
8538
|
+
// ) {
|
|
8539
|
+
// d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
|
|
8540
|
+
// }
|
|
8541
|
+
// /**
|
|
8542
|
+
// * dashed y axis
|
|
8543
|
+
// * used by weekly charts
|
|
8544
|
+
// */
|
|
8545
|
+
// if (
|
|
8546
|
+
// this.chartConfiguration.isYaxisDashed != undefined &&
|
|
8547
|
+
// this.chartConfiguration.isYaxisDashed
|
|
8548
|
+
// ) {
|
|
8549
|
+
// d3.selectAll('.yaxis-dashed')
|
|
8550
|
+
// .style('stroke-dasharray', '5 5')
|
|
8551
|
+
// .style('color', 'var(--chart-axis-color, #999999)'); // Use CSS variable
|
|
8552
|
+
// }
|
|
8553
|
+
// if (lineData != null) {
|
|
8554
|
+
// if (lineData && self.chartConfiguration.showLineChartAxis) {
|
|
8555
|
+
// svgYAxisRight
|
|
8556
|
+
// .append('g')
|
|
8557
|
+
// .attr('class', 'lib-stacked-y-axis-text1')
|
|
8558
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8559
|
+
// .attr('transform', 'translate(' + 0 + ',0)')
|
|
8560
|
+
// .call(yLineAxis);
|
|
8561
|
+
// }
|
|
8562
|
+
// }
|
|
8563
|
+
// /**
|
|
8564
|
+
// * used to display y label
|
|
8565
|
+
// */
|
|
8566
|
+
// // if (this.isZoomedOut) {
|
|
8567
|
+
// // svg
|
|
8568
|
+
// // .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
8569
|
+
// // .attr('class', 'lib-display-hidden');
|
|
8570
|
+
// // }
|
|
8571
|
+
// if (this.isZoomedOut) {
|
|
8572
|
+
// svg
|
|
8573
|
+
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
8574
|
+
// .each((d, i, nodes) => {
|
|
8575
|
+
// const text = d3.select(nodes[i]);
|
|
8576
|
+
// const label = text.text();
|
|
8577
|
+
// if (label.indexOf('\n') > -1) {
|
|
8578
|
+
// const lines = label.split('\n');
|
|
8579
|
+
// text.text(null);
|
|
8580
|
+
// lines.forEach((line, idx) => {
|
|
8581
|
+
// text.append('tspan')
|
|
8582
|
+
// .text(line)
|
|
8583
|
+
// .attr('x', 0)
|
|
8584
|
+
// .attr('dy', idx === 0 ? '1em' : '1.1em');
|
|
8585
|
+
// });
|
|
8586
|
+
// } else {
|
|
8587
|
+
// const words = label.split(' ');
|
|
8588
|
+
// text.text(null);
|
|
8589
|
+
// words.forEach((word, index) => {
|
|
8590
|
+
// text.append('tspan').text(word);
|
|
8591
|
+
// });
|
|
8592
|
+
// }
|
|
8593
|
+
// })
|
|
8594
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
8595
|
+
// .attr('transform', null);
|
|
8596
|
+
// svg
|
|
8597
|
+
// .select('.x-axis')
|
|
8598
|
+
// .attr('transform', `translate(0, ${height - margin.bottom + 10})`);
|
|
8599
|
+
// }
|
|
8600
|
+
// /**
|
|
8601
|
+
// * used to write y labels based on configuration
|
|
8602
|
+
// */
|
|
8603
|
+
// if (metaData.yLabel) {
|
|
8604
|
+
// const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
|
|
8605
|
+
// svgYAxisLeft
|
|
8606
|
+
// .append('text')
|
|
8607
|
+
// .attr('class', 'lib-axis-group-label font-size-1')
|
|
8608
|
+
// .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
8609
|
+
// .attr('transform', 'rotate(-90)')
|
|
8610
|
+
// .attr('y', yPosition)
|
|
8611
|
+
// .attr('x', 0 - height / 2)
|
|
8612
|
+
// .attr('dy', '1em')
|
|
8613
|
+
// .style('text-anchor', 'middle')
|
|
8614
|
+
// .attr('fill', 'var(--chart-text-color)');
|
|
8615
|
+
// if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
8616
|
+
// svgYAxisLeft
|
|
8617
|
+
// .selectAll('.lib-axis-group-label')
|
|
8618
|
+
// .style('font-size', 'smaller')
|
|
8619
|
+
// .text(metaData.yLabel);
|
|
8620
|
+
// } else {
|
|
8621
|
+
// svg
|
|
8622
|
+
// .selectAll('.lib-axis-group-label')
|
|
8623
|
+
// .attr('class', 'lib-ylabel-weeklyCharts')
|
|
8624
|
+
// .text(metaData.yLabel.toLowerCase());
|
|
8625
|
+
// }
|
|
8626
|
+
// }
|
|
8627
|
+
// if (this.chartData.targetLineData) {
|
|
8628
|
+
// const yZero = y(this.chartData.targetLineData.target);
|
|
8629
|
+
// svg
|
|
8630
|
+
// .append('line')
|
|
8631
|
+
// .attr('x1', 0)
|
|
8632
|
+
// .attr('x2', width)
|
|
8633
|
+
// .attr('y1', yZero)
|
|
8634
|
+
// .attr('y2', yZero)
|
|
8635
|
+
// .style('stroke-dasharray', '5 5')
|
|
8636
|
+
// .style('stroke', this.chartData.targetLineData.color);
|
|
8637
|
+
// // svgYAxisRight
|
|
8638
|
+
// // .append('line')
|
|
8639
|
+
// // .attr('x1', 0)
|
|
8640
|
+
// // .attr('x2', rightSvgWidth)
|
|
8641
|
+
// // .attr('y1', yZero)
|
|
8642
|
+
// // .attr('y2', yZero)
|
|
8643
|
+
// // .style('stroke', this.chartData.targetLineData.color);
|
|
8644
|
+
// svgYAxisRight
|
|
8645
|
+
// .append('foreignObject')
|
|
8646
|
+
// .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
|
|
8647
|
+
// .attr('width', rightSvgWidth)
|
|
8648
|
+
// .attr('height', 50)
|
|
8649
|
+
// .append('xhtml:div')
|
|
8650
|
+
// .attr('class', 'target-display')
|
|
8651
|
+
// .style('color', 'var(--chart-text-color)')
|
|
8652
|
+
// .html(function () {
|
|
8653
|
+
// let dataTypeTemp = '';
|
|
8654
|
+
// let targetLineName = 'target';
|
|
8655
|
+
// if (metaData.dataType) {
|
|
8656
|
+
// dataTypeTemp = metaData.dataType;
|
|
8657
|
+
// }
|
|
8658
|
+
// if (
|
|
8659
|
+
// self.chartData.targetLineData &&
|
|
8660
|
+
// self.chartData.targetLineData.targetName
|
|
8661
|
+
// ) {
|
|
8662
|
+
// targetLineName = self.chartData.targetLineData.targetName;
|
|
8663
|
+
// }
|
|
8664
|
+
// return (
|
|
8665
|
+
// `<div>${targetLineName}</div>` +
|
|
8666
|
+
// '<div>' +
|
|
8667
|
+
// self.chartData.targetLineData.target +
|
|
8668
|
+
// '' +
|
|
8669
|
+
// dataTypeTemp +
|
|
8670
|
+
// '</div>'
|
|
8671
|
+
// );
|
|
8672
|
+
// });
|
|
8673
|
+
// }
|
|
8674
|
+
// if (this.chartConfiguration.isDrilldownChart) {
|
|
8675
|
+
// /**
|
|
8676
|
+
// * used by drilldown charts
|
|
8677
|
+
// */
|
|
8678
|
+
// // svg
|
|
8679
|
+
// // .selectAll('.lib-axis-group-label')
|
|
8680
|
+
// // .attr('class', 'lib-ylabel-drilldowncharts')
|
|
8681
|
+
// // .text(metaData.yLabel.toLowerCase());
|
|
8682
|
+
// svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
|
|
8683
|
+
// }
|
|
8684
|
+
// if (metaData.xLabel) {
|
|
8685
|
+
// function isAcronym(label) {
|
|
8686
|
+
// return (
|
|
8687
|
+
// (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
|
|
8688
|
+
// (label === label.toUpperCase() && /[A-Z]/.test(label))
|
|
8689
|
+
// );
|
|
8690
|
+
// }
|
|
8691
|
+
// const xLabelText = metaData.xLabel;
|
|
8692
|
+
// const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
8693
|
+
// const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
|
|
8694
|
+
// svg
|
|
8695
|
+
// .append('text')
|
|
8696
|
+
// .attr('class', function () {
|
|
8697
|
+
// let baseClass = 'lib-axis-group-label font-size-1';
|
|
8698
|
+
// if (self.chartConfiguration.isDrilldownChart)
|
|
8699
|
+
// return baseClass + ' lib-xlabel-drilldowncharts';
|
|
8700
|
+
// if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
8701
|
+
// return baseClass + ' lib-xlabel-weeklyCharts';
|
|
8702
|
+
// return baseClass + ' lib-axis-waterfall-label';
|
|
8703
|
+
// })
|
|
8704
|
+
// .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
8705
|
+
// .attr(
|
|
8706
|
+
// 'transform',
|
|
8707
|
+
// 'translate(' + width / 2 + ' ,' + xPosition + ')'
|
|
8708
|
+
// )
|
|
8709
|
+
// .style('text-anchor', 'middle')
|
|
8710
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
8711
|
+
// .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
8712
|
+
// .style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
8713
|
+
// }
|
|
8714
|
+
// if (metaData.lineyLabel) {
|
|
8715
|
+
// svgYAxisRight
|
|
8716
|
+
// .append('text')
|
|
8717
|
+
// .attr('class', 'lib-axis-group-label lib-line-axis')
|
|
8718
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8719
|
+
// .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
8720
|
+
// .attr('transform', 'translate(0,0) rotate(90)')
|
|
8721
|
+
// .attr('y', 0 - 100)
|
|
8722
|
+
// .attr('x', 0 + 100)
|
|
8723
|
+
// .attr('dy', '5em')
|
|
8724
|
+
// .style('text-anchor', 'middle')
|
|
8725
|
+
// .style('font-size', 'smaller')
|
|
8726
|
+
// .text(metaData.lineyLabel);
|
|
8727
|
+
// }
|
|
8728
|
+
// if (lineData) {
|
|
8729
|
+
// svg
|
|
8730
|
+
// .append('path')
|
|
8731
|
+
// .datum(lineData)
|
|
8732
|
+
// .attr('fill', 'none')
|
|
8733
|
+
// .attr('stroke', self.chartConfiguration.lineGraphColor)
|
|
8734
|
+
// .attr('stroke-width', 1.5)
|
|
8735
|
+
// .attr(
|
|
8736
|
+
// 'd',
|
|
8737
|
+
// d3
|
|
8738
|
+
// .line()
|
|
8739
|
+
// .x(function (d) {
|
|
8740
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8741
|
+
// })
|
|
8742
|
+
// .y(function (d) {
|
|
8743
|
+
// return lineYscale(d.value);
|
|
8744
|
+
// })
|
|
8745
|
+
// );
|
|
8746
|
+
// var dot = svg
|
|
8747
|
+
// .selectAll('myCircles')
|
|
8748
|
+
// .data(lineData)
|
|
8749
|
+
// .enter()
|
|
8750
|
+
// .append('g')
|
|
8751
|
+
// .on('click', function (d) {
|
|
8752
|
+
// if (
|
|
8753
|
+
// !metaData.barWithoutClick ||
|
|
8754
|
+
// !metaData.barWithoutClick.length ||
|
|
8755
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8756
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8757
|
+
// )
|
|
8758
|
+
// self.handleClick(d);
|
|
8759
|
+
// });
|
|
8760
|
+
// dot
|
|
8761
|
+
// .append('circle')
|
|
8762
|
+
// .attr('fill', function (d) {
|
|
8763
|
+
// return self.chartConfiguration.lineGraphColor;
|
|
8764
|
+
// })
|
|
8765
|
+
// .attr('stroke', 'none')
|
|
8766
|
+
// .attr('cx', function (d) {
|
|
8767
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8768
|
+
// })
|
|
8769
|
+
// .attr('cy', function (d) {
|
|
8770
|
+
// return lineYscale(d.value);
|
|
8771
|
+
// })
|
|
8772
|
+
// .style('cursor', () =>
|
|
8773
|
+
// self.chartData.metaData.hasDrillDown ? 'pointer' : 'default'
|
|
8774
|
+
// )
|
|
8775
|
+
// .attr('r', 3);
|
|
8776
|
+
// if (self.chartConfiguration.lineGraphColor) {
|
|
8777
|
+
// dot
|
|
8778
|
+
// .append('text')
|
|
8779
|
+
// .attr('class', 'dot')
|
|
8780
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8781
|
+
// .attr('color', self.chartConfiguration.lineGraphColor)
|
|
8782
|
+
// .attr('style', 'font-size: ' + '.85em')
|
|
8783
|
+
// .attr('x', function (d, i) {
|
|
8784
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8785
|
+
// })
|
|
8786
|
+
// .attr('y', function (d) {
|
|
8787
|
+
// return lineYscale(d.value);
|
|
8788
|
+
// })
|
|
8789
|
+
// .attr('dy', '-1em')
|
|
8790
|
+
// .text(function (d) {
|
|
8791
|
+
// return self.chartConfiguration.labelFormatter(d.value);
|
|
8792
|
+
// });
|
|
8793
|
+
// }
|
|
8794
|
+
// }
|
|
8795
|
+
// }
|
|
7628
8796
|
initializegroupChart() {
|
|
7629
8797
|
// ==================== VARIABLE DECLARATIONS ====================
|
|
7630
8798
|
const self = this;
|
|
@@ -7735,7 +8903,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7735
8903
|
.domain(groups)
|
|
7736
8904
|
.range([0, width - RIGHT_SVG_WIDTH]);
|
|
7737
8905
|
// ==================== X-AXIS RENDERING ====================
|
|
7738
|
-
this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile
|
|
8906
|
+
this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile);
|
|
7739
8907
|
// ==================== Y-AXIS SETUP ====================
|
|
7740
8908
|
const y = d3.scaleLinear().rangeRound([height, 0]);
|
|
7741
8909
|
let maxValue = this.calculateMaxValue(data, keyList);
|
|
@@ -7786,18 +8954,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7786
8954
|
}
|
|
7787
8955
|
}
|
|
7788
8956
|
// ==================== HELPER METHODS ====================
|
|
7789
|
-
renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile
|
|
8957
|
+
renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile) {
|
|
7790
8958
|
let alternate_text = false;
|
|
7791
8959
|
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
7792
8960
|
// Normal ticks for dashboard charts
|
|
7793
|
-
// Dynamically adjust Y translation for mobile
|
|
7794
|
-
let translateY = height;
|
|
7795
|
-
if (isMobile) {
|
|
7796
|
-
translateY = height + 26; // Add extra space at the top for mobile
|
|
7797
|
-
}
|
|
7798
8961
|
svg.append('g')
|
|
7799
8962
|
.attr('class', 'x1 axis1')
|
|
7800
|
-
.attr('transform', `translate(0,${
|
|
8963
|
+
.attr('transform', `translate(0,${height})`)
|
|
7801
8964
|
.call(d3.axisBottom(x))
|
|
7802
8965
|
.call((g) => g.select('.domain').remove());
|
|
7803
8966
|
svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
@@ -7857,7 +9020,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7857
9020
|
.attr('x', 5)
|
|
7858
9021
|
.style('text-anchor', 'middle');
|
|
7859
9022
|
}
|
|
7860
|
-
// Mobile
|
|
9023
|
+
// Mobile override - check for single-group date charts first
|
|
7861
9024
|
if (isMobile) {
|
|
7862
9025
|
const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
|
|
7863
9026
|
const groupsCount = data.length || 0;
|
|
@@ -7886,6 +9049,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7886
9049
|
// Default mobile behavior for non-date or multi-group
|
|
7887
9050
|
textNodes.classed('mobile-xaxis-override', true);
|
|
7888
9051
|
}
|
|
9052
|
+
// If there are many groups on mobile, rotate labels to sideways to
|
|
9053
|
+
// avoid overlapping and make them readable. Use a lower threshold
|
|
9054
|
+
// (3) so even small mobile screens get rotated labels when needed.
|
|
9055
|
+
if (groupsCount > 3) {
|
|
9056
|
+
svg.selectAll('g.x1.axis1 g.tick text')
|
|
9057
|
+
.style('writing-mode', 'sideways-lr')
|
|
9058
|
+
.style('text-anchor', 'middle')
|
|
9059
|
+
.attr('y', 0);
|
|
9060
|
+
}
|
|
7889
9061
|
}
|
|
7890
9062
|
}
|
|
7891
9063
|
applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
|
|
@@ -7950,39 +9122,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7950
9122
|
return baseY;
|
|
7951
9123
|
}
|
|
7952
9124
|
formatXLabelText(d, data, metaData, subgroups, self, isMobile) {
|
|
7953
|
-
// Check if we're on mobile or tablet
|
|
7954
|
-
const isSmallScreen = window.innerWidth < 992; // Less than 992px (mobile or tablet)
|
|
7955
|
-
// Check if label contains both date and week information
|
|
7956
|
-
const hasDateAndTime = (text) => {
|
|
7957
|
-
const dateMatch = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(text) || !isNaN(Date.parse(text));
|
|
7958
|
-
const weekMatch = /week|wk|w\d+/i.test(text);
|
|
7959
|
-
return { isDate: dateMatch, isWeek: weekMatch };
|
|
7960
|
-
};
|
|
7961
|
-
const labelInfo = hasDateAndTime(d);
|
|
7962
|
-
// Apply date-week trimming only for mobile and tablet screens
|
|
7963
|
-
// Mobile: show full date (including year). Tablet: show only month/day.
|
|
7964
|
-
const isMobileScreen = window.innerWidth < 576;
|
|
7965
|
-
const isTabletScreen = window.innerWidth >= 576 && window.innerWidth < 992;
|
|
7966
|
-
if ((isMobileScreen || isTabletScreen) && labelInfo.isDate && labelInfo.isWeek) {
|
|
7967
|
-
const datePartMatch = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
|
|
7968
|
-
if (!datePartMatch)
|
|
7969
|
-
return d;
|
|
7970
|
-
const datePart = datePartMatch[0];
|
|
7971
|
-
if (isTabletScreen) {
|
|
7972
|
-
// Return only MM/DD (handle both YYYY/MM/DD and MM/DD/YYYY)
|
|
7973
|
-
const parts = datePart.split(/[-\/]/);
|
|
7974
|
-
if (parts[0].length === 4) {
|
|
7975
|
-
// YYYY/MM/DD -> MM/DD
|
|
7976
|
-
return `${parts[1]}/${parts[2]}`;
|
|
7977
|
-
}
|
|
7978
|
-
// MM/DD/YYYY -> MM/DD
|
|
7979
|
-
return `${parts[0]}/${parts[1]}`;
|
|
7980
|
-
}
|
|
7981
|
-
// Mobile: return full date including year
|
|
7982
|
-
return datePart;
|
|
7983
|
-
}
|
|
7984
9125
|
// Mobile handling: keep date labels intact for single-series charts (do not trim)
|
|
7985
9126
|
if (isMobile) {
|
|
9127
|
+
const isDateLabel = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(d) || !isNaN(Date.parse(d));
|
|
9128
|
+
if (isDateLabel && subgroups && subgroups.length < 3) {
|
|
9129
|
+
// For single-series charts on mobile, show full date labels (no trimming)
|
|
9130
|
+
return d;
|
|
9131
|
+
}
|
|
7986
9132
|
// If header is hidden (compact mobile), trim non-date labels as before
|
|
7987
9133
|
if (!self.isHeaderVisible) {
|
|
7988
9134
|
const firstPart = d.split(/[\s\-]+/)[0];
|
|
@@ -8000,15 +9146,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8000
9146
|
if (dateRangeRegex.test(d.trim())) {
|
|
8001
9147
|
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
8002
9148
|
}
|
|
8003
|
-
//
|
|
9149
|
+
// Split date and week labels into two lines
|
|
9150
|
+
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
9151
|
+
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
8004
9152
|
if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 &&
|
|
8005
|
-
d.indexOf(' ') > -1 && (
|
|
9153
|
+
d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
|
|
8006
9154
|
const first = d.substring(0, d.indexOf(' '));
|
|
8007
9155
|
const second = d.substring(d.indexOf(' ') + 1).trim();
|
|
8008
9156
|
return `${first}\n${second}`;
|
|
8009
9157
|
}
|
|
8010
9158
|
// Handle date labels in minimized view
|
|
8011
|
-
if (
|
|
9159
|
+
if (isDateLabel) {
|
|
8012
9160
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
8013
9161
|
const first = d.substring(0, d.indexOf(' '));
|
|
8014
9162
|
const second = d.substring(d.indexOf(' ') + 1).trim();
|
|
@@ -8607,7 +9755,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8607
9755
|
// Minimum width per bar group based on device and number of subgroups
|
|
8608
9756
|
const minWidthPerGroup = (() => {
|
|
8609
9757
|
if (subgroupsCount > 2) {
|
|
8610
|
-
return isMobile ?
|
|
9758
|
+
return isMobile ? 80 : isTablet ? 100 : 120; // Wider for multiple subgroups
|
|
8611
9759
|
}
|
|
8612
9760
|
return isMobile ? 40 : isTablet ? 60 : 80; // Normal width for 1-2 subgroups
|
|
8613
9761
|
})();
|