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