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