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