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