axidio-styleguide-library1-v2 0.2.95 → 0.2.97
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 +151 -197
- package/esm2022/lib/horizontal-grouped-bar-with-scroll-zoom/horizontal-grouped-bar-with-scroll-zoom.component.mjs +1261 -28
- package/fesm2022/axidio-styleguide-library1-v2.mjs +1411 -224
- 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,21 @@ 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
|
+
// Subtract space for fixed Y-axes
|
|
6580
|
+
const leftYAxisWidth = 80;
|
|
6581
|
+
const rightYAxisWidth = this.CONSTANTS.RIGHT_SVG_WIDTH;
|
|
6582
|
+
let width = containerWidth - margin.left - margin.right - leftYAxisWidth - rightYAxisWidth;
|
|
6624
6583
|
let height = containerHeight * (this.chartConfiguration.svgHeight / 100) - margin.top - margin.bottom;
|
|
6625
|
-
//
|
|
6584
|
+
// Fixed zoom handling - same for all resolutions
|
|
6626
6585
|
if (dataLength > this.CONSTANTS.ZOOM_THRESHOLD && this.isZoomedOut) {
|
|
6627
|
-
const minWidth =
|
|
6628
|
-
? dataLength * 12
|
|
6629
|
-
: device.isTablet
|
|
6630
|
-
? dataLength * 20
|
|
6631
|
-
: dataLength * 25;
|
|
6586
|
+
const minWidth = dataLength * 25;
|
|
6632
6587
|
width = Math.max(width, minWidth);
|
|
6633
6588
|
}
|
|
6634
6589
|
if (dataLength > this.CONSTANTS.ZOOM_IN_THRESHOLD && !this.isZoomedOut) {
|
|
6635
|
-
width =
|
|
6636
|
-
? dataLength * 50
|
|
6637
|
-
: device.isTablet
|
|
6638
|
-
? dataLength * 90
|
|
6639
|
-
: dataLength * 130;
|
|
6590
|
+
width = dataLength * 130;
|
|
6640
6591
|
}
|
|
6641
6592
|
if (this.chartConfiguration.isFullScreen) {
|
|
6642
6593
|
height = this.chartConfiguration.svgHeight !== 80
|
|
@@ -6644,28 +6595,44 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6644
6595
|
: containerHeight;
|
|
6645
6596
|
}
|
|
6646
6597
|
if (this.chartConfiguration.isDrilldownChart) {
|
|
6647
|
-
|
|
6648
|
-
height = containerHeight - margin.top - margin.bottom - offset;
|
|
6598
|
+
height = containerHeight - margin.top - margin.bottom - 130;
|
|
6649
6599
|
}
|
|
6600
|
+
// Responsive bar width based on screen size and number of bars
|
|
6601
|
+
const isMobileOrTablet = window.innerWidth < 1024;
|
|
6650
6602
|
let barWidth;
|
|
6651
6603
|
let barPadding;
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6604
|
+
if (isMobileOrTablet) {
|
|
6605
|
+
// Dynamic sizing for mobile/tablet based on number of bars
|
|
6606
|
+
if (dataLength === 1) {
|
|
6607
|
+
barWidth = 60;
|
|
6608
|
+
barPadding = 0;
|
|
6609
|
+
}
|
|
6610
|
+
else if (dataLength === 2) {
|
|
6611
|
+
barWidth = 50;
|
|
6612
|
+
barPadding = 45;
|
|
6613
|
+
}
|
|
6614
|
+
else if (dataLength === 3) {
|
|
6615
|
+
barWidth = 45;
|
|
6616
|
+
barPadding = 40;
|
|
6617
|
+
}
|
|
6618
|
+
else if (dataLength <= 5) {
|
|
6619
|
+
barWidth = 35;
|
|
6620
|
+
barPadding = 30;
|
|
6621
|
+
}
|
|
6622
|
+
else {
|
|
6623
|
+
barWidth = 25;
|
|
6624
|
+
barPadding = 25;
|
|
6625
|
+
}
|
|
6663
6626
|
}
|
|
6664
6627
|
else {
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
}
|
|
6628
|
+
// Desktop: consistent sizing
|
|
6629
|
+
barWidth = this.CONSTANTS.DESKTOP_BAR_WIDTH;
|
|
6630
|
+
barPadding = this.CONSTANTS.BAR_GAP;
|
|
6631
|
+
}
|
|
6632
|
+
// Calculate required SVG width: bars + gaps + side spaces
|
|
6633
|
+
const totalBarsWidth = barWidth * dataLength;
|
|
6634
|
+
const totalGaps = barPadding * (dataLength - 1);
|
|
6635
|
+
const requiredSvgWidth = Math.max(width, totalBarsWidth + totalGaps + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2));
|
|
6669
6636
|
return {
|
|
6670
6637
|
width,
|
|
6671
6638
|
height,
|
|
@@ -6677,39 +6644,56 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6677
6644
|
};
|
|
6678
6645
|
}
|
|
6679
6646
|
createSvgContainers(chartContainer, dimensions, margin) {
|
|
6680
|
-
|
|
6647
|
+
// Create main container with relative positioning
|
|
6648
|
+
const mainContainer = chartContainer
|
|
6681
6649
|
.append('div')
|
|
6682
6650
|
.attr('id', this.uniqueId)
|
|
6683
|
-
.attr('class', '
|
|
6651
|
+
.attr('class', 'chart-main-container')
|
|
6652
|
+
.style('position', 'relative')
|
|
6684
6653
|
.style('width', '100%')
|
|
6685
|
-
.style('height', dimensions.height)
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
.style('margin-left', '10px')
|
|
6689
|
-
.style('padding-right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`);
|
|
6690
|
-
const svgYAxisLeft = outerContainer
|
|
6654
|
+
.style('height', dimensions.height + margin.top + margin.bottom);
|
|
6655
|
+
// Left Y-axis - Fixed position
|
|
6656
|
+
const svgYAxisLeft = mainContainer
|
|
6691
6657
|
.append('svg')
|
|
6692
6658
|
.attr('width', '80')
|
|
6693
6659
|
.attr('height', dimensions.height + margin.top + margin.bottom)
|
|
6660
|
+
.attr('class', 'y-axis-left')
|
|
6694
6661
|
.style('position', 'absolute')
|
|
6695
6662
|
.style('left', '0')
|
|
6696
|
-
.style('
|
|
6663
|
+
.style('top', '0')
|
|
6664
|
+
.style('z-index', '10')
|
|
6665
|
+
.style('background-color', 'var(--card-bg)')
|
|
6697
6666
|
.append('g')
|
|
6698
6667
|
.attr('transform', `translate(${margin.left + 10},${margin.top})`);
|
|
6699
|
-
|
|
6668
|
+
// Right Y-axis - Fixed position
|
|
6669
|
+
const svgYAxisRight = mainContainer
|
|
6700
6670
|
.append('svg')
|
|
6701
6671
|
.attr('width', this.CONSTANTS.RIGHT_SVG_WIDTH)
|
|
6702
6672
|
.attr('height', dimensions.height + margin.top + margin.bottom)
|
|
6673
|
+
.attr('class', 'y-axis-right')
|
|
6703
6674
|
.style('position', 'absolute')
|
|
6704
|
-
.style('right', '
|
|
6705
|
-
.style('
|
|
6675
|
+
.style('right', '0')
|
|
6676
|
+
.style('top', '0')
|
|
6677
|
+
.style('z-index', '10')
|
|
6678
|
+
.style('background-color', 'var(--card-bg)')
|
|
6706
6679
|
.append('g')
|
|
6707
6680
|
.attr('transform', `translate(0,${margin.top})`);
|
|
6681
|
+
// Scrollable container - with padding for fixed Y-axes
|
|
6682
|
+
const outerContainer = mainContainer
|
|
6683
|
+
.append('div')
|
|
6684
|
+
.attr('class', 'outer-container')
|
|
6685
|
+
.style('position', 'absolute')
|
|
6686
|
+
.style('left', '80px') // Space for left Y-axis
|
|
6687
|
+
.style('right', `${this.CONSTANTS.RIGHT_SVG_WIDTH}px`) // Space for right Y-axis
|
|
6688
|
+
.style('top', '0')
|
|
6689
|
+
.style('height', dimensions.height + margin.top + margin.bottom)
|
|
6690
|
+
.style('overflow-x', 'auto')
|
|
6691
|
+
.style('overflow-y', 'hidden');
|
|
6708
6692
|
const innerContainer = outerContainer
|
|
6709
6693
|
.append('div')
|
|
6710
6694
|
.attr('class', 'inner-container')
|
|
6711
6695
|
.style('width', '100%')
|
|
6712
|
-
.style('overflow-x', '
|
|
6696
|
+
.style('overflow-x', 'visible');
|
|
6713
6697
|
const svg = innerContainer
|
|
6714
6698
|
.append('svg')
|
|
6715
6699
|
.attr('width', dimensions.requiredSvgWidth)
|
|
@@ -6718,18 +6702,27 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6718
6702
|
.attr('transform', `translate(0,${margin.top})`);
|
|
6719
6703
|
return { svg, svgYAxisLeft, svgYAxisRight, innerContainer };
|
|
6720
6704
|
}
|
|
6721
|
-
createScales(data, layers, lineData, dimensions
|
|
6705
|
+
createScales(data, layers, lineData, dimensions) {
|
|
6722
6706
|
const { width, height, barWidth, barPadding } = dimensions;
|
|
6723
|
-
//
|
|
6724
|
-
const
|
|
6707
|
+
// Calculate total width needed for all bars with proper spacing
|
|
6708
|
+
const totalBarsWidth = data.length * barWidth;
|
|
6709
|
+
const totalSpacing = (data.length - 1) * barPadding;
|
|
6710
|
+
const requiredWidth = totalBarsWidth + totalSpacing + (this.CONSTANTS.LEFT_RIGHT_SPACES * 2);
|
|
6711
|
+
// Use the larger of container width or required width for proper spacing
|
|
6712
|
+
const effectiveWidth = Math.max(width - this.CONSTANTS.RIGHT_SVG_WIDTH, requiredWidth);
|
|
6713
|
+
// Calculate padding ratio to create exact pixel gaps between bars
|
|
6714
|
+
const totalAvailableSpace = effectiveWidth;
|
|
6715
|
+
const paddingRatio = barPadding / (barWidth + barPadding);
|
|
6725
6716
|
const xScale = d3
|
|
6726
6717
|
.scaleBand()
|
|
6727
6718
|
.rangeRound([
|
|
6728
6719
|
this.CONSTANTS.LEFT_RIGHT_SPACES,
|
|
6729
|
-
|
|
6720
|
+
effectiveWidth + this.CONSTANTS.LEFT_RIGHT_SPACES - this.CONSTANTS.RIGHT_SVG_WIDTH
|
|
6730
6721
|
])
|
|
6731
6722
|
.domain(data.map(d => d.name).reverse())
|
|
6732
|
-
.
|
|
6723
|
+
.paddingInner(paddingRatio)
|
|
6724
|
+
.paddingOuter(0.5)
|
|
6725
|
+
.align(0.5); // Center alignment
|
|
6733
6726
|
const xScaleFromOrigin = d3
|
|
6734
6727
|
.scaleBand()
|
|
6735
6728
|
.rangeRound([width - this.CONSTANTS.RIGHT_SVG_WIDTH, 0])
|
|
@@ -6778,7 +6771,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6778
6771
|
}
|
|
6779
6772
|
return { xAxis, yAxis, yLineAxis };
|
|
6780
6773
|
}
|
|
6781
|
-
renderBars(svg, layers, scales, metaData, dimensions
|
|
6774
|
+
renderBars(svg, layers, scales, metaData, dimensions) {
|
|
6782
6775
|
const layer = svg
|
|
6783
6776
|
.selectAll('.layer')
|
|
6784
6777
|
.data(layers)
|
|
@@ -6790,11 +6783,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6790
6783
|
.selectAll('rect')
|
|
6791
6784
|
.data((d) => d)
|
|
6792
6785
|
.enter();
|
|
6793
|
-
this.appendRectangles(rect, scales, metaData, dimensions
|
|
6786
|
+
this.appendRectangles(rect, scales, metaData, dimensions);
|
|
6794
6787
|
this.addInteractions(rect, svg, metaData, scales);
|
|
6795
6788
|
return rect;
|
|
6796
6789
|
}
|
|
6797
|
-
appendRectangles(rect, scales, metaData, dimensions
|
|
6790
|
+
appendRectangles(rect, scales, metaData, dimensions) {
|
|
6798
6791
|
const { barWidth, barPadding } = dimensions;
|
|
6799
6792
|
const { xScale, yScale } = scales;
|
|
6800
6793
|
rect
|
|
@@ -6813,17 +6806,19 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6813
6806
|
}
|
|
6814
6807
|
return 0;
|
|
6815
6808
|
})
|
|
6816
|
-
.attr('x', (d
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6809
|
+
.attr('x', (d) => {
|
|
6810
|
+
// Center the bar within its bandwidth with proper spacing
|
|
6811
|
+
const xPosition = xScale(d.data.name);
|
|
6812
|
+
const bandwidth = xScale.bandwidth();
|
|
6820
6813
|
if (!this.chartConfiguration.isMultiChartGridLine) {
|
|
6821
|
-
|
|
6814
|
+
// Center the fixed-width bar in the available space
|
|
6815
|
+
return xPosition + (bandwidth - barWidth) / 2;
|
|
6822
6816
|
}
|
|
6823
6817
|
if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
|
|
6824
|
-
return
|
|
6818
|
+
return xPosition + bandwidth / 2 - 35;
|
|
6825
6819
|
}
|
|
6826
|
-
|
|
6820
|
+
const calculatedWidth = bandwidth * 0.8;
|
|
6821
|
+
return xPosition + (bandwidth - calculatedWidth) / 2;
|
|
6827
6822
|
})
|
|
6828
6823
|
.attr('height', (d) => {
|
|
6829
6824
|
if (!isNaN(d[0]) && !isNaN(d[1])) {
|
|
@@ -6833,10 +6828,8 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6833
6828
|
return 0;
|
|
6834
6829
|
})
|
|
6835
6830
|
.attr('width', (d) => {
|
|
6836
|
-
if (device.isMobile)
|
|
6837
|
-
return barWidth;
|
|
6838
6831
|
if (!this.chartConfiguration.isMultiChartGridLine)
|
|
6839
|
-
return
|
|
6832
|
+
return barWidth;
|
|
6840
6833
|
if (this.chartConfiguration.isDrilldownChart && this.chartData.data.length <= 3) {
|
|
6841
6834
|
return 70;
|
|
6842
6835
|
}
|
|
@@ -6892,23 +6885,13 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
6892
6885
|
const value = d[1] - d[0];
|
|
6893
6886
|
if (isNaN(value))
|
|
6894
6887
|
return;
|
|
6895
|
-
const device = this.getDeviceConfig();
|
|
6896
6888
|
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
|
-
}
|
|
6889
|
+
// Fixed tooltip width for all resolutions
|
|
6890
|
+
const width = /week/i.test(d.data.name) && /\d{4}-\d{2}-\d{2}/.test(d.data.name)
|
|
6891
|
+
? '250px'
|
|
6892
|
+
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2 > 180
|
|
6893
|
+
? '180px'
|
|
6894
|
+
: bandwidth + this.CONSTANTS.LEFT_RIGHT_SPACES * 2;
|
|
6912
6895
|
svg
|
|
6913
6896
|
.append('foreignObject')
|
|
6914
6897
|
.attr('x', this.calculateTooltipX(d, xScale, width))
|
|
@@ -7026,8 +7009,10 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7026
7009
|
}
|
|
7027
7010
|
}
|
|
7028
7011
|
initializeStackedChart() {
|
|
7029
|
-
|
|
7030
|
-
this.
|
|
7012
|
+
// Use fixed configuration for all resolutions
|
|
7013
|
+
this.chartConfiguration.margin = { top: 20, right: 20, bottom: 40, left: 40 };
|
|
7014
|
+
this.chartConfiguration.numberOfYTicks = 5;
|
|
7015
|
+
this.chartConfiguration.svgHeight = 70;
|
|
7031
7016
|
this.mergeConfigurations();
|
|
7032
7017
|
this.applyConfigurationFlags();
|
|
7033
7018
|
const data = this.chartData.data;
|
|
@@ -7038,16 +7023,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7038
7023
|
const chartContainer = d3.select(this.containerElt.nativeElement);
|
|
7039
7024
|
const verticalstackedcontainer = d3.select(this.verticalstackedcontainerElt.nativeElement);
|
|
7040
7025
|
const margin = this.chartConfiguration.margin;
|
|
7041
|
-
const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin,
|
|
7026
|
+
const dimensions = this.calculateDimensions(chartContainer, verticalstackedcontainer, margin, data.length);
|
|
7042
7027
|
const { svg, svgYAxisLeft, svgYAxisRight } = this.createSvgContainers(chartContainer, dimensions, margin);
|
|
7043
7028
|
const stack = d3.stack().keys(keyList).offset(d3.stackOffsetNone);
|
|
7044
7029
|
const layers = stack(data);
|
|
7045
7030
|
data.sort((a, b) => b.total - a.total);
|
|
7046
|
-
const scales = this.createScales(data, layers, lineData, dimensions
|
|
7031
|
+
const scales = this.createScales(data, layers, lineData, dimensions);
|
|
7047
7032
|
const axes = this.createAxes(scales);
|
|
7048
7033
|
this.renderGrids(svg, scales, dimensions);
|
|
7049
|
-
const rect = this.renderBars(svg, layers, scales, metaData, dimensions
|
|
7050
|
-
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions,
|
|
7034
|
+
const rect = this.renderBars(svg, layers, scales, metaData, dimensions);
|
|
7035
|
+
this.renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data);
|
|
7051
7036
|
this.renderAxisLabels(svg, svgYAxisLeft, metaData, dimensions, margin);
|
|
7052
7037
|
this.renderTargetLine(svg, svgYAxisRight, scales, dimensions, metaData);
|
|
7053
7038
|
this.renderDataLabels(rect, scales, metaData, dimensions);
|
|
@@ -7068,13 +7053,15 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7068
7053
|
svg
|
|
7069
7054
|
.append('g')
|
|
7070
7055
|
.attr('class', 'grid')
|
|
7056
|
+
.attr('transform', `translate(${this.CONSTANTS.LEFT_RIGHT_SPACES},0)`) // Start from left margin
|
|
7071
7057
|
.call(d3
|
|
7072
7058
|
.axisLeft(scales.yScale)
|
|
7073
7059
|
.ticks(this.chartConfiguration.numberOfYTicks)
|
|
7074
|
-
.tickSize(-dimensions.
|
|
7060
|
+
.tickSize(-(dimensions.requiredSvgWidth - this.CONSTANTS.LEFT_RIGHT_SPACES - this.CONSTANTS.RIGHT_SVG_WIDTH)) // Extend only to chart area
|
|
7075
7061
|
.tickFormat(''))
|
|
7076
7062
|
.style('color', 'var(--chart-grid-color)')
|
|
7077
|
-
.style('opacity', '1')
|
|
7063
|
+
.style('opacity', '1')
|
|
7064
|
+
.call((g) => g.select('.domain').remove());
|
|
7078
7065
|
}
|
|
7079
7066
|
if (this.chartConfiguration.xAxisGrid) {
|
|
7080
7067
|
for (let j = 0; j < this.chartConfiguration.xAxisGrid.length; j++) {
|
|
@@ -7082,13 +7069,13 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7082
7069
|
.append('g')
|
|
7083
7070
|
.attr('class', `x${j + 2} axis${j + 2}`)
|
|
7084
7071
|
.style('color', 'var(--chart-grid-color)')
|
|
7085
|
-
.attr('transform', `translate(
|
|
7072
|
+
.attr('transform', `translate(${this.CONSTANTS.LEFT_RIGHT_SPACES},${dimensions.height * this.chartConfiguration.xAxisGrid[j]})`)
|
|
7086
7073
|
.call(d3.axisBottom(scales.xScale).tickSize(0).ticks(5).tickFormat(''))
|
|
7087
7074
|
.style('fill', 'var(--chart-text-color)');
|
|
7088
7075
|
}
|
|
7089
7076
|
}
|
|
7090
7077
|
}
|
|
7091
|
-
renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions,
|
|
7078
|
+
renderAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions, data) {
|
|
7092
7079
|
if (this.chartConfiguration.showXaxisTop) {
|
|
7093
7080
|
svg
|
|
7094
7081
|
.append('g')
|
|
@@ -7098,7 +7085,7 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7098
7085
|
svg.selectAll('.x-axis > g > text').attr('class', 'lib-display-hidden');
|
|
7099
7086
|
}
|
|
7100
7087
|
if (!this.chartConfiguration.isMultiChartGridLine) {
|
|
7101
|
-
this.renderStandardAxes(svg, axes, scales, dimensions,
|
|
7088
|
+
this.renderStandardAxes(svg, axes, scales, dimensions, data);
|
|
7102
7089
|
}
|
|
7103
7090
|
else if (this.chartConfiguration.isDrilldownChart) {
|
|
7104
7091
|
this.renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions);
|
|
@@ -7109,24 +7096,29 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7109
7096
|
this.applyAxisStyling(svg, svgYAxisLeft, svgYAxisRight);
|
|
7110
7097
|
this.applyAxisConfigurations(svg, scales, dimensions, data);
|
|
7111
7098
|
}
|
|
7112
|
-
renderStandardAxes(svg, axes, scales, dimensions,
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7099
|
+
renderStandardAxes(svg, axes, scales, dimensions, data) {
|
|
7100
|
+
const isMobileOrTablet = window.innerWidth < 1024;
|
|
7101
|
+
svg
|
|
7102
|
+
.append('g')
|
|
7103
|
+
.attr('transform', `translate(0,${dimensions.height})`)
|
|
7104
|
+
.attr('class', 'lib-stacked-x-axis-text')
|
|
7105
|
+
.call(axes.xAxis)
|
|
7106
|
+
.selectAll('text')
|
|
7107
|
+
.style('fill', 'var(--chart-text-color)')
|
|
7108
|
+
.style('font-size', isMobileOrTablet ? '10px' : '12px')
|
|
7109
|
+
.attr('text-anchor', 'middle')
|
|
7110
|
+
.attr('dx', '0')
|
|
7111
|
+
.attr('dy', '0.71em')
|
|
7112
|
+
.attr('transform', null)
|
|
7113
|
+
.each(function () {
|
|
7114
|
+
// Ensure X-axis labels are centered and don't overlap
|
|
7115
|
+
const textElement = d3.select(this);
|
|
7116
|
+
const text = textElement.text();
|
|
7117
|
+
if (isMobileOrTablet && text.length > 10) {
|
|
7118
|
+
// Truncate long labels on mobile/tablet
|
|
7119
|
+
textElement.text(text.substring(0, 8) + '...');
|
|
7120
|
+
}
|
|
7121
|
+
});
|
|
7130
7122
|
svg
|
|
7131
7123
|
.append('g')
|
|
7132
7124
|
.attr('class', 'lib-stacked-y-axis-text')
|
|
@@ -7135,27 +7127,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7135
7127
|
.selectAll('text')
|
|
7136
7128
|
.style('fill', 'var(--chart-text-color)');
|
|
7137
7129
|
}
|
|
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
7130
|
renderDrilldownAxes(svg, svgYAxisLeft, svgYAxisRight, axes, scales, dimensions) {
|
|
7160
7131
|
svg
|
|
7161
7132
|
.append('g')
|
|
@@ -7237,7 +7208,6 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7237
7208
|
}
|
|
7238
7209
|
}
|
|
7239
7210
|
renderCustomXAxis(svg, scales, dimensions, data) {
|
|
7240
|
-
const device = this.getDeviceConfig();
|
|
7241
7211
|
svg
|
|
7242
7212
|
.append('g')
|
|
7243
7213
|
.attr('class', 'x1 axis1')
|
|
@@ -7245,12 +7215,12 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7245
7215
|
.style('color', '#000')
|
|
7246
7216
|
.call(d3.axisBottom(scales.xScale).tickSize(0))
|
|
7247
7217
|
.call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7248
|
-
this.styleCustomXAxisTicks(svg, data
|
|
7218
|
+
this.styleCustomXAxisTicks(svg, data);
|
|
7249
7219
|
if (this.chartConfiguration.xLabelsOnSameLine) {
|
|
7250
|
-
this.applyXLabelsOnSameLine(svg
|
|
7220
|
+
this.applyXLabelsOnSameLine(svg);
|
|
7251
7221
|
}
|
|
7252
7222
|
}
|
|
7253
|
-
styleCustomXAxisTicks(svg, data
|
|
7223
|
+
styleCustomXAxisTicks(svg, data) {
|
|
7254
7224
|
let alternateText = false;
|
|
7255
7225
|
svg.selectAll('.x1.axis1 .tick line').attr('y2', () => {
|
|
7256
7226
|
if (this.chartConfiguration.hideXaxisTick)
|
|
@@ -7282,28 +7252,17 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7282
7252
|
return this.CONSTANTS.SHORT_TICK_LENGTH_BG;
|
|
7283
7253
|
});
|
|
7284
7254
|
}
|
|
7285
|
-
applyXLabelsOnSameLine(svg
|
|
7255
|
+
applyXLabelsOnSameLine(svg) {
|
|
7286
7256
|
svg
|
|
7287
7257
|
.selectAll('g.x1.axis1 g.tick text')
|
|
7288
7258
|
.attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7289
7259
|
.attr('y', this.CONSTANTS.SHORT_TICK_LENGTH_BG)
|
|
7290
7260
|
.text((d) => {
|
|
7291
|
-
if (device.isMobile) {
|
|
7292
|
-
return d.split(' ')[0].substring(0, 3);
|
|
7293
|
-
}
|
|
7294
7261
|
const trimmed = d.trim();
|
|
7295
7262
|
const spaceIndex = trimmed.indexOf(' ');
|
|
7296
7263
|
return spaceIndex > -1
|
|
7297
7264
|
? trimmed.substring(0, spaceIndex).toLowerCase()
|
|
7298
7265
|
: 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
7266
|
});
|
|
7308
7267
|
svg
|
|
7309
7268
|
.selectAll('g.x1.axis1 g.tick')
|
|
@@ -7312,16 +7271,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7312
7271
|
.attr('y', this.CONSTANTS.LONG_TICK_LENGTH_BG)
|
|
7313
7272
|
.attr('fill', 'currentColor')
|
|
7314
7273
|
.text((d) => {
|
|
7315
|
-
if (device.isMobile)
|
|
7316
|
-
return '';
|
|
7317
7274
|
const trimmed = d.trim();
|
|
7318
7275
|
const spaceIndex = trimmed.indexOf(' ');
|
|
7319
7276
|
return spaceIndex > -1
|
|
7320
7277
|
? trimmed.substring(spaceIndex).toLowerCase()
|
|
7321
7278
|
: '';
|
|
7322
|
-
})
|
|
7323
|
-
.attr('transform', (d, i) => {
|
|
7324
|
-
return device.isMobile && i === 0 ? 'translate(20,0)' : null;
|
|
7325
7279
|
});
|
|
7326
7280
|
}
|
|
7327
7281
|
renderDataLabels(rect, scales, metaData, dimensions) {
|
|
@@ -7512,11 +7466,11 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7512
7466
|
this.isZoomOutSelected(isZoomOut);
|
|
7513
7467
|
}
|
|
7514
7468
|
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 }); }
|
|
7469
|
+
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}.chart-main-container{position:relative;width:100%}.y-axis-left,.y-axis-right{pointer-events:none}.outer-container::-webkit-scrollbar{height:8px}.outer-container::-webkit-scrollbar-track{background:#f1f1f1}.outer-container::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.outer-container::-webkit-scrollbar-thumb:hover{background:#555}\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
7470
|
}
|
|
7517
7471
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HorizontalBarsWithScrollZoomComponent, decorators: [{
|
|
7518
7472
|
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"] }]
|
|
7473
|
+
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}.chart-main-container{position:relative;width:100%}.y-axis-left,.y-axis-right{pointer-events:none}.outer-container::-webkit-scrollbar{height:8px}.outer-container::-webkit-scrollbar-track{background:#f1f1f1}.outer-container::-webkit-scrollbar-thumb{background:#888;border-radius:4px}.outer-container::-webkit-scrollbar-thumb:hover{background:#555}\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
7474
|
}], ctorParameters: () => [], propDecorators: { containerElt: [{
|
|
7521
7475
|
type: ViewChild,
|
|
7522
7476
|
args: ['verticalstackedchartcontainer', { static: true }]
|
|
@@ -7625,6 +7579,1242 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7625
7579
|
get isAlertEnabled() {
|
|
7626
7580
|
return this.chartConfiguration?.headerMenuOptions?.some((option) => option.id === 'editAlert');
|
|
7627
7581
|
}
|
|
7582
|
+
// initializegroupChart() {
|
|
7583
|
+
// var self = this;
|
|
7584
|
+
// let data = [];
|
|
7585
|
+
// let metaData: any = null;
|
|
7586
|
+
// let keyList = null;
|
|
7587
|
+
// let lineData = null;
|
|
7588
|
+
// let colorMap = {};
|
|
7589
|
+
// var formatFromBackend;
|
|
7590
|
+
// var formatForHugeNumbers;
|
|
7591
|
+
// const isMobile = window.innerWidth < 576;
|
|
7592
|
+
// const isTablet = window.innerWidth >= 576 && window.innerWidth < 992;
|
|
7593
|
+
// const isDesktop = window.innerWidth >= 992;
|
|
7594
|
+
// let isria = this.customChartConfiguration.isRia
|
|
7595
|
+
// var x: any;
|
|
7596
|
+
// var alternate_text = false;
|
|
7597
|
+
// var short_tick_length = 4;
|
|
7598
|
+
// var long_tick_length = 16;
|
|
7599
|
+
// /**
|
|
7600
|
+
// * longer tick length needed for weekly charts
|
|
7601
|
+
// */
|
|
7602
|
+
// var short_tick_length_bg = 5;
|
|
7603
|
+
// var long_tick_length_bg = 30;
|
|
7604
|
+
// var leftAndRightSpaces = 50;
|
|
7605
|
+
// var rightSvgWidth = 60;
|
|
7606
|
+
// var tempScale;
|
|
7607
|
+
// for (var i in this.defaultConfiguration) {
|
|
7608
|
+
// this.chartConfiguration[i] = ChartHelper.getValueByConfigurationType(
|
|
7609
|
+
// i,
|
|
7610
|
+
// this.defaultConfiguration,
|
|
7611
|
+
// this.customChartConfiguration
|
|
7612
|
+
// );
|
|
7613
|
+
// }
|
|
7614
|
+
// data = this.chartData.data;
|
|
7615
|
+
// metaData = this.chartData.metaData;
|
|
7616
|
+
// lineData = this.chartData.lineData;
|
|
7617
|
+
// // if (lineData || this.chartData.targetLineData) {
|
|
7618
|
+
// // rightSvgWidth = 60;
|
|
7619
|
+
// // }
|
|
7620
|
+
// if (!metaData.colorAboveTarget) {
|
|
7621
|
+
// metaData['colorAboveTarget'] = metaData.colors;
|
|
7622
|
+
// }
|
|
7623
|
+
// colorMap = metaData.colors;
|
|
7624
|
+
// keyList = metaData.keyList;
|
|
7625
|
+
// var chartContainer = d3.select(this.containerElt.nativeElement);
|
|
7626
|
+
// var verticalstackedcontainer = d3.select(
|
|
7627
|
+
// this.groupcontainerElt.nativeElement
|
|
7628
|
+
// );
|
|
7629
|
+
// var margin = this.chartConfiguration.margin;
|
|
7630
|
+
// const { width, height } = this.calculateChartDimensions(
|
|
7631
|
+
// chartContainer,
|
|
7632
|
+
// verticalstackedcontainer,
|
|
7633
|
+
// margin,
|
|
7634
|
+
// self
|
|
7635
|
+
// );
|
|
7636
|
+
// /**
|
|
7637
|
+
// * for hiding header
|
|
7638
|
+
// * used by weekly charts
|
|
7639
|
+
// */
|
|
7640
|
+
// if (this.chartConfiguration.isHeaderVisible != undefined)
|
|
7641
|
+
// this.isHeaderVisible = this.chartConfiguration.isHeaderVisible;
|
|
7642
|
+
// /**
|
|
7643
|
+
// * for hiding legends
|
|
7644
|
+
// * used by weekly charts
|
|
7645
|
+
// */
|
|
7646
|
+
// if (this.chartConfiguration.legendVisible != undefined) {
|
|
7647
|
+
// this.legendVisible = this.chartConfiguration.legendVisible;
|
|
7648
|
+
// }
|
|
7649
|
+
// /**
|
|
7650
|
+
// * for removing background color so that it can take parents color
|
|
7651
|
+
// *
|
|
7652
|
+
// */
|
|
7653
|
+
// if (this.chartConfiguration.isTransparentBackground != undefined) {
|
|
7654
|
+
// this.isTransparentBackground =
|
|
7655
|
+
// this.chartConfiguration.isTransparentBackground;
|
|
7656
|
+
// }
|
|
7657
|
+
// /**
|
|
7658
|
+
// * format data values based on configuration received
|
|
7659
|
+
// */
|
|
7660
|
+
// if (this.chartConfiguration.textFormatter != undefined) {
|
|
7661
|
+
// formatFromBackend = ChartHelper.dataValueFormatter(
|
|
7662
|
+
// this.chartConfiguration.textFormatter
|
|
7663
|
+
// );
|
|
7664
|
+
// formatForHugeNumbers = ChartHelper.dataValueFormatter('.2s');
|
|
7665
|
+
// }
|
|
7666
|
+
// const {
|
|
7667
|
+
// outerContainer,
|
|
7668
|
+
// svgYAxisLeft,
|
|
7669
|
+
// svgYAxisRight,
|
|
7670
|
+
// innerContainer,
|
|
7671
|
+
// svg
|
|
7672
|
+
// } = this.createChartContainers(chartContainer, margin, height, rightSvgWidth, self, width);
|
|
7673
|
+
// var subgroups: any = keyList;
|
|
7674
|
+
// var groups = d3
|
|
7675
|
+
// .map(data, function (d) {
|
|
7676
|
+
// return d.name;
|
|
7677
|
+
// })
|
|
7678
|
+
// .keys();
|
|
7679
|
+
// /**
|
|
7680
|
+
// * x axis range made similar to line chart or vertical stack so that all the charts will get aligned with each other.
|
|
7681
|
+
// */
|
|
7682
|
+
// if (this.chartConfiguration.isMultiChartGridLine != undefined) {
|
|
7683
|
+
// x = d3
|
|
7684
|
+
// .scaleBand()
|
|
7685
|
+
// .rangeRound([width, 0])
|
|
7686
|
+
// .align(0.5)
|
|
7687
|
+
// .padding([0.5])
|
|
7688
|
+
// .domain(
|
|
7689
|
+
// data.map(function (d: any) {
|
|
7690
|
+
// return d.name.toLowerCase();
|
|
7691
|
+
// })
|
|
7692
|
+
// );
|
|
7693
|
+
// } else {
|
|
7694
|
+
// x = d3
|
|
7695
|
+
// .scaleBand()
|
|
7696
|
+
// .domain(groups)
|
|
7697
|
+
// .range([leftAndRightSpaces, width - rightSvgWidth - leftAndRightSpaces])
|
|
7698
|
+
// .padding([0.3]);
|
|
7699
|
+
// }
|
|
7700
|
+
// // x.bandwidth(96);
|
|
7701
|
+
// var xScaleFromOrigin = d3
|
|
7702
|
+
// .scaleBand()
|
|
7703
|
+
// .domain(groups)
|
|
7704
|
+
// .range([0, width - rightSvgWidth]);
|
|
7705
|
+
// // .padding([0.2]);
|
|
7706
|
+
// if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
7707
|
+
// /**
|
|
7708
|
+
// * normal ticks for all dashboard charts
|
|
7709
|
+
// */
|
|
7710
|
+
// svg
|
|
7711
|
+
// .append('g')
|
|
7712
|
+
// .attr('class', 'x1 axis1')
|
|
7713
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
7714
|
+
// .call(d3.axisBottom(x))
|
|
7715
|
+
// .call((g) => g.select('.domain').remove());
|
|
7716
|
+
// svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
7717
|
+
// // Only move x-axis labels further down for grouped charts if there is no xLabel
|
|
7718
|
+
// if (subgroups.length > 1 && !metaData.xLabel) {
|
|
7719
|
+
// svg
|
|
7720
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7721
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7722
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
7723
|
+
// .attr('y', 32); // Increase distance from bars (default is ~9)
|
|
7724
|
+
// } else {
|
|
7725
|
+
// svg
|
|
7726
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7727
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7728
|
+
// .style('fill', 'var(--chart-text-color)');
|
|
7729
|
+
// }
|
|
7730
|
+
// }
|
|
7731
|
+
// else {
|
|
7732
|
+
// /**
|
|
7733
|
+
// * bigger ticks for weekly charts and more space from x axis to labels
|
|
7734
|
+
// */
|
|
7735
|
+
// /**
|
|
7736
|
+
// * draw x axis
|
|
7737
|
+
// */
|
|
7738
|
+
// svg
|
|
7739
|
+
// .append('g')
|
|
7740
|
+
// .attr('class', 'x1 axis1')
|
|
7741
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
7742
|
+
// .call(d3.axisBottom(x).tickSize(0))
|
|
7743
|
+
// .call((g) => g.select('.domain').attr('fill', 'none'));
|
|
7744
|
+
// /**
|
|
7745
|
+
// * tick line size in alternate fashion
|
|
7746
|
+
// */
|
|
7747
|
+
// svg.selectAll('g.x1.axis1 g.tick line').attr('y2', function () {
|
|
7748
|
+
// if (
|
|
7749
|
+
// alternate_text &&
|
|
7750
|
+
// self.chartConfiguration.isNoAlternateXaxisText == undefined
|
|
7751
|
+
// ) {
|
|
7752
|
+
// alternate_text = false;
|
|
7753
|
+
// return long_tick_length_bg - 7;
|
|
7754
|
+
// } else {
|
|
7755
|
+
// alternate_text = true;
|
|
7756
|
+
// return short_tick_length_bg - 4;
|
|
7757
|
+
// }
|
|
7758
|
+
// });
|
|
7759
|
+
// /**
|
|
7760
|
+
// * reset the flag so that values can be shown in same alternate fashion
|
|
7761
|
+
// */
|
|
7762
|
+
// alternate_text = false;
|
|
7763
|
+
// /**
|
|
7764
|
+
// * print x-axis label texts
|
|
7765
|
+
// * used by weekly charts
|
|
7766
|
+
// */
|
|
7767
|
+
// svg
|
|
7768
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7769
|
+
// .attr('class', 'lib-xaxis-labels-texts-weeklycharts')
|
|
7770
|
+
// .attr('y', function () {
|
|
7771
|
+
// // Minimize gap in maximized (fullscreen) view for weekly charts
|
|
7772
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7773
|
+
// return short_tick_length_bg;
|
|
7774
|
+
// }
|
|
7775
|
+
// if (alternate_text) {
|
|
7776
|
+
// alternate_text = false;
|
|
7777
|
+
// return long_tick_length_bg;
|
|
7778
|
+
// } else {
|
|
7779
|
+
// alternate_text = true;
|
|
7780
|
+
// return short_tick_length_bg;
|
|
7781
|
+
// }
|
|
7782
|
+
// });
|
|
7783
|
+
// }
|
|
7784
|
+
// if (self.chartConfiguration.xLabelsOnSameLine) {
|
|
7785
|
+
// const xAxisLabels = svg
|
|
7786
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7787
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7788
|
+
// .style('font-size', this.isHeaderVisible ? '18px' : '14px')
|
|
7789
|
+
// .attr('text-anchor', 'middle')
|
|
7790
|
+
// .attr('y', function(d) {
|
|
7791
|
+
// // For grouped bar charts with many bars and xLabel present, only add 5 if the label is a date
|
|
7792
|
+
// if (subgroups.length > 1 && data.length > 8 && metaData.xLabel) {
|
|
7793
|
+
// const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
7794
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7795
|
+
// return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
7796
|
+
// }
|
|
7797
|
+
// return isDateLabel ? short_tick_length_bg + 14 : short_tick_length_bg;
|
|
7798
|
+
// }
|
|
7799
|
+
// // For grouped bar charts with many bars and NO xLabel, add space as before, but reduce in fullscreen
|
|
7800
|
+
// if (subgroups.length > 1 && data.length > 8 && !metaData.xLabel) {
|
|
7801
|
+
// const chartHasExtraBottom = (self.chartConfiguration.margin && self.chartConfiguration.margin.bottom >= 40);
|
|
7802
|
+
// if (self.chartConfiguration.isFullScreen) {
|
|
7803
|
+
// // Reduce extra gap in maximized view
|
|
7804
|
+
// return short_tick_length_bg + 2;
|
|
7805
|
+
// }
|
|
7806
|
+
// return chartHasExtraBottom ? short_tick_length_bg : short_tick_length_bg + 10;
|
|
7807
|
+
// }
|
|
7808
|
+
// // Default/fallback logic for other cases
|
|
7809
|
+
// let baseY = self.isHeaderVisible ? short_tick_length_bg + 25 : short_tick_length_bg;
|
|
7810
|
+
// if (
|
|
7811
|
+
// subgroups.length > 1 &&
|
|
7812
|
+
// !metaData.xLabel &&
|
|
7813
|
+
// (/\d{2,4}[-\/]\d{2}[-\/]\d{2,4}/.test(d) || /\d{2,4}[-\/]\d{2,4}/.test(d))
|
|
7814
|
+
// ) {
|
|
7815
|
+
// baseY = self.isHeaderVisible ? short_tick_length_bg + 15 : short_tick_length_bg + 25;
|
|
7816
|
+
// }
|
|
7817
|
+
// if (/\d{2,4}[-\/]\d{2,4}/.test(d) && d.indexOf(' ') > -1) {
|
|
7818
|
+
// baseY += 4;
|
|
7819
|
+
// }
|
|
7820
|
+
// // In maximized view, reduce baseY slightly for grouped bars
|
|
7821
|
+
// if (self.chartConfiguration.isFullScreen && subgroups.length > 1) {
|
|
7822
|
+
// baseY = Math.max(short_tick_length_bg, baseY - 10);
|
|
7823
|
+
// }
|
|
7824
|
+
// return baseY;
|
|
7825
|
+
// })
|
|
7826
|
+
// .attr('x', function (d) {
|
|
7827
|
+
// if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
7828
|
+
// return 1; // Move first line text slightly to the left in zoom-in view for better alignment
|
|
7829
|
+
// }
|
|
7830
|
+
// return 0; // Default position
|
|
7831
|
+
// })
|
|
7832
|
+
// .text(function (d) {
|
|
7833
|
+
// var isValueToBeIgnored = false;
|
|
7834
|
+
// if (isMobile && !self.isHeaderVisible) {
|
|
7835
|
+
// let firstPart = d.split(/[\s\-]+/)[0];
|
|
7836
|
+
// return firstPart.substring(0, 3).toLowerCase();
|
|
7837
|
+
// }
|
|
7838
|
+
// (data as any[]).map((indiv: any) => {
|
|
7839
|
+
// if (
|
|
7840
|
+
// indiv.name &&
|
|
7841
|
+
// indiv.name.toLowerCase() == d.trim().toLowerCase() &&
|
|
7842
|
+
// indiv[metaData.keyList[0]] == -1
|
|
7843
|
+
// ) {
|
|
7844
|
+
// isValueToBeIgnored = true;
|
|
7845
|
+
// }
|
|
7846
|
+
// });
|
|
7847
|
+
// if (isValueToBeIgnored) {
|
|
7848
|
+
// return '';
|
|
7849
|
+
// }
|
|
7850
|
+
// // Always add space before and after hyphen for date range labels, even when header is visible and label is single line
|
|
7851
|
+
// // Apply for grouped bar charts and single bar charts, header visible, single line
|
|
7852
|
+
// const dateRangeRegex = /(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})\s*-\s*(\d{2,4}[-\/]\d{2}[-\/]\d{2,4})/;
|
|
7853
|
+
// if (dateRangeRegex.test(d.trim())) {
|
|
7854
|
+
// return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
7855
|
+
// }
|
|
7856
|
+
// // Split date and week labels into two lines in grouped bar zoom-in view (and minimized view)
|
|
7857
|
+
// const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
7858
|
+
// const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
7859
|
+
// if (
|
|
7860
|
+
// subgroups.length > 1 && !self.isZoomedOut && data.length > 8 && d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)
|
|
7861
|
+
// ) {
|
|
7862
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7863
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7864
|
+
// return first + '\n' + second;
|
|
7865
|
+
// }
|
|
7866
|
+
// // Also keep previous logic for minimized view
|
|
7867
|
+
// if (isDateLabel) {
|
|
7868
|
+
// if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
7869
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7870
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7871
|
+
// return first + '\n' + second;
|
|
7872
|
+
// } else {
|
|
7873
|
+
// return d;
|
|
7874
|
+
// }
|
|
7875
|
+
// }
|
|
7876
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7877
|
+
// return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
7878
|
+
// }
|
|
7879
|
+
// return d.toLowerCase();
|
|
7880
|
+
// // If label looks like a date (contains digits and - or /)
|
|
7881
|
+
// const isDateLabel2 = /\d{2,4}[-\/]/.test(d);
|
|
7882
|
+
// // Only split date/week labels if there are many grouped bars and header is not visible
|
|
7883
|
+
// if (isDateLabel) {
|
|
7884
|
+
// if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
7885
|
+
// var first = d.substring(0, d.indexOf(' '));
|
|
7886
|
+
// var second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7887
|
+
// return first + '\n' + second;
|
|
7888
|
+
// } else {
|
|
7889
|
+
// return d;
|
|
7890
|
+
// }
|
|
7891
|
+
// }
|
|
7892
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7893
|
+
// return d.trim().substring(0, d.indexOf(' ')).toLowerCase();
|
|
7894
|
+
// }
|
|
7895
|
+
// return d.toLowerCase();
|
|
7896
|
+
// });
|
|
7897
|
+
// // Now apply writing-mode: sideways-lr for grouped charts with date labels in zoomed-out view and many bars
|
|
7898
|
+
// xAxisLabels.each(function(this: SVGTextElement, d: any) {
|
|
7899
|
+
// // Only apply writing-mode for exact date labels, not those containing 'week' or similar
|
|
7900
|
+
// const isDateLabel = /^(\d{2,4}[-\/])?\d{2,4}[-\/]\d{2,4}$/.test(d.trim());
|
|
7901
|
+
// const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
7902
|
+
// if (subgroups.length > 1 && self.isZoomedOut && data.length > 8 && isDateLabel && !isWeekLabel) {
|
|
7903
|
+
// d3.select(this).style('writing-mode', 'sideways-lr');
|
|
7904
|
+
// }
|
|
7905
|
+
// });
|
|
7906
|
+
// if (!isMobile) {
|
|
7907
|
+
// svg
|
|
7908
|
+
// .selectAll('g.x1.axis1 g.tick')
|
|
7909
|
+
// .filter(function (d) {
|
|
7910
|
+
// return !/\d{2,4}[-\/]/.test(d); // Only process non-date labels
|
|
7911
|
+
// })
|
|
7912
|
+
// .append('text')
|
|
7913
|
+
// .attr('class', 'lib-xaxis-labels-texts-drilldown')
|
|
7914
|
+
// .attr('y', long_tick_length_bg)
|
|
7915
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
7916
|
+
// .attr('x', function (d) {
|
|
7917
|
+
// if (self.chartData.data.length > 8 && !self.isZoomedOut) {
|
|
7918
|
+
// return 1; // Move text slightly to the left
|
|
7919
|
+
// }
|
|
7920
|
+
// return 0; // Default position
|
|
7921
|
+
// })
|
|
7922
|
+
// .text(function (d) {
|
|
7923
|
+
// if (d.trim().indexOf(' ') > -1) {
|
|
7924
|
+
// return d.trim().substring(d.indexOf(' '), d.length).toLowerCase();
|
|
7925
|
+
// }
|
|
7926
|
+
// return '';
|
|
7927
|
+
// });
|
|
7928
|
+
// }
|
|
7929
|
+
// }
|
|
7930
|
+
// if (isria && self.chartData.data.length > 8) {
|
|
7931
|
+
// svg
|
|
7932
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7933
|
+
// .classed('mobile-xaxis-override', true)
|
|
7934
|
+
// .text(function (d: string) {
|
|
7935
|
+
// return d.substring(0, 3);
|
|
7936
|
+
// })
|
|
7937
|
+
// .style('font-size', '12px')
|
|
7938
|
+
// .attr('y', 5)
|
|
7939
|
+
// .attr('x', 5)
|
|
7940
|
+
// .style('text-anchor', 'middle');
|
|
7941
|
+
// }
|
|
7942
|
+
// if (isMobile && !this.isHeaderVisible) {
|
|
7943
|
+
// svg
|
|
7944
|
+
// .selectAll('g.x1.axis1 g.tick text')
|
|
7945
|
+
// .classed('mobile-xaxis-override', true);
|
|
7946
|
+
// }
|
|
7947
|
+
// /**y scale for left y axis */
|
|
7948
|
+
// var y = d3.scaleLinear().rangeRound([height, 0]);
|
|
7949
|
+
// var maxValue = d3.max(data, (d) => d3.max(keyList, (key) => +d[key]));
|
|
7950
|
+
// if (maxValue == 0) {
|
|
7951
|
+
// if (this.chartData.targetLineData) {
|
|
7952
|
+
// maxValue = this.chartData.targetLineData.target + 20;
|
|
7953
|
+
// } else {
|
|
7954
|
+
// maxValue = 100;
|
|
7955
|
+
// }
|
|
7956
|
+
// }
|
|
7957
|
+
// if (this.chartConfiguration.customYscale) {
|
|
7958
|
+
// /**
|
|
7959
|
+
// * increase y-scale so that values wont cross or exceed out of range
|
|
7960
|
+
// * used in weekly charts
|
|
7961
|
+
// */
|
|
7962
|
+
// maxValue = maxValue * this.chartConfiguration.customYscale;
|
|
7963
|
+
// }
|
|
7964
|
+
// if (
|
|
7965
|
+
// this.chartData.targetLineData &&
|
|
7966
|
+
// maxValue < this.chartData.targetLineData.target
|
|
7967
|
+
// ) {
|
|
7968
|
+
// maxValue =
|
|
7969
|
+
// maxValue < 10 && this.chartData.targetLineData.target < 10
|
|
7970
|
+
// ? this.chartData.targetLineData.target + 3
|
|
7971
|
+
// : this.chartData.targetLineData.target + 20;
|
|
7972
|
+
// }
|
|
7973
|
+
// y.domain([0, maxValue]).nice();
|
|
7974
|
+
// let lineYscale;
|
|
7975
|
+
// if (lineData != null) {
|
|
7976
|
+
// let maxLineValue = d3.max(lineData, function (d) {
|
|
7977
|
+
// return +d.value;
|
|
7978
|
+
// });
|
|
7979
|
+
// maxLineValue = maxLineValue * this.chartConfiguration.customYscale;
|
|
7980
|
+
// let minLineValue = d3.min(lineData, function (d) {
|
|
7981
|
+
// return +d.value;
|
|
7982
|
+
// });
|
|
7983
|
+
// if (maxLineValue > 0) minLineValue = minLineValue - 3;
|
|
7984
|
+
// if (minLineValue > 0) {
|
|
7985
|
+
// minLineValue = 0;
|
|
7986
|
+
// }
|
|
7987
|
+
// lineYscale = d3
|
|
7988
|
+
// .scaleLinear()
|
|
7989
|
+
// .domain([minLineValue, maxLineValue])
|
|
7990
|
+
// .range([height, minLineValue]);
|
|
7991
|
+
// }
|
|
7992
|
+
// let yLineAxis;
|
|
7993
|
+
// if (lineYscale != null) {
|
|
7994
|
+
// yLineAxis = d3
|
|
7995
|
+
// .axisRight(lineYscale)
|
|
7996
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
7997
|
+
// .tickSize(0)
|
|
7998
|
+
// .tickFormat(self.chartConfiguration.yLineAxisLabelFomatter);
|
|
7999
|
+
// }
|
|
8000
|
+
// /**
|
|
8001
|
+
// * show x-axis grid between labels
|
|
8002
|
+
// * used by weekly charts
|
|
8003
|
+
// */
|
|
8004
|
+
// if (self.chartConfiguration.isXgridBetweenLabels) {
|
|
8005
|
+
// svg
|
|
8006
|
+
// .append('g')
|
|
8007
|
+
// .attr('class', 'grid')
|
|
8008
|
+
// .attr(
|
|
8009
|
+
// 'transform',
|
|
8010
|
+
// 'translate(' + x.bandwidth() / 2 + ',' + height + ')'
|
|
8011
|
+
// )
|
|
8012
|
+
// .call(d3.axisBottom(x).tickSize(-height).tickFormat(''))
|
|
8013
|
+
// .style('stroke-dasharray', '5 5')
|
|
8014
|
+
// .style('color', 'var(--chart-grid-color, #999999)') // Use CSS variable
|
|
8015
|
+
// .call((g) => g.select('.domain').remove());
|
|
8016
|
+
// }
|
|
8017
|
+
// if (this.chartConfiguration.yAxisGrid) {
|
|
8018
|
+
// svg
|
|
8019
|
+
// .append('g')
|
|
8020
|
+
// .call(
|
|
8021
|
+
// d3
|
|
8022
|
+
// .axisLeft(y)
|
|
8023
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
8024
|
+
// .tickSize(-width)
|
|
8025
|
+
// )
|
|
8026
|
+
// .style('color', 'var(--chart-axis-color, #B9B9B9)')
|
|
8027
|
+
// .style('opacity', '0.5')
|
|
8028
|
+
// .call((g) => {
|
|
8029
|
+
// g.select('.domain')
|
|
8030
|
+
// .remove()
|
|
8031
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)'); // Add CSS variable for domain
|
|
8032
|
+
// });
|
|
8033
|
+
// } else {
|
|
8034
|
+
// svg
|
|
8035
|
+
// .append('g')
|
|
8036
|
+
// .call(d3.axisLeft(y).ticks(self.chartConfiguration.numberOfYTicks))
|
|
8037
|
+
// .style('color', 'var(--chart-axis-color, #B9B9B9)')
|
|
8038
|
+
// .style('opacity', '0.5')
|
|
8039
|
+
// .call((g) => {
|
|
8040
|
+
// g.select('.domain')
|
|
8041
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)') // Add CSS variable for domain
|
|
8042
|
+
// .style('stroke-width', '1px'); // Ensure visibility
|
|
8043
|
+
// });
|
|
8044
|
+
// }
|
|
8045
|
+
// var xSubgroup = d3.scaleBand().domain(subgroups);
|
|
8046
|
+
// if (subgroups.length > 1 && !this.isZoomedOut) {
|
|
8047
|
+
// // For grouped bar charts in zoom-in view, use full x.bandwidth() for subgroups
|
|
8048
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8049
|
+
// } else if (subgroups.length === 1 && !this.isZoomedOut) {
|
|
8050
|
+
// // For single-bar (non-grouped) charts in zoom-in view, set bar width to 100 (increased from 80)
|
|
8051
|
+
// xSubgroup.range([0, 100]);
|
|
8052
|
+
// } else if (this.chartConfiguration.isMultiChartGridLine == undefined) {
|
|
8053
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8054
|
+
// } else {
|
|
8055
|
+
// // used to make grouped bars with lesser width as we are not using padding for width
|
|
8056
|
+
// xSubgroup.range([0, x.bandwidth()]);
|
|
8057
|
+
// }
|
|
8058
|
+
// // if (this.chartConfiguration.isDrilldownChart) {
|
|
8059
|
+
// // }
|
|
8060
|
+
// var color = d3
|
|
8061
|
+
// .scaleOrdinal()
|
|
8062
|
+
// .domain(subgroups)
|
|
8063
|
+
// .range(Object.values(metaData.colors));
|
|
8064
|
+
// // var colorAboveTarget = d3
|
|
8065
|
+
// // .scaleOrdinal()
|
|
8066
|
+
// // .domain(subgroups)
|
|
8067
|
+
// // .range(Object.values(metaData.colorAboveTarget));
|
|
8068
|
+
// var state = svg
|
|
8069
|
+
// .append('g')
|
|
8070
|
+
// .selectAll('.state')
|
|
8071
|
+
// .data(data)
|
|
8072
|
+
// .enter()
|
|
8073
|
+
// .append('g')
|
|
8074
|
+
// .attr('transform', function (d) {
|
|
8075
|
+
// return 'translate(' + x(d.name) + ',0)';
|
|
8076
|
+
// });
|
|
8077
|
+
// state
|
|
8078
|
+
// .selectAll('rect')
|
|
8079
|
+
// .data(function (d) {
|
|
8080
|
+
// let newList: any = [];
|
|
8081
|
+
// subgroups.map(function (key) {
|
|
8082
|
+
// // if (key !== "group") {
|
|
8083
|
+
// let obj: any = { key: key, value: d[key], name: d.name };
|
|
8084
|
+
// newList.push(obj);
|
|
8085
|
+
// // }
|
|
8086
|
+
// });
|
|
8087
|
+
// return newList;
|
|
8088
|
+
// })
|
|
8089
|
+
// .enter()
|
|
8090
|
+
// .append('rect')
|
|
8091
|
+
// .attr('class', 'bars')
|
|
8092
|
+
// .on('click', function (d) {
|
|
8093
|
+
// if (d.key != 'Target') {
|
|
8094
|
+
// if (
|
|
8095
|
+
// !metaData.barWithoutClick ||
|
|
8096
|
+
// !metaData.barWithoutClick.length ||
|
|
8097
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8098
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8099
|
+
// )
|
|
8100
|
+
// // self.handleClick(d.data.name);
|
|
8101
|
+
// self.handleClick(d);
|
|
8102
|
+
// }
|
|
8103
|
+
// })
|
|
8104
|
+
// .attr('x', function (d) {
|
|
8105
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8106
|
+
// data.map((indiv: any) => {
|
|
8107
|
+
// if (indiv.name == d.name) {
|
|
8108
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8109
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8110
|
+
// if (x.bandwidth() > 100) {
|
|
8111
|
+
// // Increase bar width a bit in zoom-in view
|
|
8112
|
+
// let reducedBarWidth = 60;
|
|
8113
|
+
// if (!self.isZoomedOut) {
|
|
8114
|
+
// reducedBarWidth = 30;
|
|
8115
|
+
// }
|
|
8116
|
+
// if (self.chartData.data.length == 1) {
|
|
8117
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8118
|
+
// tempScale.range([
|
|
8119
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8120
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8121
|
+
// ]);
|
|
8122
|
+
// } else
|
|
8123
|
+
// tempScale.range([
|
|
8124
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8125
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8126
|
+
// ]);
|
|
8127
|
+
// } else
|
|
8128
|
+
// tempScale.range([
|
|
8129
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8130
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8131
|
+
// ]);
|
|
8132
|
+
// }
|
|
8133
|
+
// }
|
|
8134
|
+
// });
|
|
8135
|
+
// return tempScale(d.key);
|
|
8136
|
+
// }
|
|
8137
|
+
// return xSubgroup(d.key);
|
|
8138
|
+
// })
|
|
8139
|
+
// .attr('y', function (d) {
|
|
8140
|
+
// if (d.value == -1) {
|
|
8141
|
+
// return y(0);
|
|
8142
|
+
// }
|
|
8143
|
+
// if (d.value >= 0) {
|
|
8144
|
+
// const barHeight = height - y(d.value);
|
|
8145
|
+
// const minHeight = self.chartConfiguration.defaultBarHeight || 2;
|
|
8146
|
+
// return barHeight < minHeight ? y(0) - minHeight : y(d.value);
|
|
8147
|
+
// }
|
|
8148
|
+
// return y(0);
|
|
8149
|
+
// })
|
|
8150
|
+
// .attr('width', function (d) {
|
|
8151
|
+
// // For grouped bar charts in zoom-in view, set bar width to 50 for maximum thickness
|
|
8152
|
+
// if (subgroups.length > 1 && !self.isZoomedOut) {
|
|
8153
|
+
// return 50;
|
|
8154
|
+
// }
|
|
8155
|
+
// // For single-bar (non-grouped) charts in zoom-in view, set bar width to 80
|
|
8156
|
+
// if (subgroups.length === 1 && !self.isZoomedOut) {
|
|
8157
|
+
// return 80;
|
|
8158
|
+
// }
|
|
8159
|
+
// let tempScale = d3.scaleBand().domain([]).range([0, 0]);
|
|
8160
|
+
// // Default logic for other chart types
|
|
8161
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8162
|
+
// data.map((indiv: any) => {
|
|
8163
|
+
// if (indiv.name == d.name) {
|
|
8164
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8165
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8166
|
+
// if (x.bandwidth() > 100) {
|
|
8167
|
+
// // Increase bar width a bit in zoom-in view
|
|
8168
|
+
// let reducedBarWidth = 60;
|
|
8169
|
+
// if (!self.isZoomedOut) {
|
|
8170
|
+
// reducedBarWidth = 100;
|
|
8171
|
+
// }
|
|
8172
|
+
// if (self.chartData.data.length == 1) {
|
|
8173
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8174
|
+
// tempScale.range([
|
|
8175
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8176
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8177
|
+
// ]);
|
|
8178
|
+
// } else
|
|
8179
|
+
// tempScale.range([
|
|
8180
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8181
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8182
|
+
// ]);
|
|
8183
|
+
// } else
|
|
8184
|
+
// tempScale.range([
|
|
8185
|
+
// 0 + (x.bandwidth() - reducedBarWidth) / 2,
|
|
8186
|
+
// x.bandwidth() - (x.bandwidth() - reducedBarWidth) / 2,
|
|
8187
|
+
// ]);
|
|
8188
|
+
// }
|
|
8189
|
+
// }
|
|
8190
|
+
// });
|
|
8191
|
+
// return self.isZoomedOut
|
|
8192
|
+
// ? tempScale.bandwidth()
|
|
8193
|
+
// : self.chartData.data.length && self.chartData.data.length > 8
|
|
8194
|
+
// ? tempScale.bandwidth()
|
|
8195
|
+
// : tempScale.bandwidth();
|
|
8196
|
+
// }
|
|
8197
|
+
// return self.isZoomedOut
|
|
8198
|
+
// ? tempScale.bandwidth()
|
|
8199
|
+
// : self.chartData.data.length && self.chartData.data.length > 8
|
|
8200
|
+
// ? tempScale.bandwidth()
|
|
8201
|
+
// : tempScale.bandwidth();
|
|
8202
|
+
// })
|
|
8203
|
+
// .attr('height', function (d) {
|
|
8204
|
+
// if (d.value == -1) {
|
|
8205
|
+
// return height - y(0);
|
|
8206
|
+
// }
|
|
8207
|
+
// if (d.value >= 0) {
|
|
8208
|
+
// const barHeight = height - y(d.value);
|
|
8209
|
+
// const minHeight = self.chartConfiguration.defaultBarHeight || 2;
|
|
8210
|
+
// return Math.max(barHeight, minHeight);
|
|
8211
|
+
// }
|
|
8212
|
+
// return height - y(0);
|
|
8213
|
+
// })
|
|
8214
|
+
// .style('cursor', function (d) {
|
|
8215
|
+
// if (metaData.hasDrillDown && !isria) return 'pointer';
|
|
8216
|
+
// else return 'default';
|
|
8217
|
+
// })
|
|
8218
|
+
// .attr('fill', function (d) {
|
|
8219
|
+
// if (
|
|
8220
|
+
// d.value &&
|
|
8221
|
+
// self.chartData.targetLineData &&
|
|
8222
|
+
// d.value >= parseFloat(self.chartData.targetLineData.target) &&
|
|
8223
|
+
// self.chartData.metaData.colorAboveTarget
|
|
8224
|
+
// ) {
|
|
8225
|
+
// const key = d.key.toLowerCase();
|
|
8226
|
+
// const colorAboveTarget = Object.keys(self.chartData.metaData.colorAboveTarget).find(
|
|
8227
|
+
// k => k.toLowerCase() === key
|
|
8228
|
+
// );
|
|
8229
|
+
// if (colorAboveTarget) {
|
|
8230
|
+
// return self.chartData.metaData.colorAboveTarget[colorAboveTarget];
|
|
8231
|
+
// }
|
|
8232
|
+
// }
|
|
8233
|
+
// return self.chartData.metaData.colors[d.key];
|
|
8234
|
+
// });
|
|
8235
|
+
// /**
|
|
8236
|
+
// * display angled texts on the bars
|
|
8237
|
+
// */
|
|
8238
|
+
// if (this.chartConfiguration.textsOnBar != undefined && !this.isZoomedOut) {
|
|
8239
|
+
// state
|
|
8240
|
+
// .selectAll('text')
|
|
8241
|
+
// .data(function (d) {
|
|
8242
|
+
// let newList: any = [];
|
|
8243
|
+
// subgroups.map(function (key) {
|
|
8244
|
+
// let obj: any = { key: key, value: d[key], name: d.name };
|
|
8245
|
+
// newList.push(obj);
|
|
8246
|
+
// });
|
|
8247
|
+
// return newList;
|
|
8248
|
+
// })
|
|
8249
|
+
// .enter()
|
|
8250
|
+
// .append('text')
|
|
8251
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8252
|
+
// .attr('x', function (d) {
|
|
8253
|
+
// return 0;
|
|
8254
|
+
// })
|
|
8255
|
+
// .attr('y', function (d) {
|
|
8256
|
+
// return 0;
|
|
8257
|
+
// })
|
|
8258
|
+
// .attr('class', 'lib-data-labels-weeklycharts')
|
|
8259
|
+
// .text(function (d) {
|
|
8260
|
+
// return d.key && d.value
|
|
8261
|
+
// ? d.key.length > 20
|
|
8262
|
+
// ? d.key.substring(0, 17) + '...'
|
|
8263
|
+
// : d.key
|
|
8264
|
+
// : '';
|
|
8265
|
+
// })
|
|
8266
|
+
// .style('fill', function (d) {
|
|
8267
|
+
// return '#000';
|
|
8268
|
+
// })
|
|
8269
|
+
// .style('font-weight', 'bold')
|
|
8270
|
+
// .style('font-size', function (d) {
|
|
8271
|
+
// if (self.isZoomedOut) {
|
|
8272
|
+
// return '9px'; // 👈 Zoomed out mode
|
|
8273
|
+
// }
|
|
8274
|
+
// if (self.chartConfiguration.isDrilldownChart) {
|
|
8275
|
+
// if (window.innerWidth > 1900) {
|
|
8276
|
+
// return '18px';
|
|
8277
|
+
// } else if (window.innerWidth < 1400) {
|
|
8278
|
+
// return '10px';
|
|
8279
|
+
// } else {
|
|
8280
|
+
// return '14px';
|
|
8281
|
+
// }
|
|
8282
|
+
// } else {
|
|
8283
|
+
// return '14px';
|
|
8284
|
+
// }
|
|
8285
|
+
// })
|
|
8286
|
+
// .attr('transform', function (d) {
|
|
8287
|
+
// data.map((indiv: any) => {
|
|
8288
|
+
// if (indiv.name == d.name) {
|
|
8289
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8290
|
+
// var temp;
|
|
8291
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8292
|
+
// if (x.bandwidth() > 100) {
|
|
8293
|
+
// if (self.chartData.data.length == 1) {
|
|
8294
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8295
|
+
// tempScale.range([
|
|
8296
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8297
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8298
|
+
// ]);
|
|
8299
|
+
// // .padding(0.05);
|
|
8300
|
+
// } else
|
|
8301
|
+
// tempScale.range([
|
|
8302
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8303
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8304
|
+
// ]);
|
|
8305
|
+
// // .padding(0.05);
|
|
8306
|
+
// } else
|
|
8307
|
+
// tempScale.range([
|
|
8308
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8309
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8310
|
+
// ]);
|
|
8311
|
+
// }
|
|
8312
|
+
// }
|
|
8313
|
+
// });
|
|
8314
|
+
// /**
|
|
8315
|
+
// * if set, then all texts ll be horizontal
|
|
8316
|
+
// */
|
|
8317
|
+
// if (self.chartConfiguration.textAlwaysHorizontal) {
|
|
8318
|
+
// return (
|
|
8319
|
+
// 'translate(' + xSubgroup(d.key) + ',' + (y(d.value) - 3) + ')'
|
|
8320
|
+
// );
|
|
8321
|
+
// }
|
|
8322
|
+
// /**
|
|
8323
|
+
// * rotate texts having more than one digits
|
|
8324
|
+
// */
|
|
8325
|
+
// // if (d.value > 9)
|
|
8326
|
+
// if (!isNaN(tempScale(d.key)))
|
|
8327
|
+
// return (
|
|
8328
|
+
// 'translate(' +
|
|
8329
|
+
// (tempScale(d.key) + tempScale.bandwidth() * 0.55) +
|
|
8330
|
+
// ',' +
|
|
8331
|
+
// (y(0) - 10) +
|
|
8332
|
+
// ') rotate(270)'
|
|
8333
|
+
// );
|
|
8334
|
+
// return 'translate(0,0)';
|
|
8335
|
+
// // else
|
|
8336
|
+
// // return (
|
|
8337
|
+
// // 'translate(' +
|
|
8338
|
+
// // (tempScale(d.key) + tempScale.bandwidth() / 2) +
|
|
8339
|
+
// // ',' +
|
|
8340
|
+
// // y(0) +
|
|
8341
|
+
// // ')'
|
|
8342
|
+
// // );
|
|
8343
|
+
// })
|
|
8344
|
+
// .on('click', function (d) {
|
|
8345
|
+
// if (
|
|
8346
|
+
// !metaData.barWithoutClick ||
|
|
8347
|
+
// !metaData.barWithoutClick.length ||
|
|
8348
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8349
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8350
|
+
// )
|
|
8351
|
+
// self.handleClick(d);
|
|
8352
|
+
// });
|
|
8353
|
+
// if (!isria) {
|
|
8354
|
+
// state
|
|
8355
|
+
// .selectAll('.lib-data-labels-weeklycharts')
|
|
8356
|
+
// .on('mouseout', handleMouseOut)
|
|
8357
|
+
// .on('mouseover', handleMouseOver);
|
|
8358
|
+
// }
|
|
8359
|
+
// }
|
|
8360
|
+
// if (this.chartConfiguration.displayTitleOnTop || (
|
|
8361
|
+
// this.chartConfiguration.textsOnBar == undefined &&
|
|
8362
|
+
// this.chartConfiguration.displayTitleOnTop == undefined
|
|
8363
|
+
// )) {
|
|
8364
|
+
// if (!isria) {
|
|
8365
|
+
// state
|
|
8366
|
+
// .selectAll('rect')
|
|
8367
|
+
// .on('mouseout', handleMouseOut)
|
|
8368
|
+
// .on('mouseover', handleMouseOver);
|
|
8369
|
+
// }
|
|
8370
|
+
// }
|
|
8371
|
+
// function handleMouseOver(d, i) {
|
|
8372
|
+
// svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
8373
|
+
// svg
|
|
8374
|
+
// .append('foreignObject')
|
|
8375
|
+
// .attr('x', function () {
|
|
8376
|
+
// // ...existing code for tempScale calculation...
|
|
8377
|
+
// var elementsCounter;
|
|
8378
|
+
// data.map((indiv: any) => {
|
|
8379
|
+
// if (indiv.name == d.name) {
|
|
8380
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8381
|
+
// elementsCounter = keys.length;
|
|
8382
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8383
|
+
// if (x.bandwidth() > 100) {
|
|
8384
|
+
// if (self.chartData.data.length == 1) {
|
|
8385
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8386
|
+
// tempScale.range([
|
|
8387
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8388
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8389
|
+
// ]);
|
|
8390
|
+
// } else
|
|
8391
|
+
// tempScale.range([
|
|
8392
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8393
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8394
|
+
// ]);
|
|
8395
|
+
// } else
|
|
8396
|
+
// tempScale.range([
|
|
8397
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8398
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8399
|
+
// ]);
|
|
8400
|
+
// }
|
|
8401
|
+
// }
|
|
8402
|
+
// });
|
|
8403
|
+
// if (metaData.hasDrillDown) {
|
|
8404
|
+
// if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
8405
|
+
// return (
|
|
8406
|
+
// x(d.name) + tempScale(d.key) + tempScale.bandwidth() / 2 - 90
|
|
8407
|
+
// );
|
|
8408
|
+
// }
|
|
8409
|
+
// return (
|
|
8410
|
+
// x(d.name) +
|
|
8411
|
+
// tempScale(d.key) -
|
|
8412
|
+
// (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 +
|
|
8413
|
+
// tempScale.bandwidth() / 2
|
|
8414
|
+
// );
|
|
8415
|
+
// } else return x(d.name) + tempScale(d.key) - (tempScale.bandwidth() + leftAndRightSpaces * 2) / 2 + tempScale.bandwidth() / 2;
|
|
8416
|
+
// })
|
|
8417
|
+
// .attr('class', 'lib-verticalstack-title-ontop')
|
|
8418
|
+
// .attr('y', function () {
|
|
8419
|
+
// return y(d.value) - 3 - 40 - 10;
|
|
8420
|
+
// })
|
|
8421
|
+
// .attr('dy', function () {
|
|
8422
|
+
// return d.class;
|
|
8423
|
+
// })
|
|
8424
|
+
// .attr('width', function () {
|
|
8425
|
+
// data.map((indiv: any) => {
|
|
8426
|
+
// if (indiv.name == d.name) {
|
|
8427
|
+
// let keys = Object.keys(indiv).filter((temp, i) => i != 0);
|
|
8428
|
+
// tempScale = d3.scaleBand().domain(keys).range([0, x.bandwidth()]);
|
|
8429
|
+
// if (x.bandwidth() > 100) {
|
|
8430
|
+
// if (self.chartData.data.length == 1) {
|
|
8431
|
+
// if (Object.keys(self.chartData.data[0]).length == 2) {
|
|
8432
|
+
// tempScale.range([
|
|
8433
|
+
// 0 + (x.bandwidth() - 200) / 2,
|
|
8434
|
+
// x.bandwidth() - (x.bandwidth() - 200) / 2,
|
|
8435
|
+
// ]);
|
|
8436
|
+
// } else
|
|
8437
|
+
// tempScale.range([
|
|
8438
|
+
// 0 + (x.bandwidth() - 300) / 2,
|
|
8439
|
+
// x.bandwidth() - (x.bandwidth() - 300) / 2,
|
|
8440
|
+
// ]);
|
|
8441
|
+
// } else
|
|
8442
|
+
// tempScale.range([
|
|
8443
|
+
// 0 + (x.bandwidth() - 125) / 2,
|
|
8444
|
+
// x.bandwidth() - (x.bandwidth() - 125) / 2,
|
|
8445
|
+
// ]);
|
|
8446
|
+
// }
|
|
8447
|
+
// }
|
|
8448
|
+
// });
|
|
8449
|
+
// if (metaData.hasDrillDown) {
|
|
8450
|
+
// if (tempScale.bandwidth() + leftAndRightSpaces * 2 > 180) {
|
|
8451
|
+
// return '180px';
|
|
8452
|
+
// }
|
|
8453
|
+
// return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
8454
|
+
// } else return tempScale.bandwidth() + leftAndRightSpaces * 2;
|
|
8455
|
+
// })
|
|
8456
|
+
// .attr('height', 50)
|
|
8457
|
+
// .append('xhtml:div')
|
|
8458
|
+
// .attr('class', 'title')
|
|
8459
|
+
// .style('z-index', 99)
|
|
8460
|
+
// .html(function () {
|
|
8461
|
+
// let barLabel = d.key;
|
|
8462
|
+
// let dataType = metaData.dataType ? metaData.dataType : '';
|
|
8463
|
+
// let value = d.value;
|
|
8464
|
+
// let desiredText =
|
|
8465
|
+
// '<span class="title-bar-name">' + barLabel + '</span>';
|
|
8466
|
+
// desiredText +=
|
|
8467
|
+
// '<span class="title-bar-value"><span>' +
|
|
8468
|
+
// value +
|
|
8469
|
+
// '</span>' +
|
|
8470
|
+
// dataType +
|
|
8471
|
+
// '</span>';
|
|
8472
|
+
// return desiredText;
|
|
8473
|
+
// });
|
|
8474
|
+
// }
|
|
8475
|
+
// function handleMouseOut(d, i) {
|
|
8476
|
+
// svg.selectAll('.lib-verticalstack-title-ontop').remove();
|
|
8477
|
+
// }
|
|
8478
|
+
// svg
|
|
8479
|
+
// .append('g')
|
|
8480
|
+
// .attr('class', 'x2 axis2')
|
|
8481
|
+
// .attr('transform', 'translate(0,' + height + ')')
|
|
8482
|
+
// .style('color', 'var(--chart-axis-color, #000)') // Use CSS variable instead of hardcoded #000
|
|
8483
|
+
// .call(d3.axisBottom(xScaleFromOrigin).tickSize(0))
|
|
8484
|
+
// .call((g) => g.select('.domain').attr('fill', 'none'));
|
|
8485
|
+
// svg.selectAll('g.x2.axis2 g.tick text').style('display', 'none');
|
|
8486
|
+
// svg
|
|
8487
|
+
// .append('g')
|
|
8488
|
+
// .attr('class', 'lib-stacked-y-axis-text yaxis-dashed')
|
|
8489
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8490
|
+
// .attr('transform', 'translate(0,0)')
|
|
8491
|
+
// .call(y)
|
|
8492
|
+
// .style('display', 'none');
|
|
8493
|
+
// svgYAxisLeft
|
|
8494
|
+
// .append('g')
|
|
8495
|
+
// .append('g')
|
|
8496
|
+
// .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
8497
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8498
|
+
// .attr('transform', 'translate(0,0)')
|
|
8499
|
+
// .call(
|
|
8500
|
+
// d3
|
|
8501
|
+
// .axisLeft(y)
|
|
8502
|
+
// .tickSize(0)
|
|
8503
|
+
// .ticks(self.chartConfiguration.numberOfYTicks)
|
|
8504
|
+
// .tickFormat(function (d) {
|
|
8505
|
+
// const formatted = self.chartConfiguration.yAxisLabelFomatter
|
|
8506
|
+
// ? self.chartConfiguration.yAxisLabelFomatter(d)
|
|
8507
|
+
// : d;
|
|
8508
|
+
// return formatted >= 1000 ? formatted / 1000 + 'k' : formatted;
|
|
8509
|
+
// })
|
|
8510
|
+
// )
|
|
8511
|
+
// .call((g) => {
|
|
8512
|
+
// // Style the domain line for theme support
|
|
8513
|
+
// g.select('.domain')
|
|
8514
|
+
// .style('stroke', 'var(--chart-domain-color, #000000)')
|
|
8515
|
+
// .style('stroke-width', '1px');
|
|
8516
|
+
// })
|
|
8517
|
+
// .selectAll('text')
|
|
8518
|
+
// .style('fill', 'var(--chart-text-color)');
|
|
8519
|
+
// svgYAxisRight
|
|
8520
|
+
// .append('g')
|
|
8521
|
+
// .attr('class', 'lib-yaxis-labels-texts-drilldown yaxis-dashed')
|
|
8522
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8523
|
+
// .attr('transform', 'translate(0,0)')
|
|
8524
|
+
// .call(y)
|
|
8525
|
+
// .style('display', 'none');
|
|
8526
|
+
// /**
|
|
8527
|
+
// * hide x axis labels
|
|
8528
|
+
// * config is there for future use
|
|
8529
|
+
// * used by weekly charts
|
|
8530
|
+
// */
|
|
8531
|
+
// if (
|
|
8532
|
+
// this.chartConfiguration.isXaxisLabelHidden != undefined &&
|
|
8533
|
+
// this.chartConfiguration.isXaxisLabelHidden
|
|
8534
|
+
// ) {
|
|
8535
|
+
// d3.selectAll('g.lib-line-x-axis-text > g > text').attr(
|
|
8536
|
+
// 'class',
|
|
8537
|
+
// 'lib-display-hidden'
|
|
8538
|
+
// );
|
|
8539
|
+
// }
|
|
8540
|
+
// /**
|
|
8541
|
+
// * hide y axis labels
|
|
8542
|
+
// * used by weekly charts
|
|
8543
|
+
// */
|
|
8544
|
+
// if (
|
|
8545
|
+
// this.chartConfiguration.isYaxisLabelHidden != undefined &&
|
|
8546
|
+
// this.chartConfiguration.isYaxisLabelHidden
|
|
8547
|
+
// ) {
|
|
8548
|
+
// d3.selectAll('.yaxis-dashed > g > text').attr(
|
|
8549
|
+
// 'class',
|
|
8550
|
+
// 'lib-display-hidden'
|
|
8551
|
+
// );
|
|
8552
|
+
// }
|
|
8553
|
+
// /**
|
|
8554
|
+
// * hide y axis labels
|
|
8555
|
+
// * config is there for future use
|
|
8556
|
+
// */
|
|
8557
|
+
// if (
|
|
8558
|
+
// this.chartConfiguration.isYaxisHidden != undefined &&
|
|
8559
|
+
// this.chartConfiguration.isYaxisHidden
|
|
8560
|
+
// ) {
|
|
8561
|
+
// d3.selectAll('.yaxis-dashed').attr('class', 'lib-display-hidden');
|
|
8562
|
+
// }
|
|
8563
|
+
// /**
|
|
8564
|
+
// * dashed y axis
|
|
8565
|
+
// * used by weekly charts
|
|
8566
|
+
// */
|
|
8567
|
+
// if (
|
|
8568
|
+
// this.chartConfiguration.isYaxisDashed != undefined &&
|
|
8569
|
+
// this.chartConfiguration.isYaxisDashed
|
|
8570
|
+
// ) {
|
|
8571
|
+
// d3.selectAll('.yaxis-dashed')
|
|
8572
|
+
// .style('stroke-dasharray', '5 5')
|
|
8573
|
+
// .style('color', 'var(--chart-axis-color, #999999)'); // Use CSS variable
|
|
8574
|
+
// }
|
|
8575
|
+
// if (lineData != null) {
|
|
8576
|
+
// if (lineData && self.chartConfiguration.showLineChartAxis) {
|
|
8577
|
+
// svgYAxisRight
|
|
8578
|
+
// .append('g')
|
|
8579
|
+
// .attr('class', 'lib-stacked-y-axis-text1')
|
|
8580
|
+
// .attr('style', self.chartConfiguration.yAxisCustomTextStyles)
|
|
8581
|
+
// .attr('transform', 'translate(' + 0 + ',0)')
|
|
8582
|
+
// .call(yLineAxis);
|
|
8583
|
+
// }
|
|
8584
|
+
// }
|
|
8585
|
+
// /**
|
|
8586
|
+
// * used to display y label
|
|
8587
|
+
// */
|
|
8588
|
+
// // if (this.isZoomedOut) {
|
|
8589
|
+
// // svg
|
|
8590
|
+
// // .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
8591
|
+
// // .attr('class', 'lib-display-hidden');
|
|
8592
|
+
// // }
|
|
8593
|
+
// if (this.isZoomedOut) {
|
|
8594
|
+
// svg
|
|
8595
|
+
// .selectAll('.lib-xaxis-labels-texts-drilldown')
|
|
8596
|
+
// .each((d, i, nodes) => {
|
|
8597
|
+
// const text = d3.select(nodes[i]);
|
|
8598
|
+
// const label = text.text();
|
|
8599
|
+
// if (label.indexOf('\n') > -1) {
|
|
8600
|
+
// const lines = label.split('\n');
|
|
8601
|
+
// text.text(null);
|
|
8602
|
+
// lines.forEach((line, idx) => {
|
|
8603
|
+
// text.append('tspan')
|
|
8604
|
+
// .text(line)
|
|
8605
|
+
// .attr('x', 0)
|
|
8606
|
+
// .attr('dy', idx === 0 ? '1em' : '1.1em');
|
|
8607
|
+
// });
|
|
8608
|
+
// } else {
|
|
8609
|
+
// const words = label.split(' ');
|
|
8610
|
+
// text.text(null);
|
|
8611
|
+
// words.forEach((word, index) => {
|
|
8612
|
+
// text.append('tspan').text(word);
|
|
8613
|
+
// });
|
|
8614
|
+
// }
|
|
8615
|
+
// })
|
|
8616
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
8617
|
+
// .attr('transform', null);
|
|
8618
|
+
// svg
|
|
8619
|
+
// .select('.x-axis')
|
|
8620
|
+
// .attr('transform', `translate(0, ${height - margin.bottom + 10})`);
|
|
8621
|
+
// }
|
|
8622
|
+
// /**
|
|
8623
|
+
// * used to write y labels based on configuration
|
|
8624
|
+
// */
|
|
8625
|
+
// if (metaData.yLabel) {
|
|
8626
|
+
// const yPosition = isria ? 0 - margin.left / 2 - 30 : 0 - margin.left / 2 - 40;
|
|
8627
|
+
// svgYAxisLeft
|
|
8628
|
+
// .append('text')
|
|
8629
|
+
// .attr('class', 'lib-axis-group-label font-size-1')
|
|
8630
|
+
// .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
8631
|
+
// .attr('transform', 'rotate(-90)')
|
|
8632
|
+
// .attr('y', yPosition)
|
|
8633
|
+
// .attr('x', 0 - height / 2)
|
|
8634
|
+
// .attr('dy', '1em')
|
|
8635
|
+
// .style('text-anchor', 'middle')
|
|
8636
|
+
// .attr('fill', 'var(--chart-text-color)');
|
|
8637
|
+
// if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
8638
|
+
// svgYAxisLeft
|
|
8639
|
+
// .selectAll('.lib-axis-group-label')
|
|
8640
|
+
// .style('font-size', 'smaller')
|
|
8641
|
+
// .text(metaData.yLabel);
|
|
8642
|
+
// } else {
|
|
8643
|
+
// svg
|
|
8644
|
+
// .selectAll('.lib-axis-group-label')
|
|
8645
|
+
// .attr('class', 'lib-ylabel-weeklyCharts')
|
|
8646
|
+
// .text(metaData.yLabel.toLowerCase());
|
|
8647
|
+
// }
|
|
8648
|
+
// }
|
|
8649
|
+
// if (this.chartData.targetLineData) {
|
|
8650
|
+
// const yZero = y(this.chartData.targetLineData.target);
|
|
8651
|
+
// svg
|
|
8652
|
+
// .append('line')
|
|
8653
|
+
// .attr('x1', 0)
|
|
8654
|
+
// .attr('x2', width)
|
|
8655
|
+
// .attr('y1', yZero)
|
|
8656
|
+
// .attr('y2', yZero)
|
|
8657
|
+
// .style('stroke-dasharray', '5 5')
|
|
8658
|
+
// .style('stroke', this.chartData.targetLineData.color);
|
|
8659
|
+
// // svgYAxisRight
|
|
8660
|
+
// // .append('line')
|
|
8661
|
+
// // .attr('x1', 0)
|
|
8662
|
+
// // .attr('x2', rightSvgWidth)
|
|
8663
|
+
// // .attr('y1', yZero)
|
|
8664
|
+
// // .attr('y2', yZero)
|
|
8665
|
+
// // .style('stroke', this.chartData.targetLineData.color);
|
|
8666
|
+
// svgYAxisRight
|
|
8667
|
+
// .append('foreignObject')
|
|
8668
|
+
// .attr('transform', 'translate(' + 0 + ',' + (yZero - 30) + ')')
|
|
8669
|
+
// .attr('width', rightSvgWidth)
|
|
8670
|
+
// .attr('height', 50)
|
|
8671
|
+
// .append('xhtml:div')
|
|
8672
|
+
// .attr('class', 'target-display')
|
|
8673
|
+
// .style('color', 'var(--chart-text-color)')
|
|
8674
|
+
// .html(function () {
|
|
8675
|
+
// let dataTypeTemp = '';
|
|
8676
|
+
// let targetLineName = 'target';
|
|
8677
|
+
// if (metaData.dataType) {
|
|
8678
|
+
// dataTypeTemp = metaData.dataType;
|
|
8679
|
+
// }
|
|
8680
|
+
// if (
|
|
8681
|
+
// self.chartData.targetLineData &&
|
|
8682
|
+
// self.chartData.targetLineData.targetName
|
|
8683
|
+
// ) {
|
|
8684
|
+
// targetLineName = self.chartData.targetLineData.targetName;
|
|
8685
|
+
// }
|
|
8686
|
+
// return (
|
|
8687
|
+
// `<div>${targetLineName}</div>` +
|
|
8688
|
+
// '<div>' +
|
|
8689
|
+
// self.chartData.targetLineData.target +
|
|
8690
|
+
// '' +
|
|
8691
|
+
// dataTypeTemp +
|
|
8692
|
+
// '</div>'
|
|
8693
|
+
// );
|
|
8694
|
+
// });
|
|
8695
|
+
// }
|
|
8696
|
+
// if (this.chartConfiguration.isDrilldownChart) {
|
|
8697
|
+
// /**
|
|
8698
|
+
// * used by drilldown charts
|
|
8699
|
+
// */
|
|
8700
|
+
// // svg
|
|
8701
|
+
// // .selectAll('.lib-axis-group-label')
|
|
8702
|
+
// // .attr('class', 'lib-ylabel-drilldowncharts')
|
|
8703
|
+
// // .text(metaData.yLabel.toLowerCase());
|
|
8704
|
+
// svg.selectAll('g.x1.axis1 g.tick line').style('display', 'none');
|
|
8705
|
+
// }
|
|
8706
|
+
// if (metaData.xLabel) {
|
|
8707
|
+
// function isAcronym(label) {
|
|
8708
|
+
// return (
|
|
8709
|
+
// (label.length <= 4 && /^[A-Z]+$/.test(label)) ||
|
|
8710
|
+
// (label === label.toUpperCase() && /[A-Z]/.test(label))
|
|
8711
|
+
// );
|
|
8712
|
+
// }
|
|
8713
|
+
// const xLabelText = metaData.xLabel;
|
|
8714
|
+
// const isAcr = isAcronym(xLabelText.replace(/[^A-Za-z]/g, ''));
|
|
8715
|
+
// const xPosition = isria ? (height + margin.top + margin.bottom) : (height + margin.top + margin.bottom + 40);
|
|
8716
|
+
// svg
|
|
8717
|
+
// .append('text')
|
|
8718
|
+
// .attr('class', function () {
|
|
8719
|
+
// let baseClass = 'lib-axis-group-label font-size-1';
|
|
8720
|
+
// if (self.chartConfiguration.isDrilldownChart)
|
|
8721
|
+
// return baseClass + ' lib-xlabel-drilldowncharts';
|
|
8722
|
+
// if (self.chartConfiguration.isMultiChartGridLine != undefined)
|
|
8723
|
+
// return baseClass + ' lib-xlabel-weeklyCharts';
|
|
8724
|
+
// return baseClass + ' lib-axis-waterfall-label';
|
|
8725
|
+
// })
|
|
8726
|
+
// .attr('style', self.chartConfiguration.xAxisCustomlabelStyles)
|
|
8727
|
+
// .attr(
|
|
8728
|
+
// 'transform',
|
|
8729
|
+
// 'translate(' + width / 2 + ' ,' + xPosition + ')'
|
|
8730
|
+
// )
|
|
8731
|
+
// .style('text-anchor', 'middle')
|
|
8732
|
+
// .style('fill', 'var(--chart-text-color)')
|
|
8733
|
+
// .text(isAcr ? xLabelText.toUpperCase() : xLabelText.toLowerCase())
|
|
8734
|
+
// .style('text-transform', isAcr ? 'none' : 'capitalize');
|
|
8735
|
+
// }
|
|
8736
|
+
// if (metaData.lineyLabel) {
|
|
8737
|
+
// svgYAxisRight
|
|
8738
|
+
// .append('text')
|
|
8739
|
+
// .attr('class', 'lib-axis-group-label lib-line-axis')
|
|
8740
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8741
|
+
// .attr('style', self.chartConfiguration.yAxisCustomlabelStyles)
|
|
8742
|
+
// .attr('transform', 'translate(0,0) rotate(90)')
|
|
8743
|
+
// .attr('y', 0 - 100)
|
|
8744
|
+
// .attr('x', 0 + 100)
|
|
8745
|
+
// .attr('dy', '5em')
|
|
8746
|
+
// .style('text-anchor', 'middle')
|
|
8747
|
+
// .style('font-size', 'smaller')
|
|
8748
|
+
// .text(metaData.lineyLabel);
|
|
8749
|
+
// }
|
|
8750
|
+
// if (lineData) {
|
|
8751
|
+
// svg
|
|
8752
|
+
// .append('path')
|
|
8753
|
+
// .datum(lineData)
|
|
8754
|
+
// .attr('fill', 'none')
|
|
8755
|
+
// .attr('stroke', self.chartConfiguration.lineGraphColor)
|
|
8756
|
+
// .attr('stroke-width', 1.5)
|
|
8757
|
+
// .attr(
|
|
8758
|
+
// 'd',
|
|
8759
|
+
// d3
|
|
8760
|
+
// .line()
|
|
8761
|
+
// .x(function (d) {
|
|
8762
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8763
|
+
// })
|
|
8764
|
+
// .y(function (d) {
|
|
8765
|
+
// return lineYscale(d.value);
|
|
8766
|
+
// })
|
|
8767
|
+
// );
|
|
8768
|
+
// var dot = svg
|
|
8769
|
+
// .selectAll('myCircles')
|
|
8770
|
+
// .data(lineData)
|
|
8771
|
+
// .enter()
|
|
8772
|
+
// .append('g')
|
|
8773
|
+
// .on('click', function (d) {
|
|
8774
|
+
// if (
|
|
8775
|
+
// !metaData.barWithoutClick ||
|
|
8776
|
+
// !metaData.barWithoutClick.length ||
|
|
8777
|
+
// (!metaData.barWithoutClick.includes(d?.name) &&
|
|
8778
|
+
// !metaData.barWithoutClick.includes(d?.key))
|
|
8779
|
+
// )
|
|
8780
|
+
// self.handleClick(d);
|
|
8781
|
+
// });
|
|
8782
|
+
// dot
|
|
8783
|
+
// .append('circle')
|
|
8784
|
+
// .attr('fill', function (d) {
|
|
8785
|
+
// return self.chartConfiguration.lineGraphColor;
|
|
8786
|
+
// })
|
|
8787
|
+
// .attr('stroke', 'none')
|
|
8788
|
+
// .attr('cx', function (d) {
|
|
8789
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8790
|
+
// })
|
|
8791
|
+
// .attr('cy', function (d) {
|
|
8792
|
+
// return lineYscale(d.value);
|
|
8793
|
+
// })
|
|
8794
|
+
// .style('cursor', () =>
|
|
8795
|
+
// self.chartData.metaData.hasDrillDown ? 'pointer' : 'default'
|
|
8796
|
+
// )
|
|
8797
|
+
// .attr('r', 3);
|
|
8798
|
+
// if (self.chartConfiguration.lineGraphColor) {
|
|
8799
|
+
// dot
|
|
8800
|
+
// .append('text')
|
|
8801
|
+
// .attr('class', 'dot')
|
|
8802
|
+
// .attr('fill', 'var(--chart-text-color)')
|
|
8803
|
+
// .attr('color', self.chartConfiguration.lineGraphColor)
|
|
8804
|
+
// .attr('style', 'font-size: ' + '.85em')
|
|
8805
|
+
// .attr('x', function (d, i) {
|
|
8806
|
+
// return x(d.name) + x.bandwidth() / 2;
|
|
8807
|
+
// })
|
|
8808
|
+
// .attr('y', function (d) {
|
|
8809
|
+
// return lineYscale(d.value);
|
|
8810
|
+
// })
|
|
8811
|
+
// .attr('dy', '-1em')
|
|
8812
|
+
// .text(function (d) {
|
|
8813
|
+
// return self.chartConfiguration.labelFormatter(d.value);
|
|
8814
|
+
// });
|
|
8815
|
+
// }
|
|
8816
|
+
// }
|
|
8817
|
+
// }
|
|
7628
8818
|
initializegroupChart() {
|
|
7629
8819
|
// ==================== VARIABLE DECLARATIONS ====================
|
|
7630
8820
|
const self = this;
|
|
@@ -7735,7 +8925,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7735
8925
|
.domain(groups)
|
|
7736
8926
|
.range([0, width - RIGHT_SVG_WIDTH]);
|
|
7737
8927
|
// ==================== X-AXIS RENDERING ====================
|
|
7738
|
-
this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile
|
|
8928
|
+
this.renderXAxis(svg, x, height, metaData, subgroups, data, SHORT_TICK_LENGTH_BG, LONG_TICK_LENGTH_BG, self, isria, isMobile);
|
|
7739
8929
|
// ==================== Y-AXIS SETUP ====================
|
|
7740
8930
|
const y = d3.scaleLinear().rangeRound([height, 0]);
|
|
7741
8931
|
let maxValue = this.calculateMaxValue(data, keyList);
|
|
@@ -7786,18 +8976,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7786
8976
|
}
|
|
7787
8977
|
}
|
|
7788
8978
|
// ==================== HELPER METHODS ====================
|
|
7789
|
-
renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile
|
|
8979
|
+
renderXAxis(svg, x, height, metaData, subgroups, data, shortTickLengthBg, longTickLengthBg, self, isria, isMobile) {
|
|
7790
8980
|
let alternate_text = false;
|
|
7791
8981
|
if (this.chartConfiguration.isMultiChartGridLine === undefined) {
|
|
7792
8982
|
// 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
8983
|
svg.append('g')
|
|
7799
8984
|
.attr('class', 'x1 axis1')
|
|
7800
|
-
.attr('transform', `translate(0,${
|
|
8985
|
+
.attr('transform', `translate(0,${height})`)
|
|
7801
8986
|
.call(d3.axisBottom(x))
|
|
7802
8987
|
.call((g) => g.select('.domain').remove());
|
|
7803
8988
|
svg.selectAll('g.x1.axis1 g.tick line').remove();
|
|
@@ -7857,7 +9042,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7857
9042
|
.attr('x', 5)
|
|
7858
9043
|
.style('text-anchor', 'middle');
|
|
7859
9044
|
}
|
|
7860
|
-
// Mobile
|
|
9045
|
+
// Mobile override - check for single-group date charts first
|
|
7861
9046
|
if (isMobile) {
|
|
7862
9047
|
const textNodes = svg.selectAll('g.x1.axis1 g.tick text');
|
|
7863
9048
|
const groupsCount = data.length || 0;
|
|
@@ -7886,6 +9071,15 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7886
9071
|
// Default mobile behavior for non-date or multi-group
|
|
7887
9072
|
textNodes.classed('mobile-xaxis-override', true);
|
|
7888
9073
|
}
|
|
9074
|
+
// If there are many groups on mobile, rotate labels to sideways to
|
|
9075
|
+
// avoid overlapping and make them readable. Use a lower threshold
|
|
9076
|
+
// (3) so even small mobile screens get rotated labels when needed.
|
|
9077
|
+
if (groupsCount > 3) {
|
|
9078
|
+
svg.selectAll('g.x1.axis1 g.tick text')
|
|
9079
|
+
.style('writing-mode', 'sideways-lr')
|
|
9080
|
+
.style('text-anchor', 'middle')
|
|
9081
|
+
.attr('y', 0);
|
|
9082
|
+
}
|
|
7889
9083
|
}
|
|
7890
9084
|
}
|
|
7891
9085
|
applyXLabelsOnSameLine(svg, subgroups, data, metaData, self, shortTickLengthBg, isMobile, isria) {
|
|
@@ -7950,22 +9144,13 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7950
9144
|
return baseY;
|
|
7951
9145
|
}
|
|
7952
9146
|
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
|
-
if (isSmallScreen && labelInfo.isDate && labelInfo.isWeek) {
|
|
7964
|
-
const datePart = d.match(/\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/);
|
|
7965
|
-
return datePart ? datePart[0] : d;
|
|
7966
|
-
}
|
|
7967
9147
|
// Mobile handling: keep date labels intact for single-series charts (do not trim)
|
|
7968
9148
|
if (isMobile) {
|
|
9149
|
+
const isDateLabel = /\d{2,4}[-\/]\d{1,2}[-\/]\d{1,4}/.test(d) || !isNaN(Date.parse(d));
|
|
9150
|
+
if (isDateLabel && subgroups && subgroups.length < 3) {
|
|
9151
|
+
// For single-series charts on mobile, show full date labels (no trimming)
|
|
9152
|
+
return d;
|
|
9153
|
+
}
|
|
7969
9154
|
// If header is hidden (compact mobile), trim non-date labels as before
|
|
7970
9155
|
if (!self.isHeaderVisible) {
|
|
7971
9156
|
const firstPart = d.split(/[\s\-]+/)[0];
|
|
@@ -7983,15 +9168,17 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
7983
9168
|
if (dateRangeRegex.test(d.trim())) {
|
|
7984
9169
|
return d.trim().replace(dateRangeRegex, (m, d1, d2) => `${d1} - ${d2}`);
|
|
7985
9170
|
}
|
|
7986
|
-
//
|
|
9171
|
+
// Split date and week labels into two lines
|
|
9172
|
+
const isDateLabel = /\d{2,4}[-\/]/.test(d);
|
|
9173
|
+
const isWeekLabel = /week|wk|w\d+/i.test(d);
|
|
7987
9174
|
if (subgroups.length > 1 && !self.isZoomedOut && data.length > 8 &&
|
|
7988
|
-
d.indexOf(' ') > -1 && (
|
|
9175
|
+
d.indexOf(' ') > -1 && (isDateLabel || isWeekLabel)) {
|
|
7989
9176
|
const first = d.substring(0, d.indexOf(' '));
|
|
7990
9177
|
const second = d.substring(d.indexOf(' ') + 1).trim();
|
|
7991
9178
|
return `${first}\n${second}`;
|
|
7992
9179
|
}
|
|
7993
9180
|
// Handle date labels in minimized view
|
|
7994
|
-
if (
|
|
9181
|
+
if (isDateLabel) {
|
|
7995
9182
|
if (!self.isHeaderVisible && data.length > 8 && d.indexOf(' ') > -1) {
|
|
7996
9183
|
const first = d.substring(0, d.indexOf(' '));
|
|
7997
9184
|
const second = d.substring(d.indexOf(' ') + 1).trim();
|
|
@@ -8590,7 +9777,7 @@ class HorizontalGroupedBarWithScrollZoomComponent extends ComponentUniqueId {
|
|
|
8590
9777
|
// Minimum width per bar group based on device and number of subgroups
|
|
8591
9778
|
const minWidthPerGroup = (() => {
|
|
8592
9779
|
if (subgroupsCount > 2) {
|
|
8593
|
-
return isMobile ?
|
|
9780
|
+
return isMobile ? 80 : isTablet ? 100 : 120; // Wider for multiple subgroups
|
|
8594
9781
|
}
|
|
8595
9782
|
return isMobile ? 40 : isTablet ? 60 : 80; // Normal width for 1-2 subgroups
|
|
8596
9783
|
})();
|