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