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