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