pace-chart-lib 1.0.22 → 1.0.23
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/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisFunctions.d.ts +3 -1
- package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisTypes.types.d.ts +5 -1
- package/dist/Components/Charts/Core/Common.types.d.ts +18 -3
- package/dist/Components/Charts/Core/CommonFunctions.d.ts +2 -2
- package/dist/Components/Charts/Core/DefaultChartDataProperties.d.ts +2 -1
- package/dist/pace-chart-lib.es.js +903 -496
- package/dist/pace-chart-lib.umd.js +903 -496
- package/package.json +1 -1
|
@@ -10721,11 +10721,24 @@
|
|
|
10721
10721
|
return connectedStyle2;
|
|
10722
10722
|
})(connectedStyle || {});
|
|
10723
10723
|
var staticLineStyle = /* @__PURE__ */ ((staticLineStyle2) => {
|
|
10724
|
-
staticLineStyle2["
|
|
10725
|
-
staticLineStyle2["
|
|
10726
|
-
staticLineStyle2["
|
|
10724
|
+
staticLineStyle2["none"] = "None";
|
|
10725
|
+
staticLineStyle2["solid"] = "Solid";
|
|
10726
|
+
staticLineStyle2["dotted"] = "Dotted";
|
|
10727
|
+
staticLineStyle2["dashed"] = "Dashed";
|
|
10727
10728
|
return staticLineStyle2;
|
|
10728
10729
|
})(staticLineStyle || {});
|
|
10730
|
+
var strokeLineCap = /* @__PURE__ */ ((strokeLineCap2) => {
|
|
10731
|
+
strokeLineCap2["butt"] = "butt";
|
|
10732
|
+
strokeLineCap2["round"] = "round";
|
|
10733
|
+
strokeLineCap2["square"] = "square";
|
|
10734
|
+
return strokeLineCap2;
|
|
10735
|
+
})(strokeLineCap || {});
|
|
10736
|
+
var axisTypes = /* @__PURE__ */ ((axisTypes2) => {
|
|
10737
|
+
axisTypes2["primary"] = "Primary";
|
|
10738
|
+
axisTypes2["secondary"] = "Secondary";
|
|
10739
|
+
return axisTypes2;
|
|
10740
|
+
})(axisTypes || {});
|
|
10741
|
+
const strokeDashValues = "20,10,5,5,5,10";
|
|
10729
10742
|
const ConnecterCurve = {
|
|
10730
10743
|
"1": "",
|
|
10731
10744
|
"2": curveLinear$1,
|
|
@@ -11473,6 +11486,10 @@
|
|
|
11473
11486
|
chartTypes2["PyramidChart"] = "PyramidChart";
|
|
11474
11487
|
chartTypes2["ProgressChart"] = "ProgressChart";
|
|
11475
11488
|
chartTypes2["RadialBarChart"] = "RadialBarChart";
|
|
11489
|
+
chartTypes2["CombinationLine"] = "CombinationLine";
|
|
11490
|
+
chartTypes2["CombinationArea"] = "CombinationArea";
|
|
11491
|
+
chartTypes2["CombinationStackArea"] = "CombinationStackArea";
|
|
11492
|
+
chartTypes2["TornadoDefaultEntry"] = "defaultEntry";
|
|
11476
11493
|
return chartTypes2;
|
|
11477
11494
|
})(chartTypes || {});
|
|
11478
11495
|
const connecterCurve = {
|
|
@@ -11527,7 +11544,7 @@
|
|
|
11527
11544
|
var boundingRect = div.getBoundingClientRect();
|
|
11528
11545
|
var width = boundingRect.width;
|
|
11529
11546
|
var height = boundingRect.height;
|
|
11530
|
-
if (rotationDegree) {
|
|
11547
|
+
if (rotationDegree != null) {
|
|
11531
11548
|
div.style.transform = `rotate(${rotationDegree}deg)`;
|
|
11532
11549
|
boundingRect = div.getBoundingClientRect();
|
|
11533
11550
|
div.remove();
|
|
@@ -11597,8 +11614,7 @@
|
|
|
11597
11614
|
"Helvetica"
|
|
11598
11615
|
)[1] : 0;
|
|
11599
11616
|
yTitle = yTitle > width * 0.1 ? width * 0.1 : yTitle;
|
|
11600
|
-
let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) +
|
|
11601
|
-
yLabel += 8;
|
|
11617
|
+
let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) + 5 : getYAxisLabel(formatOptions, max$2(legendList, (d) => d?.length || 0) || 0) + 10;
|
|
11602
11618
|
let secondaryYLabel = formatOptions.secondaryYAxisLabel.secondaryYAxisLabelVisibility ? responsiveYaxisMargin(
|
|
11603
11619
|
maxNumberForSecondaryAxis,
|
|
11604
11620
|
yMaxRight,
|
|
@@ -11665,7 +11681,7 @@
|
|
|
11665
11681
|
left2 = yAxisRelatedMargin + 5;
|
|
11666
11682
|
break;
|
|
11667
11683
|
case staticLegendPosition.top:
|
|
11668
|
-
right2 =
|
|
11684
|
+
right2 = 15 + secondaryExtra;
|
|
11669
11685
|
left2 = yAxisRelatedMargin + 5;
|
|
11670
11686
|
break;
|
|
11671
11687
|
case staticLegendPosition.right:
|
|
@@ -12838,61 +12854,77 @@
|
|
|
12838
12854
|
switch (labelType) {
|
|
12839
12855
|
case "2":
|
|
12840
12856
|
chartData.forEach(
|
|
12841
|
-
(d) =>
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12857
|
+
(d) => {
|
|
12858
|
+
if (d.data[0])
|
|
12859
|
+
labelData.push({
|
|
12860
|
+
Dimension: d.data[0].dimension,
|
|
12861
|
+
Measure: d.data[0].value,
|
|
12862
|
+
Legend: d.data[0].legend,
|
|
12863
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12864
|
+
Labelcolor: d.properties.labelColor,
|
|
12865
|
+
Axis: d.properties.axis
|
|
12866
|
+
});
|
|
12867
|
+
}
|
|
12849
12868
|
);
|
|
12850
12869
|
break;
|
|
12851
12870
|
case "3":
|
|
12852
12871
|
chartData.forEach(
|
|
12853
|
-
(d) =>
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12872
|
+
(d) => {
|
|
12873
|
+
if (d.data[d.data.length - 1]) {
|
|
12874
|
+
labelData.push({
|
|
12875
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
12876
|
+
Measure: d.data[d.data.length - 1].value,
|
|
12877
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
12878
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12879
|
+
Labelcolor: d.properties.labelColor,
|
|
12880
|
+
Axis: d.properties.axis
|
|
12881
|
+
});
|
|
12882
|
+
}
|
|
12883
|
+
}
|
|
12861
12884
|
);
|
|
12862
12885
|
break;
|
|
12863
12886
|
case "4":
|
|
12864
12887
|
chartData.forEach(
|
|
12865
|
-
(d) =>
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
12870
|
-
|
|
12871
|
-
|
|
12872
|
-
|
|
12888
|
+
(d) => {
|
|
12889
|
+
if (d.data[0])
|
|
12890
|
+
labelData.push({
|
|
12891
|
+
Dimension: d.data[0].dimension,
|
|
12892
|
+
Measure: d.data[0].value,
|
|
12893
|
+
Legend: d.data[0].legend,
|
|
12894
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12895
|
+
Labelcolor: d.properties.labelColor,
|
|
12896
|
+
Axis: d.properties.axis
|
|
12897
|
+
});
|
|
12898
|
+
}
|
|
12873
12899
|
);
|
|
12874
12900
|
chartData.forEach(
|
|
12875
|
-
(d) =>
|
|
12876
|
-
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12881
|
-
|
|
12882
|
-
|
|
12901
|
+
(d) => {
|
|
12902
|
+
if (d.data[d.data.length - 1])
|
|
12903
|
+
labelData.push({
|
|
12904
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
12905
|
+
Measure: d.data[d.data.length - 1].value,
|
|
12906
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
12907
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12908
|
+
Labelcolor: d.properties.labelColor,
|
|
12909
|
+
Axis: d.properties.axis
|
|
12910
|
+
});
|
|
12911
|
+
}
|
|
12883
12912
|
);
|
|
12884
12913
|
break;
|
|
12885
12914
|
case "1":
|
|
12886
12915
|
for (let i = 0; i < chartData[0].data.length; i++) {
|
|
12887
12916
|
chartData.forEach(
|
|
12888
|
-
(d) =>
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12917
|
+
(d) => {
|
|
12918
|
+
if (d.data[i])
|
|
12919
|
+
labelData.push({
|
|
12920
|
+
Dimension: d.data[i].dimension,
|
|
12921
|
+
Measure: d.data[i].value,
|
|
12922
|
+
Legend: d.data[i].legend,
|
|
12923
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12924
|
+
Labelcolor: d.properties.labelColor,
|
|
12925
|
+
Axis: d.properties.axis
|
|
12926
|
+
});
|
|
12927
|
+
}
|
|
12896
12928
|
);
|
|
12897
12929
|
}
|
|
12898
12930
|
break;
|
|
@@ -12901,60 +12933,65 @@
|
|
|
12901
12933
|
break;
|
|
12902
12934
|
case "6":
|
|
12903
12935
|
chartData.forEach((d) => {
|
|
12904
|
-
let annotationVisibility = d.properties.
|
|
12936
|
+
let annotationVisibility = d.properties.annotation.toString();
|
|
12905
12937
|
switch (annotationVisibility) {
|
|
12906
12938
|
case "1":
|
|
12907
12939
|
for (let i = 0; i < chartData[0].data.length; i++) {
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
|
|
12915
|
-
|
|
12940
|
+
if (d.data[i])
|
|
12941
|
+
labelData.push({
|
|
12942
|
+
Dimension: d.data[i].dimension,
|
|
12943
|
+
Measure: d.data[i].value,
|
|
12944
|
+
Legend: d.data[i].legend,
|
|
12945
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12946
|
+
Labelcolor: d.properties.labelColor,
|
|
12947
|
+
Axis: d.properties.axis
|
|
12948
|
+
});
|
|
12916
12949
|
}
|
|
12917
12950
|
break;
|
|
12918
12951
|
case "2":
|
|
12919
12952
|
labelData;
|
|
12920
12953
|
break;
|
|
12921
12954
|
case "3":
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12955
|
+
if (d.data[0])
|
|
12956
|
+
labelData.push({
|
|
12957
|
+
Dimension: d.data[0].dimension,
|
|
12958
|
+
Measure: d.data[0].value,
|
|
12959
|
+
Legend: d.data[0].legend,
|
|
12960
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12961
|
+
Labelcolor: d.properties.labelColor,
|
|
12962
|
+
Axis: d.properties.axis
|
|
12963
|
+
});
|
|
12930
12964
|
break;
|
|
12931
12965
|
case "4":
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12966
|
+
if (d.data[d.data.length - 1])
|
|
12967
|
+
labelData.push({
|
|
12968
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
12969
|
+
Measure: d.data[d.data.length - 1].value,
|
|
12970
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
12971
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12972
|
+
Labelcolor: d.properties.labelColor,
|
|
12973
|
+
Axis: d.properties.axis
|
|
12974
|
+
});
|
|
12940
12975
|
break;
|
|
12941
12976
|
case "5":
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12977
|
+
if (d.data[0])
|
|
12978
|
+
labelData.push({
|
|
12979
|
+
Dimension: d.data[0].dimension,
|
|
12980
|
+
Measure: d.data[0].value,
|
|
12981
|
+
Legend: d.data[0].legend,
|
|
12982
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12983
|
+
Labelcolor: d.properties.labelColor,
|
|
12984
|
+
Axis: d.properties.axis
|
|
12985
|
+
});
|
|
12986
|
+
if (d.data[d.data.length - 1])
|
|
12987
|
+
labelData.push({
|
|
12988
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
12989
|
+
Measure: d.data[d.data.length - 1].value,
|
|
12990
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
12991
|
+
LabelPosition: d.properties.annotationPosition,
|
|
12992
|
+
Labelcolor: d.properties.labelColor,
|
|
12993
|
+
Axis: d.properties.axis
|
|
12994
|
+
});
|
|
12958
12995
|
break;
|
|
12959
12996
|
}
|
|
12960
12997
|
});
|
|
@@ -12982,13 +13019,14 @@
|
|
|
12982
13019
|
y: d.Dimension,
|
|
12983
13020
|
x: { measure: d.Measure, axis: d.Axis },
|
|
12984
13021
|
position: parseInt(d.LabelPosition),
|
|
12985
|
-
currentLegend: d.Legend
|
|
13022
|
+
currentLegend: d.Legend,
|
|
13023
|
+
//d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
|
|
12986
13024
|
isVisible: true
|
|
12987
13025
|
} : {
|
|
12988
13026
|
x: d.Dimension,
|
|
12989
13027
|
y: { measure: d.Measure, axis: d.Axis },
|
|
12990
13028
|
position: parseInt(d.LabelPosition),
|
|
12991
|
-
currentLegend: d.Legend
|
|
13029
|
+
currentLegend: d.Legend,
|
|
12992
13030
|
isVisible: true
|
|
12993
13031
|
},
|
|
12994
13032
|
dx: 0,
|
|
@@ -13008,10 +13046,10 @@
|
|
|
13008
13046
|
width
|
|
13009
13047
|
};
|
|
13010
13048
|
if (barChart) {
|
|
13011
|
-
let requiredXScale = d.Axis ===
|
|
13049
|
+
let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13012
13050
|
responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
|
|
13013
13051
|
} else {
|
|
13014
|
-
responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis ==
|
|
13052
|
+
responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
|
|
13015
13053
|
}
|
|
13016
13054
|
});
|
|
13017
13055
|
annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
|
|
@@ -13040,17 +13078,19 @@
|
|
|
13040
13078
|
makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
|
|
13041
13079
|
x: function(d) {
|
|
13042
13080
|
if (barChart) {
|
|
13043
|
-
let requiredXScale = d.x.axis ===
|
|
13081
|
+
let requiredXScale = d.x.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13044
13082
|
let axis2 = d.x.axis;
|
|
13045
13083
|
return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
|
|
13046
13084
|
} else if (chartType === chartTypes.ColumnChart) {
|
|
13047
|
-
|
|
13085
|
+
const legend = xScaleForLegends(d.currentLegend);
|
|
13086
|
+
const x2 = legend != null ? xScale(d.x) + legend - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
|
|
13087
|
+
return x2;
|
|
13048
13088
|
} else {
|
|
13049
13089
|
return xScale(d.x);
|
|
13050
13090
|
}
|
|
13051
13091
|
},
|
|
13052
13092
|
y: function(d) {
|
|
13053
|
-
if (d.y.axis ==
|
|
13093
|
+
if (d.y.axis == axisTypes.primary) {
|
|
13054
13094
|
return dataLabelsPosition(
|
|
13055
13095
|
d.y.measure,
|
|
13056
13096
|
parseFloat(d.position),
|
|
@@ -13319,11 +13359,11 @@
|
|
|
13319
13359
|
d["legend"] && d.dimension ? (
|
|
13320
13360
|
// ? finalLegendseries.includes(d.Legend.includes("~$~") ? d.Legend.split("~$~")[1] : d.Legend) &&
|
|
13321
13361
|
// filteredDimensionList.includes(d.Dimension) &&
|
|
13322
|
-
!labelExcludeList.includes(d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend) && (d.Axis ==
|
|
13362
|
+
!labelExcludeList.includes(d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.value) <= innerHeight2 && yScaleLeft(d.value) >= 0 : yScaleRight(d.value) <= innerHeight2 && yScaleRight(d.value) >= 0) ? annotationsList.push(singleAnnotation) : null
|
|
13323
13363
|
) : (
|
|
13324
13364
|
// finalLegendseries.includes(d["key"].includes("~$~") ? d["key"].split("~$~")[1] : d["key"]) &&
|
|
13325
13365
|
// this.filteredDimensionList.includes(d.data["Dimension"]) &&
|
|
13326
|
-
!labelExcludeList.includes(d["key"]) && (d.data.axis ==
|
|
13366
|
+
!labelExcludeList.includes(d["key"]) && (d.data.axis == axisTypes.primary ? yScaleLeft(d[1]) <= innerHeight2 && yScaleLeft(d[1]) >= 0 : yScaleRight(d[1]) <= innerHeight2 && yScaleRight(d[1]) >= 0) ? annotationsList.push(singleAnnotation) : null
|
|
13327
13367
|
);
|
|
13328
13368
|
});
|
|
13329
13369
|
oldAnnotationList = oldAnnotationList.length == 0 ? annotationsList : oldAnnotationList;
|
|
@@ -13367,7 +13407,7 @@
|
|
|
13367
13407
|
}
|
|
13368
13408
|
},
|
|
13369
13409
|
y: function(d) {
|
|
13370
|
-
if (d.x.axis ==
|
|
13410
|
+
if (d.x.axis == axisTypes.primary) {
|
|
13371
13411
|
return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, d.type);
|
|
13372
13412
|
} else {
|
|
13373
13413
|
return dataLabelsPosition(d.y, parseFloat(d.position), yScaleRight, minValue, d.prevValue, d.type);
|
|
@@ -13408,7 +13448,7 @@
|
|
|
13408
13448
|
}
|
|
13409
13449
|
}).accessorsInverse({
|
|
13410
13450
|
x: (d) => xScale.invert(d.x),
|
|
13411
|
-
y: (d) => d.x.axis ==
|
|
13451
|
+
y: (d) => d.x.axis == axisTypes.primary ? yScaleLeft.invert(d.y) : yScaleRight.invert(d.y)
|
|
13412
13452
|
}).notePadding(0).annotations(finalAnnotationList);
|
|
13413
13453
|
if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
|
|
13414
13454
|
let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType);
|
|
@@ -14318,7 +14358,7 @@
|
|
|
14318
14358
|
let seriesObject = {};
|
|
14319
14359
|
let measureObject = seriesPosition == "Right" ? lineData.data[lineData.data.length - 1] : lineData.data[0];
|
|
14320
14360
|
let yPositionMeasure = isStackedChart ? measureObject.value > 0 ? measureObject[1] : measureObject[0] : measureObject.value;
|
|
14321
|
-
if (lineData.properties.axis ==
|
|
14361
|
+
if (lineData.properties.axis == axisTypes.primary || !yScaleRight) {
|
|
14322
14362
|
seriesObject["yPosition"] = yScaleLeft(yPositionMeasure) - hwObject[1] / 2;
|
|
14323
14363
|
} else if (isSecondaryAxisDrawn && yScaleRight) {
|
|
14324
14364
|
seriesObject["yPosition"] = yScaleRight(yPositionMeasure) - hwObject[1] / 2;
|
|
@@ -14411,7 +14451,7 @@
|
|
|
14411
14451
|
break;
|
|
14412
14452
|
case "6":
|
|
14413
14453
|
chartData.forEach((d) => {
|
|
14414
|
-
let annotationVisibility = d.
|
|
14454
|
+
let annotationVisibility = d[0].properties.annotation.toString();
|
|
14415
14455
|
switch (annotationVisibility) {
|
|
14416
14456
|
case "1":
|
|
14417
14457
|
for (let i = 0; i < chartData[0].length; i++) {
|
|
@@ -14482,7 +14522,7 @@
|
|
|
14482
14522
|
height: 15,
|
|
14483
14523
|
width: 15
|
|
14484
14524
|
},
|
|
14485
|
-
color:
|
|
14525
|
+
color: d.properties.labelColor,
|
|
14486
14526
|
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
14487
14527
|
height,
|
|
14488
14528
|
width
|
|
@@ -14916,11 +14956,132 @@
|
|
|
14916
14956
|
true
|
|
14917
14957
|
);
|
|
14918
14958
|
};
|
|
14959
|
+
function addTotalValue(totalValueMap, xScale, yScale, margin, d3Annotation2, oldAnnotationList, formatOptions, chartType, height, width, svg, isReportEditable, isBarChart) {
|
|
14960
|
+
try {
|
|
14961
|
+
if (formatOptions.total.totalVisibility) {
|
|
14962
|
+
const dataLabelHeight = formatOptions.annotation.annotationVisibility != "5" ? 10 : 0;
|
|
14963
|
+
let annotationType = formatOptions.total.annotationType ?? "1";
|
|
14964
|
+
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
14965
|
+
let makeAnnotations = d3Annotation2.annotation();
|
|
14966
|
+
let connector = formatOptions.total.connectorType;
|
|
14967
|
+
let fontStyle = formatOptions.total.totalFontStyle;
|
|
14968
|
+
let connectorType = formatOptions.total.connectorType ? formatOptions.total.connectorType.toLowerCase() : "None";
|
|
14969
|
+
oldAnnotationList = [];
|
|
14970
|
+
let annotationsList = [];
|
|
14971
|
+
let totalValuesArray = Array.from(totalValueMap, ([Dimension, Measure]) => ({ Dimension, Measure }));
|
|
14972
|
+
if (formatOptions.total.totalHideZeroValues) {
|
|
14973
|
+
totalValuesArray = totalValuesArray.filter((d) => d.Measure !== 0);
|
|
14974
|
+
}
|
|
14975
|
+
totalValuesArray.forEach((d, i) => {
|
|
14976
|
+
let singleAnnotation = {
|
|
14977
|
+
note: {
|
|
14978
|
+
label: d.Measure >= 1e9 && formatOptions.total.totalNumberFormat === ".2s" ? Math.round(d.Measure / 1e9) + "B" : getNumberWithFormat(
|
|
14979
|
+
d.Measure,
|
|
14980
|
+
formatOptions.total.totalDisplayUnits || formatOptions.plotArea.plotAreaDisplayUnits,
|
|
14981
|
+
formatOptions.total.totalNumberFormat,
|
|
14982
|
+
formatOptions.total.totalDecimalPrecision
|
|
14983
|
+
)
|
|
14984
|
+
},
|
|
14985
|
+
data: {
|
|
14986
|
+
y: d.Measure,
|
|
14987
|
+
x: d.Dimension
|
|
14988
|
+
},
|
|
14989
|
+
dx: 0,
|
|
14990
|
+
dy: 0,
|
|
14991
|
+
connector: {
|
|
14992
|
+
end: connectorType,
|
|
14993
|
+
curve: connecterCurve[formatOptions.total.connectorCurve]
|
|
14994
|
+
},
|
|
14995
|
+
disable: Disable,
|
|
14996
|
+
subject: {
|
|
14997
|
+
height: 15,
|
|
14998
|
+
width: 15
|
|
14999
|
+
},
|
|
15000
|
+
color: formatOptions.total.totalColor,
|
|
15001
|
+
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
15002
|
+
height,
|
|
15003
|
+
width
|
|
15004
|
+
};
|
|
15005
|
+
annotationsList.push(singleAnnotation);
|
|
15006
|
+
});
|
|
15007
|
+
makeAnnotations.editMode(formatOptions.total.annotationDraggable && isReportEditable).accessors({
|
|
15008
|
+
x: function(d) {
|
|
15009
|
+
return isBarChart ? yScale(d.y) + 25 : xScale(d.x);
|
|
15010
|
+
},
|
|
15011
|
+
y: function(d) {
|
|
15012
|
+
return isBarChart ? xScale(d.x) - 5 : yScale(d.y) - dataLabelHeight - 15;
|
|
15013
|
+
}
|
|
15014
|
+
}).on("dragend", function(annotation2) {
|
|
15015
|
+
annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
15016
|
+
"stroke-dasharray",
|
|
15017
|
+
connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]
|
|
15018
|
+
);
|
|
15019
|
+
annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.total.connectorColor || "#ccc").style(
|
|
15020
|
+
"stroke",
|
|
15021
|
+
formatOptions.total.connectorColor || "#ccc"
|
|
15022
|
+
);
|
|
15023
|
+
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.total.connectorColor || "#ccc").attr(
|
|
15024
|
+
"stroke-dasharray",
|
|
15025
|
+
connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]
|
|
15026
|
+
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15027
|
+
}).accessorsInverse({
|
|
15028
|
+
x: (d) => xScale.invert(d.x),
|
|
15029
|
+
y: (d) => yScale.invert(d.y)
|
|
15030
|
+
}).notePadding(0).annotations(annotationsList);
|
|
15031
|
+
let annotations = appendTotalAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType);
|
|
15032
|
+
}
|
|
15033
|
+
} catch (error) {
|
|
15034
|
+
throw error;
|
|
15035
|
+
}
|
|
15036
|
+
}
|
|
15037
|
+
const appendTotalAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotations, ConnectorType) => {
|
|
15038
|
+
svg.selectAll(".annotation-group").remove();
|
|
15039
|
+
let annotations = svg.append("g").attr("id", "annotationGroup").attr("class", "annotation-group").attr("transform", `translate(${margin.left},${margin.top})`).style("fill", formatOptions.total.totalColor).style("font-family", formatOptions.total.totalFontFamily).style("font-size", formatOptions.total.totalFontSize).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
15040
|
+
"text-decoration",
|
|
15041
|
+
fontStyle.includes("Underline") ? "Underline" : ""
|
|
15042
|
+
).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").call(makeAnnotations);
|
|
15043
|
+
annotations.selectAll("rect").style("visibility", "hidden");
|
|
15044
|
+
annotations.selectAll(".annotation-subject").remove();
|
|
15045
|
+
annotations.selectAll(".connector").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle]);
|
|
15046
|
+
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.total.connectorColor || "#ccc").style("stroke", formatOptions.total.connectorColor || "#ccc");
|
|
15047
|
+
annotations.selectAll(".note-line").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15048
|
+
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
15049
|
+
formatOptions.total.annotationType == "1" && annotations.selectAll(".annotation-note-content").attr("transform", function() {
|
|
15050
|
+
const transform = select$2(this).attr("transform");
|
|
15051
|
+
const translateValues = transform.match(/translate\(([^,]+),([^,]+)\)/);
|
|
15052
|
+
if (translateValues) {
|
|
15053
|
+
const currentX = parseFloat(translateValues[1]);
|
|
15054
|
+
return `translate(${currentX}, 0)`;
|
|
15055
|
+
}
|
|
15056
|
+
});
|
|
15057
|
+
annotations.selectAll("text").append("text").style("fill", formatOptions.total.totalColor !== "#ffffff" ? formatOptions.total.totalColor : "none");
|
|
15058
|
+
return annotations;
|
|
15059
|
+
};
|
|
15060
|
+
function createTotalMeasureValueMap(data, totalValueMap, filteredDimension) {
|
|
15061
|
+
totalValueMap.clear();
|
|
15062
|
+
if (filteredDimension && filteredDimension.length > 0) {
|
|
15063
|
+
filteredDimension.forEach((dimension) => {
|
|
15064
|
+
let totalMeasureValue = 0;
|
|
15065
|
+
totalValueMap.set(dimension, totalMeasureValue);
|
|
15066
|
+
});
|
|
15067
|
+
}
|
|
15068
|
+
if (data.ChartData && data.ChartData.length > 0) {
|
|
15069
|
+
data.ChartData.forEach((series) => {
|
|
15070
|
+
series.data.forEach((dataPoint, index2) => {
|
|
15071
|
+
if (totalValueMap.has(dataPoint.dimension)) {
|
|
15072
|
+
let existingTotal = totalValueMap.get(dataPoint.dimension) || 0;
|
|
15073
|
+
existingTotal += dataPoint.value || 0;
|
|
15074
|
+
totalValueMap.set(dataPoint.dimension, existingTotal);
|
|
15075
|
+
}
|
|
15076
|
+
});
|
|
15077
|
+
});
|
|
15078
|
+
}
|
|
15079
|
+
}
|
|
14919
15080
|
const chartProperties = {
|
|
14920
15081
|
color: "defaultColor",
|
|
14921
15082
|
name: "",
|
|
14922
15083
|
type: "Line",
|
|
14923
|
-
axis:
|
|
15084
|
+
axis: axisTypes.primary,
|
|
14924
15085
|
alias: "",
|
|
14925
15086
|
fontSize: 11,
|
|
14926
15087
|
fontStyle: [],
|
|
@@ -15006,9 +15167,8 @@
|
|
|
15006
15167
|
chartTypes.Speedometer,
|
|
15007
15168
|
chartTypes.RadialBarChart
|
|
15008
15169
|
];
|
|
15009
|
-
function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions,
|
|
15170
|
+
function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, legendShape, chartType) {
|
|
15010
15171
|
try {
|
|
15011
|
-
let seriesData = chartType !== chartTypes.TornadoChart ? [...inputSeries].reverse() : [...inputSeries];
|
|
15012
15172
|
let position = formatOptions.legends.legendPosition;
|
|
15013
15173
|
let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
|
|
15014
15174
|
let verticalLegendAlignment = formatOptions.legends.legendAlignment;
|
|
@@ -15111,21 +15271,13 @@
|
|
|
15111
15271
|
chartData.forEach(
|
|
15112
15272
|
(d) => d.data.forEach(
|
|
15113
15273
|
(j) => {
|
|
15114
|
-
j["markerShape"] = type
|
|
15274
|
+
j["markerShape"] = [chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) && !formatOptions.plotArea.plotAreaHideLineAndMarkers ? "None" : d.properties.markerShape ? d.properties.markerShape : "Circle";
|
|
15115
15275
|
j["currentMeasure"] = d.properties.currentMeasure;
|
|
15276
|
+
j["markerColor"] = d.properties.markerColor ? d.properties.markerColor : "Blue";
|
|
15277
|
+
j["markerSize"] = d.properties.markerShape != "None" && d.properties.markerSize && d.properties.markerShape != "None" ? type === "Area" ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? d.properties.markerSize : 0 : d.properties.markerSize : 0;
|
|
15116
15278
|
}
|
|
15117
15279
|
)
|
|
15118
15280
|
);
|
|
15119
|
-
chartData.forEach(
|
|
15120
|
-
(d) => d.data.forEach(
|
|
15121
|
-
(j) => j["markerColor"] = d.properties.markerColor ? d.properties.markerColor : "Blue"
|
|
15122
|
-
)
|
|
15123
|
-
);
|
|
15124
|
-
chartData.forEach(
|
|
15125
|
-
(d) => d.data.forEach(
|
|
15126
|
-
(j) => j["markerSize"] = d.properties.markerShape != "None" && d.properties.markerSize && d.properties.markerShape != "None" ? type === "Area" ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? d.properties.markerSize : 0 : d.properties.markerSize : 0
|
|
15127
|
-
)
|
|
15128
|
-
);
|
|
15129
15281
|
let markerGroups = lines.selectAll(".lineGroup").data(chartData, (d) => d.legend);
|
|
15130
15282
|
let markerGroupsEnter = markerGroups.enter().append("g").attr("class", "parentGroup").attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-"));
|
|
15131
15283
|
let mergedMarkerGroups = markerGroupsEnter.merge(markerGroups);
|
|
@@ -15137,12 +15289,12 @@
|
|
|
15137
15289
|
return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
|
|
15138
15290
|
}).attr("visibility", (d) => {
|
|
15139
15291
|
const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
|
|
15140
|
-
const visible = formatOptions.marker.markerVisibility ? checkVisibleConditions(chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) ? "hidden" : [chartTypes.NormalizedStackLineChart,
|
|
15292
|
+
const visible = formatOptions.marker.markerVisibility ? checkVisibleConditions(chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) ? "hidden" : [chartTypes.NormalizedStackLineChart, chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) ? "visible" : [chartTypes.StackAreaChart, chartTypes.AreaChart, chartTypes.CombinationStackArea].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "visible" : [chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) ? "visible" : ["Area"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "hidden";
|
|
15141
15293
|
return hideByX ? "hidden" : visible;
|
|
15142
15294
|
}).attr("transform", (d) => {
|
|
15143
|
-
let requiredYScale = d.axis ==
|
|
15295
|
+
let requiredYScale = d.axis == axisTypes.primary ? yScale : yScaleRight;
|
|
15144
15296
|
const x2 = xScale(d.dimension);
|
|
15145
|
-
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart,
|
|
15297
|
+
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? d[1] > 0 ? requiredYScale(d[1]) : requiredYScale(d[0]) : requiredYScale(d.value);
|
|
15146
15298
|
return `translate(${x2},${y2})`;
|
|
15147
15299
|
}).on("mousemove", function(event2, d) {
|
|
15148
15300
|
const dataPoint = d;
|
|
@@ -15180,13 +15332,13 @@
|
|
|
15180
15332
|
);
|
|
15181
15333
|
parentG.selectAll(".halo").remove();
|
|
15182
15334
|
parentG.insert("circle", ":first-child").attr("class", "halo").attr("cx", xScale(dataPoint.dimension)).attr("cy", () => {
|
|
15183
|
-
const requiredYScale = dataPoint.axis ===
|
|
15184
|
-
return [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart,
|
|
15335
|
+
const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
|
|
15336
|
+
return [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
|
|
15185
15337
|
}).attr("fill", legendEntry.markerColor).attr("opacity", 0.5).attr("r", legendEntry.markerSize * 10);
|
|
15186
15338
|
select$2(this).transition().duration(100).attr("transform", () => {
|
|
15187
|
-
const requiredYScale = dataPoint.axis ===
|
|
15339
|
+
const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
|
|
15188
15340
|
const x2 = xScale(dataPoint.dimension);
|
|
15189
|
-
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart,
|
|
15341
|
+
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
|
|
15190
15342
|
return `translate(${x2},${y2}) scale(1.3)`;
|
|
15191
15343
|
});
|
|
15192
15344
|
}).on("mouseout", function(event2, d) {
|
|
@@ -15195,9 +15347,9 @@
|
|
|
15195
15347
|
hideTooltipOnMouseOut();
|
|
15196
15348
|
parentG.selectAll(".halo").remove();
|
|
15197
15349
|
select$2(this).transition().duration(100).attr("transform", () => {
|
|
15198
|
-
const requiredYScale = dataPoint.axis ===
|
|
15350
|
+
const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
|
|
15199
15351
|
const x2 = xScale(dataPoint.dimension);
|
|
15200
|
-
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart,
|
|
15352
|
+
const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
|
|
15201
15353
|
return `translate(${x2},${y2}) scale(1)`;
|
|
15202
15354
|
});
|
|
15203
15355
|
});
|
|
@@ -15209,10 +15361,10 @@
|
|
|
15209
15361
|
const checkVisibleConditions = (chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) => {
|
|
15210
15362
|
try {
|
|
15211
15363
|
if (chartData[0].properties.axis && chartData[0].properties.axis === "Secondary") {
|
|
15212
|
-
return hideZeroValues && d.
|
|
15364
|
+
return hideZeroValues && d.value == 0 || d.value > secondaryCustomYaxisMaxValue || d.value < secondaryCustomYaxisMinValue;
|
|
15213
15365
|
} else if (type.includes("Stack")) {
|
|
15214
|
-
return d.
|
|
15215
|
-
} else return hideZeroValues && d.
|
|
15366
|
+
return d.value > 0 ? hideZeroValues && d[1] == 0 || d[1] < customYaxisMinValue || d[1] > customYaxisMaxValue : hideZeroValues && d[0] == 0 || d[0] < customYaxisMinValue || d[0] > customYaxisMaxValue;
|
|
15367
|
+
} else return hideZeroValues && d.value == 0 || d.value < customYaxisMinValue || d.value > customYaxisMaxValue;
|
|
15216
15368
|
} catch (error) {
|
|
15217
15369
|
logError$2(fileName$b, "checkVisibleConditions", error);
|
|
15218
15370
|
}
|
|
@@ -15422,7 +15574,7 @@
|
|
|
15422
15574
|
}
|
|
15423
15575
|
function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
|
|
15424
15576
|
try {
|
|
15425
|
-
const markerColor = prop?.markerColor ?? "blue";
|
|
15577
|
+
const markerColor = prop.color ?? prop?.markerColor ?? "blue";
|
|
15426
15578
|
const markerShape = prop?.markerShape.toLowerCase() ?? "circle";
|
|
15427
15579
|
const isLightTheme = chartFormatOptions.toolTip.toolTipTheme === "Light";
|
|
15428
15580
|
const bgColor = isLightTheme ? "rgba(255, 255, 255)" : "#272729ff";
|
|
@@ -16010,7 +16162,7 @@
|
|
|
16010
16162
|
return {
|
|
16011
16163
|
...item,
|
|
16012
16164
|
properties,
|
|
16013
|
-
data:
|
|
16165
|
+
data: normalizedData
|
|
16014
16166
|
};
|
|
16015
16167
|
});
|
|
16016
16168
|
} catch (error) {
|
|
@@ -16474,7 +16626,9 @@
|
|
|
16474
16626
|
)
|
|
16475
16627
|
).tickSize(
|
|
16476
16628
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
16477
|
-
).tickValues(
|
|
16629
|
+
).tickValues(
|
|
16630
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
16631
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
16478
16632
|
}
|
|
16479
16633
|
if (isSecondaryAxisDrawn) {
|
|
16480
16634
|
yAxisRight = axisRight(yScaleRight).tickFormat(
|
|
@@ -16523,7 +16677,13 @@
|
|
|
16523
16677
|
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
|
|
16524
16678
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
16525
16679
|
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
|
|
16526
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
16680
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
16681
|
+
"hoverId",
|
|
16682
|
+
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
16683
|
+
/\s+/g,
|
|
16684
|
+
"-"
|
|
16685
|
+
)
|
|
16686
|
+
).attr(
|
|
16527
16687
|
"transform",
|
|
16528
16688
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
16529
16689
|
);
|
|
@@ -16536,9 +16696,12 @@
|
|
|
16536
16696
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
16537
16697
|
);
|
|
16538
16698
|
const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legend)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
16539
|
-
const yScale = data2.properties.axis ===
|
|
16699
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
16540
16700
|
return yScale(0);
|
|
16541
|
-
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16701
|
+
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16702
|
+
"stroke-dasharray",
|
|
16703
|
+
(d) => d.stackBorderStyle === 2 ? "5,3" : "0"
|
|
16704
|
+
).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
|
|
16542
16705
|
"stroke",
|
|
16543
16706
|
(d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
|
|
16544
16707
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
@@ -16547,10 +16710,10 @@
|
|
|
16547
16710
|
);
|
|
16548
16711
|
const finalBars = bars;
|
|
16549
16712
|
finalBars.attr("y", (d) => {
|
|
16550
|
-
const yScale = data2.properties.axis ===
|
|
16713
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
16551
16714
|
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
16552
16715
|
}).attr("height", (d) => {
|
|
16553
|
-
const yScale = data2.properties.axis ===
|
|
16716
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
16554
16717
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
16555
16718
|
});
|
|
16556
16719
|
columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
|
|
@@ -16746,10 +16909,6 @@
|
|
|
16746
16909
|
let xScale;
|
|
16747
16910
|
let xScaleForLegends;
|
|
16748
16911
|
let calculatedRange;
|
|
16749
|
-
let stackAreaChartDataForPrimaryAxis = [];
|
|
16750
|
-
let stackAreaChartDataForSecondaryAxis = [];
|
|
16751
|
-
let stackColumnChartDataForPrimaryAxis = [];
|
|
16752
|
-
let stackColumnChartDataForSecondaryAxis = [];
|
|
16753
16912
|
let primaryStackAxisData = [];
|
|
16754
16913
|
let secondaryStackAxisData = [];
|
|
16755
16914
|
let primaryStackAreaAxisData = [];
|
|
@@ -16965,7 +17124,7 @@
|
|
|
16965
17124
|
secondaryStackAreaAxisData.push(series);
|
|
16966
17125
|
}
|
|
16967
17126
|
}
|
|
16968
|
-
if (series.properties.axis ===
|
|
17127
|
+
if (series.properties.axis === axisTypes.primary) {
|
|
16969
17128
|
primaryStackAxisData.push(series);
|
|
16970
17129
|
if (series.properties.type == chartTypes.StackColumnChart) {
|
|
16971
17130
|
primaryStackColumnAxisData.push(series);
|
|
@@ -17021,7 +17180,8 @@
|
|
|
17021
17180
|
primaryStackAreaAxisData,
|
|
17022
17181
|
primaryStackColumnAxisData,
|
|
17023
17182
|
secondaryStackAreaAxisData,
|
|
17024
|
-
secondaryStackColumnAxisData
|
|
17183
|
+
secondaryStackColumnAxisData,
|
|
17184
|
+
seriesData
|
|
17025
17185
|
);
|
|
17026
17186
|
if (primaryStackAxisData.length > 0) {
|
|
17027
17187
|
let valueArray = [];
|
|
@@ -17062,91 +17222,85 @@
|
|
|
17062
17222
|
);
|
|
17063
17223
|
}
|
|
17064
17224
|
};
|
|
17065
|
-
const checkAndupdateInputData = (primaryStackAreaAxisData2, primaryStackColumnAxisData2, secondaryStackAreaAxisData2, secondaryStackColumnAxisData2) => {
|
|
17066
|
-
|
|
17225
|
+
const checkAndupdateInputData = (primaryStackAreaAxisData2, primaryStackColumnAxisData2, secondaryStackAreaAxisData2, secondaryStackColumnAxisData2, ChartData) => {
|
|
17226
|
+
const tempStackAreaChartDataForPrimaryAxis = getStackedData(
|
|
17067
17227
|
filteredDimension,
|
|
17068
17228
|
primaryStackAreaAxisData2,
|
|
17069
17229
|
false
|
|
17070
17230
|
);
|
|
17071
|
-
|
|
17231
|
+
const tempStackAreaChartDataForSecondaryAxis = getStackedData(
|
|
17072
17232
|
filteredDimension,
|
|
17073
17233
|
secondaryStackAreaAxisData2,
|
|
17074
17234
|
false
|
|
17075
17235
|
);
|
|
17076
|
-
|
|
17236
|
+
const tempStackColumnChartDataForPrimaryAxis = getStackedData(
|
|
17077
17237
|
filteredDimension,
|
|
17078
17238
|
primaryStackColumnAxisData2,
|
|
17079
17239
|
false
|
|
17080
17240
|
);
|
|
17081
|
-
|
|
17241
|
+
const tempStackColumnChartDataForSecondaryAxis = getStackedData(
|
|
17082
17242
|
filteredDimension,
|
|
17083
17243
|
secondaryStackColumnAxisData2,
|
|
17084
17244
|
false
|
|
17085
17245
|
);
|
|
17086
17246
|
requiredData = [];
|
|
17087
|
-
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
legend: d.properties.legend
|
|
17098
|
-
},
|
|
17099
|
-
stackData: tempStackAreaChartDataForPrimaryAxis,
|
|
17100
|
-
data: primaryStackAreaAxisData2
|
|
17101
|
-
});
|
|
17247
|
+
const allGeneratedData = [];
|
|
17248
|
+
primaryStackAreaAxisData2.forEach((d) => {
|
|
17249
|
+
allGeneratedData.push({
|
|
17250
|
+
properties: {
|
|
17251
|
+
axis: d.properties.axis,
|
|
17252
|
+
type: d.properties.type,
|
|
17253
|
+
legend: d.properties.legend
|
|
17254
|
+
},
|
|
17255
|
+
stackData: tempStackAreaChartDataForPrimaryAxis,
|
|
17256
|
+
data: primaryStackAreaAxisData2
|
|
17102
17257
|
});
|
|
17103
|
-
}
|
|
17104
|
-
|
|
17105
|
-
|
|
17106
|
-
|
|
17107
|
-
|
|
17108
|
-
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17113
|
-
data: secondaryStackAreaAxisData2
|
|
17114
|
-
});
|
|
17258
|
+
});
|
|
17259
|
+
secondaryStackAreaAxisData2.forEach((d) => {
|
|
17260
|
+
allGeneratedData.push({
|
|
17261
|
+
properties: {
|
|
17262
|
+
axis: d.properties.axis,
|
|
17263
|
+
type: d.properties.type,
|
|
17264
|
+
legend: d.properties.legend
|
|
17265
|
+
},
|
|
17266
|
+
stackData: tempStackAreaChartDataForSecondaryAxis,
|
|
17267
|
+
data: secondaryStackAreaAxisData2
|
|
17115
17268
|
});
|
|
17116
|
-
}
|
|
17117
|
-
|
|
17118
|
-
|
|
17119
|
-
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
|
|
17123
|
-
|
|
17124
|
-
|
|
17125
|
-
|
|
17126
|
-
data: primaryStackColumnAxisData2
|
|
17127
|
-
});
|
|
17269
|
+
});
|
|
17270
|
+
primaryStackColumnAxisData2.forEach((d) => {
|
|
17271
|
+
allGeneratedData.push({
|
|
17272
|
+
properties: {
|
|
17273
|
+
axis: d.properties.axis,
|
|
17274
|
+
type: d.properties.type,
|
|
17275
|
+
legend: d.properties.legend
|
|
17276
|
+
},
|
|
17277
|
+
stackData: tempStackColumnChartDataForPrimaryAxis,
|
|
17278
|
+
data: primaryStackColumnAxisData2
|
|
17128
17279
|
});
|
|
17129
|
-
}
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
|
|
17133
|
-
|
|
17134
|
-
|
|
17135
|
-
|
|
17136
|
-
|
|
17137
|
-
|
|
17138
|
-
|
|
17139
|
-
data: secondaryStackColumnAxisData2
|
|
17140
|
-
});
|
|
17280
|
+
});
|
|
17281
|
+
secondaryStackColumnAxisData2.forEach((d) => {
|
|
17282
|
+
allGeneratedData.push({
|
|
17283
|
+
properties: {
|
|
17284
|
+
axis: d.properties.axis,
|
|
17285
|
+
type: d.properties.type,
|
|
17286
|
+
legend: d.properties.legend
|
|
17287
|
+
},
|
|
17288
|
+
stackData: tempStackColumnChartDataForSecondaryAxis,
|
|
17289
|
+
data: secondaryStackColumnAxisData2
|
|
17141
17290
|
});
|
|
17291
|
+
});
|
|
17292
|
+
allGeneratedData.push(...chartJSON.chartData);
|
|
17293
|
+
if (ChartData.length) {
|
|
17294
|
+
const ordered = [];
|
|
17295
|
+
ChartData.forEach((data2) => {
|
|
17296
|
+
ordered.push(
|
|
17297
|
+
...allGeneratedData.filter((d) => d.properties?.type === data2.properties.type && d.properties.legend === data2.legend)
|
|
17298
|
+
);
|
|
17299
|
+
});
|
|
17300
|
+
requiredData.push(...ordered);
|
|
17301
|
+
} else {
|
|
17302
|
+
requiredData.push(...allGeneratedData);
|
|
17142
17303
|
}
|
|
17143
|
-
requiredData.push(
|
|
17144
|
-
...chartJSON.chartData,
|
|
17145
|
-
...stackAreaChartDataForPrimaryAxis,
|
|
17146
|
-
...stackAreaChartDataForSecondaryAxis,
|
|
17147
|
-
...stackColumnChartDataForPrimaryAxis,
|
|
17148
|
-
...stackColumnChartDataForSecondaryAxis
|
|
17149
|
-
);
|
|
17150
17304
|
};
|
|
17151
17305
|
const initScale = () => {
|
|
17152
17306
|
let yAxisLabelArray = responsiveYaxisLabel$1(
|
|
@@ -17189,7 +17343,7 @@
|
|
|
17189
17343
|
calculatedRange = [0, innerWidth2];
|
|
17190
17344
|
};
|
|
17191
17345
|
const getXScale = () => {
|
|
17192
|
-
xScaleForLegends = band().domain(chartJSON.legendList).range([0, columnWidth]).paddingInner(
|
|
17346
|
+
xScaleForLegends = band().domain(chartJSON.legendList.reverse()).range([0, columnWidth]).paddingInner(
|
|
17193
17347
|
chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
|
|
17194
17348
|
);
|
|
17195
17349
|
xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
|
|
@@ -17219,6 +17373,15 @@
|
|
|
17219
17373
|
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
17220
17374
|
}
|
|
17221
17375
|
if (isSecondaryAxisDrawn) {
|
|
17376
|
+
let responsiveLablesObj = responsiveYaxisLabel$1(
|
|
17377
|
+
customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxRight,
|
|
17378
|
+
chartJSON.yMinRight,
|
|
17379
|
+
innerHeight2,
|
|
17380
|
+
formatOptions,
|
|
17381
|
+
chartJSON,
|
|
17382
|
+
customYaxisMinValue,
|
|
17383
|
+
customYaxisMaxValue
|
|
17384
|
+
);
|
|
17222
17385
|
yAxisRight = axisRight(yScaleRight).tickFormat(
|
|
17223
17386
|
(d) => getNumberWithFormat(
|
|
17224
17387
|
d,
|
|
@@ -17227,20 +17390,8 @@
|
|
|
17227
17390
|
formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
|
|
17228
17391
|
)
|
|
17229
17392
|
).tickValues(
|
|
17230
|
-
|
|
17231
|
-
|
|
17232
|
-
chartJSON.yMinRight,
|
|
17233
|
-
formatOptions,
|
|
17234
|
-
chartJSON
|
|
17235
|
-
).secondaryYAxisLabelArray
|
|
17236
|
-
).ticks(
|
|
17237
|
-
responsiveSecondaryYaxisLabel(
|
|
17238
|
-
secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
|
|
17239
|
-
chartJSON.yMinRight,
|
|
17240
|
-
formatOptions,
|
|
17241
|
-
chartJSON
|
|
17242
|
-
).secondaryCustomTickValue ?? innerHeight2 / 30
|
|
17243
|
-
).tickSize(
|
|
17393
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
17394
|
+
).ticks(responsiveLablesObj.customTickValue).tickSize(
|
|
17244
17395
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
|
|
17245
17396
|
).tickPadding(8).tickSizeOuter(0);
|
|
17246
17397
|
}
|
|
@@ -17257,10 +17408,8 @@
|
|
|
17257
17408
|
drawColumnChart(data2);
|
|
17258
17409
|
break;
|
|
17259
17410
|
case chartTypes.LineChart:
|
|
17260
|
-
drawLineChart([data2]);
|
|
17261
17411
|
break;
|
|
17262
17412
|
case chartTypes.AreaChart:
|
|
17263
|
-
drawAreaChart([data2]);
|
|
17264
17413
|
break;
|
|
17265
17414
|
case chartTypes.StackColumnChart:
|
|
17266
17415
|
stackColumnData = createStackData(data2);
|
|
@@ -17272,6 +17421,14 @@
|
|
|
17272
17421
|
break;
|
|
17273
17422
|
}
|
|
17274
17423
|
});
|
|
17424
|
+
const lineSeries = filteredData.filter((d) => d.properties.type === chartTypes.LineChart);
|
|
17425
|
+
if (lineSeries.length) {
|
|
17426
|
+
drawLineChart(lineSeries);
|
|
17427
|
+
}
|
|
17428
|
+
const AreaSeries = filteredData.filter((d) => d.properties.type === chartTypes.AreaChart);
|
|
17429
|
+
if (AreaSeries.length) {
|
|
17430
|
+
drawAreaChart(AreaSeries);
|
|
17431
|
+
}
|
|
17275
17432
|
gTag.selectAll(".parentGroup").raise();
|
|
17276
17433
|
};
|
|
17277
17434
|
const drawColumnChart = (data2) => {
|
|
@@ -17282,19 +17439,15 @@
|
|
|
17282
17439
|
"hoverId",
|
|
17283
17440
|
(d) => d.legend.includes("-") ? d.legend.replace("-", "`").split("`")[1].replace(/ /g, "-") : d.legend.replace(/ /g, "-")
|
|
17284
17441
|
).attr("transform", (d) => `translate(${xScale(d.dimension)}, 0)`);
|
|
17285
|
-
columnGroups.attr(
|
|
17286
|
-
"transform",
|
|
17287
|
-
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
17288
|
-
);
|
|
17289
17442
|
columnGroupsEnter.merge(columnGroups).attr(
|
|
17290
17443
|
"transform",
|
|
17291
17444
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
17292
17445
|
);
|
|
17293
17446
|
columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legend)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
17294
|
-
const yScale = data2.properties.axis ===
|
|
17447
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17295
17448
|
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
17296
17449
|
}).attr("height", (d) => {
|
|
17297
|
-
const yScale = data2.properties.axis ===
|
|
17450
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17298
17451
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
17299
17452
|
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => d.stackBorderStyle === 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
|
|
17300
17453
|
"stroke",
|
|
@@ -17330,7 +17483,8 @@
|
|
|
17330
17483
|
}
|
|
17331
17484
|
],
|
|
17332
17485
|
formatOptions,
|
|
17333
|
-
event2
|
|
17486
|
+
event2,
|
|
17487
|
+
seriesData.filter((e) => e.legend === d.legend)[0].properties
|
|
17334
17488
|
);
|
|
17335
17489
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
17336
17490
|
columnGroups.exit().remove();
|
|
@@ -17345,13 +17499,13 @@
|
|
|
17345
17499
|
const lineGenerator = line$1().x(
|
|
17346
17500
|
(d) => xScale(d.dimension) ? xScale(d.dimension) : null
|
|
17347
17501
|
).y(
|
|
17348
|
-
(d) => d.axis ==
|
|
17502
|
+
(d) => d.axis == axisTypes.primary ? yScaleLeft(d.value) : yScaleRight(d.value)
|
|
17349
17503
|
).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
17350
|
-
let lines = gTag.selectAll(".parentGroup").data([
|
|
17504
|
+
let lines = gTag.selectAll(".lines.parentGroup").data([1]);
|
|
17351
17505
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
17352
|
-
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
17506
|
+
let lineGroups = lines.selectAll(".line-group").data(lineData, (d) => d.legend);
|
|
17353
17507
|
let lineGroupsEnter = lineGroups.enter().append("g").attr("class", "line-group");
|
|
17354
|
-
lineGroupsEnter.attr("hoverId", (d) => d.
|
|
17508
|
+
lineGroupsEnter.attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "line").attr("fill", "none");
|
|
17355
17509
|
lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
|
|
17356
17510
|
"stroke",
|
|
17357
17511
|
(d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
|
|
@@ -17360,13 +17514,13 @@
|
|
|
17360
17514
|
case staticLineStyle.dotted:
|
|
17361
17515
|
return "0,3";
|
|
17362
17516
|
case staticLineStyle.dashed:
|
|
17363
|
-
return
|
|
17517
|
+
return strokeDashValues;
|
|
17364
17518
|
default:
|
|
17365
17519
|
return "";
|
|
17366
17520
|
}
|
|
17367
17521
|
}).attr(
|
|
17368
17522
|
"stroke-linecap",
|
|
17369
|
-
(d) => d.properties.lineStyle === staticLineStyle.dotted ?
|
|
17523
|
+
(d) => d.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
17370
17524
|
).attr(
|
|
17371
17525
|
"stroke-width",
|
|
17372
17526
|
(d) => d.properties.lineStyle !== "None" ? d.properties.lineWidth : "0"
|
|
@@ -17375,7 +17529,7 @@
|
|
|
17375
17529
|
lineMarkers(
|
|
17376
17530
|
lines,
|
|
17377
17531
|
lineData,
|
|
17378
|
-
|
|
17532
|
+
chartTypes.CombinationLine,
|
|
17379
17533
|
xScale,
|
|
17380
17534
|
yScaleLeft,
|
|
17381
17535
|
yScaleRight,
|
|
@@ -17389,27 +17543,33 @@
|
|
|
17389
17543
|
);
|
|
17390
17544
|
};
|
|
17391
17545
|
const drawAreaChart = (lineData) => {
|
|
17546
|
+
lineData.forEach((lData) => {
|
|
17547
|
+
lData.data.forEach((cData) => {
|
|
17548
|
+
cData.hideZero = lData.properties.hideZeroValues;
|
|
17549
|
+
cData.axis = lData.properties.axis;
|
|
17550
|
+
});
|
|
17551
|
+
});
|
|
17392
17552
|
const areaGenerator = area().x(
|
|
17393
17553
|
(d) => xScale(d.dimension) ? xScale(d.dimension) : null
|
|
17394
17554
|
).y0(
|
|
17395
17555
|
(d) => (
|
|
17396
|
-
// d.axis ==
|
|
17556
|
+
// d.axis == axisTypes.primary ?
|
|
17397
17557
|
yScaleLeft(0)
|
|
17398
17558
|
)
|
|
17399
17559
|
// : yScaleRight(0)
|
|
17400
17560
|
).y1(
|
|
17401
17561
|
(d) => (
|
|
17402
|
-
// d.axis ==
|
|
17562
|
+
// d.axis == axisTypes.primary ?
|
|
17403
17563
|
yScaleLeft(d.value)
|
|
17404
17564
|
)
|
|
17405
17565
|
// : yScaleRight((d as TDataPoint).value)
|
|
17406
17566
|
).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
17407
|
-
let areas = gTag.selectAll(".parentGroup").data([
|
|
17567
|
+
let areas = gTag.selectAll(".areas.parentGroup").data([1]);
|
|
17408
17568
|
let focus = gTag.append("g").attr("class", "focusClass");
|
|
17409
17569
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
|
|
17410
|
-
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
17570
|
+
let areaGroups = areas.selectAll(".area-group").data(lineData, (d) => d.legend);
|
|
17411
17571
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", "area-group");
|
|
17412
|
-
areaGroupsEnter.attr("hoverId", (d) => d.
|
|
17572
|
+
areaGroupsEnter.attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "area").attr(
|
|
17413
17573
|
"fill",
|
|
17414
17574
|
(d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
|
|
17415
17575
|
).style("fill-opacity", formatOptions.plotArea.fillOpacity);
|
|
@@ -17421,13 +17581,13 @@
|
|
|
17421
17581
|
case "dotted":
|
|
17422
17582
|
return "0,3";
|
|
17423
17583
|
case "dashed":
|
|
17424
|
-
return
|
|
17584
|
+
return strokeDashValues;
|
|
17425
17585
|
default:
|
|
17426
17586
|
return "";
|
|
17427
17587
|
}
|
|
17428
17588
|
}).attr(
|
|
17429
17589
|
"stroke-linecap",
|
|
17430
|
-
(d) => d.properties.lineStyle === "dotted" ?
|
|
17590
|
+
(d) => d.properties.lineStyle === "dotted" ? strokeLineCap.round : ""
|
|
17431
17591
|
).attr(
|
|
17432
17592
|
"stroke-width",
|
|
17433
17593
|
(d) => d.properties.lineStyle !== "None" && formatOptions.plotArea.plotAreaHideLineAndMarkers ? d.properties.lineWidth : "0"
|
|
@@ -17443,30 +17603,48 @@
|
|
|
17443
17603
|
chartType
|
|
17444
17604
|
);
|
|
17445
17605
|
areaGroups.exit().remove();
|
|
17606
|
+
lineMarkers(
|
|
17607
|
+
areas,
|
|
17608
|
+
lineData,
|
|
17609
|
+
chartTypes.CombinationArea,
|
|
17610
|
+
xScale,
|
|
17611
|
+
yScaleLeft,
|
|
17612
|
+
yScaleRight,
|
|
17613
|
+
null,
|
|
17614
|
+
formatOptions,
|
|
17615
|
+
chartJSON,
|
|
17616
|
+
secondaryCustomYaxisMaxValue,
|
|
17617
|
+
secondaryCustomYaxisMinValue,
|
|
17618
|
+
customYaxisMinValue,
|
|
17619
|
+
customYaxisMaxValue
|
|
17620
|
+
);
|
|
17446
17621
|
};
|
|
17447
17622
|
const drawStackAreaChart = (data2) => {
|
|
17623
|
+
data2.data.forEach((lData) => {
|
|
17624
|
+
lData.data.forEach((cData) => {
|
|
17625
|
+
cData.hideZero = lData.properties.hideZeroValues;
|
|
17626
|
+
cData.axis = lData.properties.axis;
|
|
17627
|
+
});
|
|
17628
|
+
});
|
|
17448
17629
|
const areaGenerator = area().x(
|
|
17449
17630
|
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
17450
17631
|
).y0(
|
|
17451
|
-
(d) => d.data.axis ==
|
|
17632
|
+
(d) => d.data.axis == axisTypes.primary ? yScaleLeft(0) : yScaleRight(0)
|
|
17452
17633
|
).y1(
|
|
17453
|
-
(d) => d.data.axis ==
|
|
17634
|
+
(d) => d.data.axis == axisTypes.primary ? d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0]) : d[1] > 0 ? yScaleRight(d[1]) : yScaleRight(d[0])
|
|
17454
17635
|
).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
|
|
17455
17636
|
let areas = gTag.selectAll(".parentGroup").data([stackAreaData]);
|
|
17456
17637
|
gTag.append("g").attr("class", "focusClass");
|
|
17457
17638
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
|
|
17458
17639
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
17459
17640
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
|
|
17460
|
-
areaGroupsEnter.attr(
|
|
17461
|
-
"hoverId",
|
|
17462
|
-
(d) => d.key.includes("~$~") ? d.key.split("~$~")[1].replace(/ /g, "-") : d.key.replace(/ /g, "-")
|
|
17463
|
-
).append("path").attr("class", "area").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none");
|
|
17641
|
+
areaGroupsEnter.attr("hoverId", (d) => (data2.data.filter((e) => e.legend === d.key)[0].properties.alias || data2.data.filter((e) => e.legend === d.key)[0].properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "area").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none");
|
|
17464
17642
|
areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d, i) => areaGenerator(d)).style("opacity", formatOptions.plotArea.fillOpacity).attr("stroke", (d) => d.color !== "#ffffff" ? d.color : "none").attr(
|
|
17465
17643
|
"stroke-dasharray",
|
|
17466
|
-
(d, i) => seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ?
|
|
17644
|
+
(d, i) => seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ? strokeDashValues : ""
|
|
17467
17645
|
).attr(
|
|
17468
17646
|
"stroke-linecap",
|
|
17469
|
-
(d, i) => seriesData[i].properties.lineStyle === "dotted" ?
|
|
17647
|
+
(d, i) => seriesData[i].properties.lineStyle === "dotted" ? strokeLineCap.round : ""
|
|
17470
17648
|
).attr(
|
|
17471
17649
|
"stroke-width",
|
|
17472
17650
|
(d, i) => seriesData[i].properties.lineStyle !== "None" ? seriesData[i].properties.lineWidth : "0"
|
|
@@ -17475,7 +17653,7 @@
|
|
|
17475
17653
|
lineMarkers(
|
|
17476
17654
|
areas,
|
|
17477
17655
|
data2.data,
|
|
17478
|
-
|
|
17656
|
+
chartTypes.CombinationStackArea,
|
|
17479
17657
|
xScale,
|
|
17480
17658
|
yScaleLeft,
|
|
17481
17659
|
yScaleRight,
|
|
@@ -17497,16 +17675,16 @@
|
|
|
17497
17675
|
let rects = stackColumnGroups.selectAll("rect").data((d) => d);
|
|
17498
17676
|
rects.enter().append("rect").attr(
|
|
17499
17677
|
"transform",
|
|
17500
|
-
(d) => `translate(${xScale(d.data.dimension) - columnWidth
|
|
17678
|
+
(d) => `translate(${xScale(d.data.dimension) - columnWidth},0)`
|
|
17501
17679
|
).merge(rects).attr(
|
|
17502
17680
|
"hoverId",
|
|
17503
17681
|
(d) => d.key.includes("~$~") ? d.key.split("~$~")[1].replace(/ /g, "-") : d.key.replace(/ /g, "-")
|
|
17504
17682
|
).attr("x", (d) => xScaleForLegends("stackLegend")).attr(
|
|
17505
17683
|
"y",
|
|
17506
|
-
(d) => d.data.axis ===
|
|
17684
|
+
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
|
|
17507
17685
|
).attr(
|
|
17508
17686
|
"height",
|
|
17509
|
-
(d) => d.data.axis ===
|
|
17687
|
+
(d) => d.data.axis === axisTypes.primary ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
|
|
17510
17688
|
).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
|
|
17511
17689
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17512
17690
|
(sdata) => sdata.legend === d.key
|
|
@@ -17550,7 +17728,8 @@
|
|
|
17550
17728
|
}
|
|
17551
17729
|
],
|
|
17552
17730
|
formatOptions,
|
|
17553
|
-
event2
|
|
17731
|
+
event2,
|
|
17732
|
+
seriesData.filter((e) => e.legend === d.key)[0].properties
|
|
17554
17733
|
);
|
|
17555
17734
|
}).on("mouseout", hideTooltipOnMouseOut);
|
|
17556
17735
|
stackColumnGroups.exit().remove();
|
|
@@ -17567,7 +17746,8 @@
|
|
|
17567
17746
|
primaryStackAreaAxisData,
|
|
17568
17747
|
primaryStackColumnAxisData,
|
|
17569
17748
|
secondaryStackAreaAxisData,
|
|
17570
|
-
secondaryStackColumnAxisData
|
|
17749
|
+
secondaryStackColumnAxisData,
|
|
17750
|
+
fData
|
|
17571
17751
|
);
|
|
17572
17752
|
filteredData = JSON.parse(JSON.stringify(requiredData));
|
|
17573
17753
|
filteredData.forEach((data2, i) => {
|
|
@@ -18014,7 +18194,9 @@
|
|
|
18014
18194
|
)
|
|
18015
18195
|
).tickSize(
|
|
18016
18196
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
18017
|
-
).tickValues(
|
|
18197
|
+
).tickValues(
|
|
18198
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
18199
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
18018
18200
|
}
|
|
18019
18201
|
};
|
|
18020
18202
|
const getXAxis = () => {
|
|
@@ -18034,7 +18216,13 @@
|
|
|
18034
18216
|
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
|
|
18035
18217
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
18036
18218
|
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
|
|
18037
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
18219
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
18220
|
+
"hoverId",
|
|
18221
|
+
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
18222
|
+
/\s+/g,
|
|
18223
|
+
"-"
|
|
18224
|
+
)
|
|
18225
|
+
).attr(
|
|
18038
18226
|
"transform",
|
|
18039
18227
|
(d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
|
|
18040
18228
|
);
|
|
@@ -18047,10 +18235,10 @@
|
|
|
18047
18235
|
(d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
|
|
18048
18236
|
);
|
|
18049
18237
|
columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.dimension)).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
|
|
18050
|
-
const yScale = data2.properties.axis ===
|
|
18238
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18051
18239
|
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
18052
18240
|
}).attr("height", (d) => {
|
|
18053
|
-
const yScale = data2.properties.axis ===
|
|
18241
|
+
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18054
18242
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
18055
18243
|
}).attr("fill", data2.properties.color).attr(
|
|
18056
18244
|
"stroke-dasharray",
|
|
@@ -18211,11 +18399,8 @@
|
|
|
18211
18399
|
let scrollbarVisible = false;
|
|
18212
18400
|
const chartType = chartTypes.StackColumnChart;
|
|
18213
18401
|
const svgRef = require$$0$1.useRef();
|
|
18214
|
-
const seriesData = generalizedChartData(
|
|
18215
|
-
data.ChartData,
|
|
18216
|
-
data.DimensionList
|
|
18217
|
-
)?.reverse();
|
|
18218
18402
|
const dimensionList = data.DimensionList;
|
|
18403
|
+
const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
|
|
18219
18404
|
const barChart = false;
|
|
18220
18405
|
const isSecondaryAxisDrawn = false;
|
|
18221
18406
|
let customYaxisMinValue = parseFloat(formatOptions.yAxisLabel.yAxisMinText);
|
|
@@ -18257,6 +18442,7 @@
|
|
|
18257
18442
|
let scrollPosition = 0;
|
|
18258
18443
|
let visibleBars;
|
|
18259
18444
|
let stackChartData = [];
|
|
18445
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
18260
18446
|
const isNormalizedChart = false;
|
|
18261
18447
|
let chartJSON = {
|
|
18262
18448
|
dimensionList,
|
|
@@ -18411,7 +18597,7 @@
|
|
|
18411
18597
|
width,
|
|
18412
18598
|
legendMargin,
|
|
18413
18599
|
formatOptions,
|
|
18414
|
-
seriesData,
|
|
18600
|
+
[...seriesData].reverse(),
|
|
18415
18601
|
chartId,
|
|
18416
18602
|
staticLegendShape.rectangle
|
|
18417
18603
|
);
|
|
@@ -18512,7 +18698,9 @@
|
|
|
18512
18698
|
)
|
|
18513
18699
|
).tickSize(
|
|
18514
18700
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
|
|
18515
|
-
).tickValues(
|
|
18701
|
+
).tickValues(
|
|
18702
|
+
respParams.autoLabelFlag ? void 0 : respParams.yAxisLabelArray
|
|
18703
|
+
).ticks(respParams.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
18516
18704
|
}
|
|
18517
18705
|
};
|
|
18518
18706
|
const getXAxis = () => {
|
|
@@ -18611,6 +18799,7 @@
|
|
|
18611
18799
|
filteredData = fData;
|
|
18612
18800
|
filteredDimension = fDimension;
|
|
18613
18801
|
visibleBars = fVisibleBars;
|
|
18802
|
+
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
18614
18803
|
drawLineChart();
|
|
18615
18804
|
};
|
|
18616
18805
|
const drawLineChart = () => {
|
|
@@ -18660,6 +18849,20 @@
|
|
|
18660
18849
|
dataTableHeight,
|
|
18661
18850
|
isReportEditable
|
|
18662
18851
|
);
|
|
18852
|
+
addTotalValue(
|
|
18853
|
+
totalValueMap,
|
|
18854
|
+
xScale,
|
|
18855
|
+
yScaleLeft,
|
|
18856
|
+
margin,
|
|
18857
|
+
d3Annotation,
|
|
18858
|
+
[],
|
|
18859
|
+
formatOptions,
|
|
18860
|
+
chartType,
|
|
18861
|
+
height,
|
|
18862
|
+
width,
|
|
18863
|
+
svg,
|
|
18864
|
+
isReportEditable
|
|
18865
|
+
);
|
|
18663
18866
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
18664
18867
|
if (formatOptions.xAxisLabel.xAxisPosition != "1") {
|
|
18665
18868
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
@@ -19131,7 +19334,7 @@
|
|
|
19131
19334
|
width,
|
|
19132
19335
|
legendMargin,
|
|
19133
19336
|
formatOptions,
|
|
19134
|
-
seriesData,
|
|
19337
|
+
[...seriesData].reverse(),
|
|
19135
19338
|
chartId,
|
|
19136
19339
|
staticLegendShape.rectangle
|
|
19137
19340
|
);
|
|
@@ -19264,7 +19467,10 @@
|
|
|
19264
19467
|
let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
19265
19468
|
columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
|
|
19266
19469
|
let columnGroups = columns.selectAll(".column-group").data((d) => d);
|
|
19267
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
19470
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
19471
|
+
"hoverId",
|
|
19472
|
+
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
19473
|
+
);
|
|
19268
19474
|
columnGroups = columnGroupsEnter.merge(columnGroups);
|
|
19269
19475
|
let rects = columnGroups.selectAll("rect").data((d) => d);
|
|
19270
19476
|
const getPropsForRect = (nodes, i) => {
|
|
@@ -20691,6 +20897,9 @@
|
|
|
20691
20897
|
let yMinLeft = Infinity;
|
|
20692
20898
|
let yMaxRight = -Infinity;
|
|
20693
20899
|
let yMinRight = Infinity;
|
|
20900
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
20901
|
+
chartJSON.hideZeroValues = true;
|
|
20902
|
+
}
|
|
20694
20903
|
seriesData.forEach((series) => {
|
|
20695
20904
|
legendList.push(
|
|
20696
20905
|
series.properties.alias ? series.properties.alias : series.legend
|
|
@@ -20729,9 +20938,6 @@
|
|
|
20729
20938
|
} else {
|
|
20730
20939
|
filteredDimension = chartJSON.dimensionList;
|
|
20731
20940
|
}
|
|
20732
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
20733
|
-
chartJSON.hideZeroValues = true;
|
|
20734
|
-
}
|
|
20735
20941
|
};
|
|
20736
20942
|
const initScale = () => {
|
|
20737
20943
|
let yAxisLabelArray = responsiveYaxisLabel$1(
|
|
@@ -20807,7 +21013,9 @@
|
|
|
20807
21013
|
)
|
|
20808
21014
|
).tickSize(
|
|
20809
21015
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
20810
|
-
).tickValues(
|
|
21016
|
+
).tickValues(
|
|
21017
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
21018
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
20811
21019
|
}
|
|
20812
21020
|
if (isSecondaryAxisDrawn) {
|
|
20813
21021
|
let responsiveSecondaryLablesObj = responsiveSecondaryYaxisLabel(
|
|
@@ -20823,7 +21031,9 @@
|
|
|
20823
21031
|
formatOptions.secondaryYAxisLabel.secondaryYAxisNumberFormat,
|
|
20824
21032
|
formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
|
|
20825
21033
|
)
|
|
20826
|
-
).tickValues(
|
|
21034
|
+
).tickValues(
|
|
21035
|
+
responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray
|
|
21036
|
+
).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
|
|
20827
21037
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
|
|
20828
21038
|
).tickPadding(8).tickSizeOuter(0);
|
|
20829
21039
|
}
|
|
@@ -20844,8 +21054,10 @@
|
|
|
20844
21054
|
const val = xScale(d.dimension);
|
|
20845
21055
|
return val != null ? val : 0;
|
|
20846
21056
|
}).y(
|
|
20847
|
-
(d) => d.axis ===
|
|
20848
|
-
).defined(
|
|
21057
|
+
(d) => d.axis === axisTypes.primary ? yScaleLeft(d.value) : yScaleRight(d.value)
|
|
21058
|
+
).defined(
|
|
21059
|
+
(d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
|
|
21060
|
+
).curve(getCurveType(formatOptions));
|
|
20849
21061
|
let lines = gTag.selectAll(".parentGroup").data([lineData]);
|
|
20850
21062
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
20851
21063
|
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
@@ -20857,32 +21069,25 @@
|
|
|
20857
21069
|
"stroke",
|
|
20858
21070
|
(d2) => d2.properties.color !== "#ffffff" ? d2.properties.color : "none"
|
|
20859
21071
|
).attr("stroke-dasharray", (d2) => {
|
|
21072
|
+
const lineWidth = parseInt(d2.properties.lineWidth);
|
|
20860
21073
|
switch (d2.properties.lineStyle) {
|
|
20861
21074
|
case staticLineStyle.dotted:
|
|
20862
|
-
return
|
|
21075
|
+
return `0,${lineWidth + 2}`;
|
|
20863
21076
|
case staticLineStyle.dashed:
|
|
20864
|
-
return
|
|
21077
|
+
return strokeDashValues;
|
|
20865
21078
|
default:
|
|
20866
21079
|
return "";
|
|
20867
21080
|
}
|
|
20868
21081
|
}).attr(
|
|
20869
21082
|
"stroke-linecap",
|
|
20870
|
-
(d2) => d2.properties.lineStyle === staticLineStyle.dotted ?
|
|
21083
|
+
(d2) => d2.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
20871
21084
|
).attr(
|
|
20872
21085
|
"stroke-width",
|
|
20873
|
-
(d2) => d2.properties.lineStyle !== "None" ?
|
|
20874
|
-
).attr(
|
|
20875
|
-
|
|
20876
|
-
|
|
20877
|
-
|
|
20878
|
-
'[hoverId="' + getJQuerySelector(d2.properties.alias || d2.properties.name || "Legend").replace(/\s+/g, "-") + '"]'
|
|
20879
|
-
).classed("highlight", true).classed("unhighlight", false);
|
|
20880
|
-
}).on("mouseleave", function(event2, d2) {
|
|
20881
|
-
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
20882
|
-
svg.selectAll(
|
|
20883
|
-
'[hoverId="' + getJQuerySelector(d2.properties?.alias || d2.properties?.name || "Legend").replace(/\s+/g, "-") + '"]'
|
|
20884
|
-
).classed("highlight", false).classed("unhighlight", false);
|
|
20885
|
-
});
|
|
21086
|
+
(d2) => d2.properties.lineStyle !== "None" ? d2.properties.lineWidth : 0
|
|
21087
|
+
).attr(
|
|
21088
|
+
"hoverId",
|
|
21089
|
+
(d.properties.alias || lineGroups.properties.name || "Legend").replace(/\s+/g, "-")
|
|
21090
|
+
).attr("d", (d2) => lineGenerator(d2.data));
|
|
20886
21091
|
});
|
|
20887
21092
|
lineGroups.exit().remove();
|
|
20888
21093
|
lineMarkers(
|
|
@@ -21009,12 +21214,10 @@
|
|
|
21009
21214
|
const barWidth = 0;
|
|
21010
21215
|
const chartType = chartTypes.StackLineChart;
|
|
21011
21216
|
const svgRef = require$$0$1.useRef();
|
|
21012
|
-
const seriesData = generalizedChartData(
|
|
21013
|
-
data.ChartData,
|
|
21014
|
-
data.DimensionList
|
|
21015
|
-
)?.reverse() || [];
|
|
21016
21217
|
const dimensionList = data.DimensionList;
|
|
21218
|
+
const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
|
|
21017
21219
|
const barChart = false;
|
|
21220
|
+
const totalValueMap = /* @__PURE__ */ new Map();
|
|
21018
21221
|
const isSecondaryAxisDrawn = false;
|
|
21019
21222
|
let customYaxisMinValue = parseFloat(formatOptions.yAxisLabel.yAxisMinText);
|
|
21020
21223
|
let customYaxisMaxValue = parseFloat(formatOptions.yAxisLabel.yAxisMaxText);
|
|
@@ -21203,7 +21406,7 @@
|
|
|
21203
21406
|
width,
|
|
21204
21407
|
legendMargin,
|
|
21205
21408
|
formatOptions,
|
|
21206
|
-
seriesData,
|
|
21409
|
+
[...seriesData].reverse(),
|
|
21207
21410
|
chartId,
|
|
21208
21411
|
staticLegendShape.line
|
|
21209
21412
|
);
|
|
@@ -21221,10 +21424,27 @@
|
|
|
21221
21424
|
false,
|
|
21222
21425
|
setAndUpdateChartData
|
|
21223
21426
|
);
|
|
21427
|
+
addTotalValue(
|
|
21428
|
+
totalValueMap,
|
|
21429
|
+
xScale,
|
|
21430
|
+
yScaleLeft,
|
|
21431
|
+
margin,
|
|
21432
|
+
d3Annotation,
|
|
21433
|
+
[],
|
|
21434
|
+
formatOptions,
|
|
21435
|
+
chartType,
|
|
21436
|
+
height,
|
|
21437
|
+
width,
|
|
21438
|
+
svg,
|
|
21439
|
+
isReportEditable
|
|
21440
|
+
);
|
|
21224
21441
|
};
|
|
21225
21442
|
const preProcessChartData = () => {
|
|
21226
21443
|
const allChartData = [];
|
|
21227
21444
|
const legendList = [];
|
|
21445
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
21446
|
+
chartJSON.hideZeroValues = true;
|
|
21447
|
+
}
|
|
21228
21448
|
seriesData.forEach((series, index2) => {
|
|
21229
21449
|
const prefixedLegend = `${index2}~$~${series.properties.alias ? series.properties.alias : series.legend}`;
|
|
21230
21450
|
series.properties.legend = prefixedLegend;
|
|
@@ -21273,9 +21493,6 @@
|
|
|
21273
21493
|
chartJSON.dimensionList.forEach((d, i) => {
|
|
21274
21494
|
chartJSON.formattedDimensionListMap.set(d, formatedDimensionList[i]);
|
|
21275
21495
|
});
|
|
21276
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
21277
|
-
chartJSON.hideZeroValues = true;
|
|
21278
|
-
}
|
|
21279
21496
|
};
|
|
21280
21497
|
const initScale = () => {
|
|
21281
21498
|
let yAxisLabelArray = responsiveYaxisLabel$1(
|
|
@@ -21339,7 +21556,9 @@
|
|
|
21339
21556
|
)
|
|
21340
21557
|
).tickSize(
|
|
21341
21558
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
21342
|
-
).tickValues(
|
|
21559
|
+
).tickValues(
|
|
21560
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
21561
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
21343
21562
|
}
|
|
21344
21563
|
};
|
|
21345
21564
|
const getXAxis = () => {
|
|
@@ -21356,7 +21575,10 @@
|
|
|
21356
21575
|
});
|
|
21357
21576
|
const lineGenerator = line$1().x(
|
|
21358
21577
|
(d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
|
|
21359
|
-
).y((d) => d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0])).
|
|
21578
|
+
).y((d) => d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0])).defined((d) => {
|
|
21579
|
+
const a2 = d;
|
|
21580
|
+
return a2.hideZero || chartJSON.hideZeroValues ? a2.data[a2.key] : true;
|
|
21581
|
+
}).curve(getCurveType(formatOptions));
|
|
21360
21582
|
let lines = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
21361
21583
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
21362
21584
|
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
@@ -21364,15 +21586,27 @@
|
|
|
21364
21586
|
lineGroupsEnter.append("path").attr("class", "line").attr("fill", "none");
|
|
21365
21587
|
lineGroupsEnter.merge(lineGroups).each(function(d, i) {
|
|
21366
21588
|
const g = select$2(this);
|
|
21367
|
-
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr(
|
|
21368
|
-
"
|
|
21369
|
-
seriesData[i]
|
|
21370
|
-
).attr(
|
|
21589
|
+
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr(
|
|
21590
|
+
"hoverId",
|
|
21591
|
+
(d2) => (seriesData[i]?.properties?.alias || seriesData[i]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
21592
|
+
).attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr("stroke-dasharray", (d2) => {
|
|
21593
|
+
const lineWidth = parseInt(
|
|
21594
|
+
seriesData[i].properties.lineWidth.toString()
|
|
21595
|
+
);
|
|
21596
|
+
switch (seriesData[i].properties.lineStyle) {
|
|
21597
|
+
case staticLineStyle.dotted:
|
|
21598
|
+
return `0,${lineWidth + 2}`;
|
|
21599
|
+
case staticLineStyle.dashed:
|
|
21600
|
+
return strokeDashValues;
|
|
21601
|
+
default:
|
|
21602
|
+
return "";
|
|
21603
|
+
}
|
|
21604
|
+
}).attr(
|
|
21371
21605
|
"stroke-linecap",
|
|
21372
|
-
seriesData[i].properties.lineStyle ===
|
|
21606
|
+
seriesData[i].properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
21373
21607
|
).attr(
|
|
21374
21608
|
"stroke-width",
|
|
21375
|
-
seriesData[i].properties.lineStyle !==
|
|
21609
|
+
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
21376
21610
|
).attr("fill", "none");
|
|
21377
21611
|
const totalLength = pathSel.node().getTotalLength();
|
|
21378
21612
|
{
|
|
@@ -21381,7 +21615,9 @@
|
|
|
21381
21615
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", "transparent").attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function() {
|
|
21382
21616
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
21383
21617
|
svg.selectAll(
|
|
21384
|
-
'[hoverId="' + getJQuerySelector(
|
|
21618
|
+
'[hoverId="' + getJQuerySelector(
|
|
21619
|
+
seriesData[i].properties.alias || seriesData[i].properties.name || "Legend"
|
|
21620
|
+
).replace(/\s+/g, "-") + '"]'
|
|
21385
21621
|
).classed("highlight", true).classed("unhighlight", false);
|
|
21386
21622
|
}).on("mouseleave", function() {
|
|
21387
21623
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
@@ -21512,7 +21748,11 @@
|
|
|
21512
21748
|
(K2, j) => K2.forEach((d) => {
|
|
21513
21749
|
d["key"] = K2.key;
|
|
21514
21750
|
K2["color"] = JSON.parse(JSON.stringify(seriesData[j].properties.color));
|
|
21515
|
-
K2["individualAnnotationVisibility"] = JSON.parse(
|
|
21751
|
+
K2["individualAnnotationVisibility"] = JSON.parse(
|
|
21752
|
+
JSON.stringify(
|
|
21753
|
+
seriesData[j].properties.individualAnnotationVisibility
|
|
21754
|
+
)
|
|
21755
|
+
);
|
|
21516
21756
|
d.data.labelPosition = seriesData[j].properties.dataLabelPosition;
|
|
21517
21757
|
d.data["labelColor"] = seriesColor == "2" ? JSON.parse(JSON.stringify(seriesData[j].properties.color)) : seriesData[j].properties.labelColor;
|
|
21518
21758
|
d["hideZero"] = JSON.parse(
|
|
@@ -21525,6 +21765,7 @@
|
|
|
21525
21765
|
filteredData = fData;
|
|
21526
21766
|
filteredDimension = fDimension;
|
|
21527
21767
|
visibleBars = fVisibleBars;
|
|
21768
|
+
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
21528
21769
|
drawLineChart();
|
|
21529
21770
|
};
|
|
21530
21771
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -21547,10 +21788,7 @@
|
|
|
21547
21788
|
const barWidth = 0;
|
|
21548
21789
|
const chartType = chartTypes.NormalizedStackLineChart;
|
|
21549
21790
|
const svgRef = require$$0$1.useRef();
|
|
21550
|
-
const seriesData = generalizedChartData(
|
|
21551
|
-
data.ChartData,
|
|
21552
|
-
data.DimensionList
|
|
21553
|
-
)?.reverse() || [];
|
|
21791
|
+
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
21554
21792
|
const dimensionList = data.DimensionList;
|
|
21555
21793
|
const barChart = false;
|
|
21556
21794
|
const isSecondaryAxisDrawn = false;
|
|
@@ -21733,7 +21971,7 @@
|
|
|
21733
21971
|
width,
|
|
21734
21972
|
legendMargin,
|
|
21735
21973
|
formatOptions,
|
|
21736
|
-
seriesData,
|
|
21974
|
+
[...seriesData].reverse(),
|
|
21737
21975
|
chartId,
|
|
21738
21976
|
staticLegendShape.line
|
|
21739
21977
|
);
|
|
@@ -21755,6 +21993,12 @@
|
|
|
21755
21993
|
const preProcessChartData = () => {
|
|
21756
21994
|
const allChartData = [];
|
|
21757
21995
|
const legendList = [];
|
|
21996
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
21997
|
+
chartJSON.hideZeroValues = true;
|
|
21998
|
+
seriesData.forEach((series) => {
|
|
21999
|
+
series.data = series.data.filter((d) => d.value !== 0);
|
|
22000
|
+
});
|
|
22001
|
+
}
|
|
21758
22002
|
seriesData.forEach((series, index2) => {
|
|
21759
22003
|
const prefixedLegend = `${index2}~$~${series.properties.legend}`;
|
|
21760
22004
|
series.properties.legend = prefixedLegend;
|
|
@@ -21767,9 +22011,6 @@
|
|
|
21767
22011
|
chartJSON.legendList = legendList;
|
|
21768
22012
|
filteredData = JSON.parse(JSON.stringify(seriesData));
|
|
21769
22013
|
filteredDimension = chartJSON.dimensionList;
|
|
21770
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
21771
|
-
chartJSON.hideZeroValues = true;
|
|
21772
|
-
}
|
|
21773
22014
|
const tempStackLineData = getStackedData(
|
|
21774
22015
|
chartJSON.dimensionList,
|
|
21775
22016
|
seriesData,
|
|
@@ -21856,18 +22097,30 @@
|
|
|
21856
22097
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
21857
22098
|
let lineGroups = lines.selectAll(".line-group").data((d) => d);
|
|
21858
22099
|
let lineGroupsEnter = lineGroups.enter().append("g").attr("class", (d) => "line-group " + d.key.replace(/ /g, "-"));
|
|
21859
|
-
lineGroupsEnter.attr(
|
|
22100
|
+
lineGroupsEnter.attr(
|
|
22101
|
+
"hoverId",
|
|
22102
|
+
(d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
22103
|
+
).append("path").attr("class", "line").attr("fill", "none");
|
|
21860
22104
|
lineGroupsEnter.merge(lineGroups).each(function(d, i) {
|
|
21861
22105
|
const g = select$2(this);
|
|
21862
|
-
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr(
|
|
21863
|
-
|
|
21864
|
-
|
|
21865
|
-
|
|
22106
|
+
const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr("stroke-dasharray", (d2) => {
|
|
22107
|
+
const lineWidth = parseInt(
|
|
22108
|
+
seriesData[i].properties.lineWidth.toString()
|
|
22109
|
+
);
|
|
22110
|
+
switch (seriesData[i].properties.lineStyle) {
|
|
22111
|
+
case staticLineStyle.dotted:
|
|
22112
|
+
return `0,${lineWidth + 2}`;
|
|
22113
|
+
case staticLineStyle.dashed:
|
|
22114
|
+
return strokeDashValues;
|
|
22115
|
+
default:
|
|
22116
|
+
return "";
|
|
22117
|
+
}
|
|
22118
|
+
}).attr(
|
|
21866
22119
|
"stroke-linecap",
|
|
21867
|
-
seriesData[i].properties.lineStyle ===
|
|
22120
|
+
seriesData[i].properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
21868
22121
|
).attr(
|
|
21869
22122
|
"stroke-width",
|
|
21870
|
-
seriesData[i].properties.lineStyle !==
|
|
22123
|
+
seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
|
|
21871
22124
|
).attr("fill", "none");
|
|
21872
22125
|
const totalLength = pathSel.node().getTotalLength();
|
|
21873
22126
|
{
|
|
@@ -21875,10 +22128,18 @@
|
|
|
21875
22128
|
}
|
|
21876
22129
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", "transparent").attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function(event2, d2) {
|
|
21877
22130
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
21878
|
-
svg.selectAll(
|
|
22131
|
+
svg.selectAll(
|
|
22132
|
+
'[hoverId="' + getJQuerySelector(
|
|
22133
|
+
lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend"
|
|
22134
|
+
).replace(/\s+/g, "-") + '"]'
|
|
22135
|
+
).classed("highlight", true).classed("unhighlight", false);
|
|
21879
22136
|
}).on("mouseleave", function(event2, d2) {
|
|
21880
22137
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
21881
|
-
svg.selectAll(
|
|
22138
|
+
svg.selectAll(
|
|
22139
|
+
'[hoverId="' + getJQuerySelector(
|
|
22140
|
+
lineData[d2.index]?.properties?.alias || d2[d2.index]?.properties?.name || "Legend"
|
|
22141
|
+
).replace(/\s+/g, "-") + '"]'
|
|
22142
|
+
).classed("highlight", false).classed("unhighlight", false);
|
|
21882
22143
|
});
|
|
21883
22144
|
});
|
|
21884
22145
|
lineGroups.exit().remove();
|
|
@@ -22068,6 +22329,7 @@
|
|
|
22068
22329
|
let secondaryYLabel;
|
|
22069
22330
|
let maxNumberForPrimaryAxis;
|
|
22070
22331
|
let maxNumberForSecondaryAxis;
|
|
22332
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
22071
22333
|
let innerWidth2;
|
|
22072
22334
|
let innerHeight2;
|
|
22073
22335
|
let width;
|
|
@@ -22273,7 +22535,7 @@
|
|
|
22273
22535
|
chartJSON.chartData = allChartData;
|
|
22274
22536
|
chartJSON.legendList = legendList;
|
|
22275
22537
|
chartJSON.yMaxLeft = yMaxLeft;
|
|
22276
|
-
chartJSON.yMinLeft = yMinLeft
|
|
22538
|
+
chartJSON.yMinLeft = yMinLeft;
|
|
22277
22539
|
chartJSON.yMaxRight = yMaxRight;
|
|
22278
22540
|
chartJSON.yMinRight = yMinRight;
|
|
22279
22541
|
formatedDimensionList = isDateType ? setDateFormats(
|
|
@@ -22330,13 +22592,14 @@
|
|
|
22330
22592
|
const initAxis = () => {
|
|
22331
22593
|
{
|
|
22332
22594
|
let responsiveLablesObj = responsiveYaxisLabel$1(
|
|
22333
|
-
customYaxisMaxValue ? customYaxisMaxValue : chartJSON.
|
|
22595
|
+
customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxRight,
|
|
22334
22596
|
chartJSON.yMinLeft,
|
|
22335
22597
|
innerHeight2,
|
|
22336
22598
|
formatOptions,
|
|
22337
22599
|
chartJSON,
|
|
22338
22600
|
customYaxisMinValue,
|
|
22339
|
-
customYaxisMaxValue
|
|
22601
|
+
customYaxisMaxValue,
|
|
22602
|
+
barChart
|
|
22340
22603
|
);
|
|
22341
22604
|
xAxisBottom = axisBottom(xScaleBottom).tickFormat(
|
|
22342
22605
|
(d) => getNumberWithFormat(
|
|
@@ -22347,7 +22610,9 @@
|
|
|
22347
22610
|
)
|
|
22348
22611
|
).tickSize(
|
|
22349
22612
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -innerHeight2 : 0 : 0
|
|
22350
|
-
).tickValues(
|
|
22613
|
+
).tickValues(
|
|
22614
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
22615
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
22351
22616
|
}
|
|
22352
22617
|
if (isSecondaryAxisDrawn) {
|
|
22353
22618
|
let responsiveSecondaryLablesObj = responsiveSecondaryYaxisLabel(
|
|
@@ -22363,7 +22628,9 @@
|
|
|
22363
22628
|
formatOptions.secondaryYAxisLabel.secondaryYAxisNumberFormat,
|
|
22364
22629
|
formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
|
|
22365
22630
|
)
|
|
22366
|
-
).tickValues(
|
|
22631
|
+
).tickValues(
|
|
22632
|
+
responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray
|
|
22633
|
+
).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
|
|
22367
22634
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
|
|
22368
22635
|
).tickPadding(8).tickSizeOuter(0);
|
|
22369
22636
|
}
|
|
@@ -22387,13 +22654,31 @@
|
|
|
22387
22654
|
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
|
|
22388
22655
|
column = column.enter().append("g").attr("class", "column parentGroup").merge(column);
|
|
22389
22656
|
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
|
|
22390
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
22391
|
-
|
|
22392
|
-
|
|
22657
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
22658
|
+
"hoverId",
|
|
22659
|
+
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
22660
|
+
/\s+/g,
|
|
22661
|
+
"-"
|
|
22662
|
+
)
|
|
22663
|
+
).attr(
|
|
22664
|
+
"transform",
|
|
22665
|
+
(d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
|
|
22666
|
+
);
|
|
22667
|
+
columnGroups.attr(
|
|
22668
|
+
"transform",
|
|
22669
|
+
(d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
|
|
22670
|
+
);
|
|
22671
|
+
columnGroupsEnter.merge(columnGroups).attr(
|
|
22672
|
+
"transform",
|
|
22673
|
+
(d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
|
|
22674
|
+
);
|
|
22393
22675
|
const bars = columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegends(d.legend)).attr("height", yScaleLegends.bandwidth()).attr("x", (d) => {
|
|
22394
|
-
const xScaleUsed = data2.properties.axis ===
|
|
22676
|
+
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
22395
22677
|
return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(0);
|
|
22396
|
-
}).attr("width", 0).attr("fill", data2.properties.color).attr(
|
|
22678
|
+
}).attr("width", 0).attr("fill", data2.properties.color).attr(
|
|
22679
|
+
"stroke-dasharray",
|
|
22680
|
+
(d) => d.stackBorderStyle === 2 ? "5,3" : "0"
|
|
22681
|
+
).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
|
|
22397
22682
|
"stroke",
|
|
22398
22683
|
(d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
|
|
22399
22684
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
@@ -22402,11 +22687,11 @@
|
|
|
22402
22687
|
);
|
|
22403
22688
|
const finalBars = bars;
|
|
22404
22689
|
finalBars.attr("x", (d) => {
|
|
22405
|
-
const xScaleUsed = data2.properties.axis ===
|
|
22690
|
+
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
22406
22691
|
return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(d.value);
|
|
22407
22692
|
}).attr("width", (d) => {
|
|
22408
|
-
const xScaleUsed = data2.properties.axis ===
|
|
22409
|
-
const maxValue = data2.properties.axis ===
|
|
22693
|
+
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
22694
|
+
const maxValue = data2.properties.axis === axisTypes.primary ? customYaxisMaxValue : secondaryCustomYaxisMaxValue;
|
|
22410
22695
|
if (d.value >= 0) {
|
|
22411
22696
|
return maxValue && d.value > maxValue ? xScaleUsed(maxValue) - xScaleUsed(0) : xScaleUsed(d.value) - xScaleUsed(0);
|
|
22412
22697
|
} else {
|
|
@@ -22429,7 +22714,11 @@
|
|
|
22429
22714
|
{
|
|
22430
22715
|
key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
|
|
22431
22716
|
value: getNumberWithFormat(
|
|
22432
|
-
[
|
|
22717
|
+
[
|
|
22718
|
+
chartTypes.NormalizedStackLineChart,
|
|
22719
|
+
chartTypes.NormalizedStackAreaChart,
|
|
22720
|
+
""
|
|
22721
|
+
].includes(chartType) ? d[1] - d[0] : d.value,
|
|
22433
22722
|
formatOptions.toolTip.toolTipDisplayUnits,
|
|
22434
22723
|
formatOptions.toolTip.toolTipNumberFormat,
|
|
22435
22724
|
formatOptions.toolTip.toolTipDecimalPrecision
|
|
@@ -22463,6 +22752,7 @@
|
|
|
22463
22752
|
filteredData = fData;
|
|
22464
22753
|
filteredDimension = fDimension;
|
|
22465
22754
|
visibleBars = fVisibleBars;
|
|
22755
|
+
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
22466
22756
|
drawColumnChart();
|
|
22467
22757
|
};
|
|
22468
22758
|
const drawColumnChart = () => {
|
|
@@ -22581,6 +22871,7 @@
|
|
|
22581
22871
|
let scrollbarVisible = false;
|
|
22582
22872
|
let stackChartData = [];
|
|
22583
22873
|
const isNormalizedChart = false;
|
|
22874
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
22584
22875
|
let chartJSON = {
|
|
22585
22876
|
dimensionList,
|
|
22586
22877
|
chartType,
|
|
@@ -22704,7 +22995,7 @@
|
|
|
22704
22995
|
width,
|
|
22705
22996
|
legendMargin,
|
|
22706
22997
|
formatOptions,
|
|
22707
|
-
seriesData,
|
|
22998
|
+
[...seriesData].reverse(),
|
|
22708
22999
|
chartId,
|
|
22709
23000
|
staticLegendShape.rectangle
|
|
22710
23001
|
);
|
|
@@ -22826,7 +23117,9 @@
|
|
|
22826
23117
|
)
|
|
22827
23118
|
).tickSize(
|
|
22828
23119
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -innerHeight2 : 0 : 0
|
|
22829
|
-
).tickValues(
|
|
23120
|
+
).tickValues(
|
|
23121
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
23122
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
22830
23123
|
}
|
|
22831
23124
|
};
|
|
22832
23125
|
const getYAxis = () => {
|
|
@@ -22847,14 +23140,22 @@
|
|
|
22847
23140
|
let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
22848
23141
|
columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
|
|
22849
23142
|
let columnGroups = columns.selectAll(".column-group").data((d) => d);
|
|
22850
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
23143
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
23144
|
+
"hoverId",
|
|
23145
|
+
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
23146
|
+
);
|
|
22851
23147
|
columnGroups = columnGroupsEnter.merge(columnGroups);
|
|
22852
23148
|
let rects = columnGroups.selectAll("rect").data((d) => d);
|
|
22853
23149
|
const getPropsForRect = (nodes, i) => {
|
|
22854
|
-
const groupIndex = Array.from(columnGroups.nodes()).indexOf(
|
|
23150
|
+
const groupIndex = Array.from(columnGroups.nodes()).indexOf(
|
|
23151
|
+
nodes[i].parentNode
|
|
23152
|
+
);
|
|
22855
23153
|
return { props: seriesData[groupIndex]?.properties, groupIndex };
|
|
22856
23154
|
};
|
|
22857
|
-
const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr(
|
|
23155
|
+
const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr(
|
|
23156
|
+
"fill",
|
|
23157
|
+
(d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
|
|
23158
|
+
).attr("stroke", (d, i, nodes) => {
|
|
22858
23159
|
const props = getPropsForRect(nodes, i).props;
|
|
22859
23160
|
return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
22860
23161
|
}).attr(
|
|
@@ -22918,6 +23219,7 @@
|
|
|
22918
23219
|
filteredData = fData;
|
|
22919
23220
|
filteredDimension = fDimension;
|
|
22920
23221
|
visibleBars = fVisibleBars;
|
|
23222
|
+
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
22921
23223
|
createStackLineData();
|
|
22922
23224
|
drawLineChart();
|
|
22923
23225
|
};
|
|
@@ -22969,6 +23271,21 @@
|
|
|
22969
23271
|
isReportEditable,
|
|
22970
23272
|
barChart
|
|
22971
23273
|
);
|
|
23274
|
+
addTotalValue(
|
|
23275
|
+
totalValueMap,
|
|
23276
|
+
yScale,
|
|
23277
|
+
xScaleBottom,
|
|
23278
|
+
margin,
|
|
23279
|
+
d3Annotation,
|
|
23280
|
+
[],
|
|
23281
|
+
formatOptions,
|
|
23282
|
+
chartType,
|
|
23283
|
+
height,
|
|
23284
|
+
width,
|
|
23285
|
+
svg,
|
|
23286
|
+
isReportEditable,
|
|
23287
|
+
barChart
|
|
23288
|
+
);
|
|
22972
23289
|
getConnectors();
|
|
22973
23290
|
gTag.selectAll(".connectors").raise();
|
|
22974
23291
|
};
|
|
@@ -23226,7 +23543,10 @@
|
|
|
23226
23543
|
let columnWidth = 0;
|
|
23227
23544
|
const chartType = chartTypes.NormalizedStackHorizontalBarChart;
|
|
23228
23545
|
const svgRef = require$$0$1.useRef();
|
|
23229
|
-
const seriesData = generalizedChartData(
|
|
23546
|
+
const seriesData = generalizedChartData(
|
|
23547
|
+
data.ChartData,
|
|
23548
|
+
data.DimensionList
|
|
23549
|
+
)?.reverse();
|
|
23230
23550
|
const dimensionList = data.DimensionList;
|
|
23231
23551
|
const barChart = true;
|
|
23232
23552
|
const isSecondaryAxisDrawn = false;
|
|
@@ -23391,7 +23711,7 @@
|
|
|
23391
23711
|
width,
|
|
23392
23712
|
legendMargin,
|
|
23393
23713
|
formatOptions,
|
|
23394
|
-
seriesData,
|
|
23714
|
+
[...seriesData].reverse(),
|
|
23395
23715
|
chartId,
|
|
23396
23716
|
staticLegendShape.rectangle
|
|
23397
23717
|
);
|
|
@@ -23521,20 +23841,31 @@
|
|
|
23521
23841
|
let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
|
|
23522
23842
|
columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
|
|
23523
23843
|
let columnGroups = columns.selectAll(".column-group").data((d) => d);
|
|
23524
|
-
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
23844
|
+
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
|
|
23845
|
+
"hoverId",
|
|
23846
|
+
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
23847
|
+
);
|
|
23525
23848
|
columnGroups = columnGroupsEnter.merge(columnGroups);
|
|
23526
23849
|
let rects = columnGroups.selectAll("rect").data((d) => d);
|
|
23527
23850
|
const getPropsForRect = (nodes, i) => {
|
|
23528
|
-
const groupIndex = Array.from(columnGroups.nodes()).indexOf(
|
|
23851
|
+
const groupIndex = Array.from(columnGroups.nodes()).indexOf(
|
|
23852
|
+
nodes[i].parentNode
|
|
23853
|
+
);
|
|
23529
23854
|
return { props: seriesData[groupIndex]?.properties, groupIndex };
|
|
23530
23855
|
};
|
|
23531
|
-
const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - yScale.bandwidth() / 2).attr("height", yScale.bandwidth()).attr(
|
|
23856
|
+
const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - yScale.bandwidth() / 2).attr("height", yScale.bandwidth()).attr(
|
|
23857
|
+
"fill",
|
|
23858
|
+
(d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
|
|
23859
|
+
).attr("stroke", (d, i, nodes) => {
|
|
23532
23860
|
const props = getPropsForRect(nodes, i).props;
|
|
23533
23861
|
return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
23534
23862
|
}).attr(
|
|
23535
23863
|
"stroke-dasharray",
|
|
23536
23864
|
(d, i, nodes) => getPropsForRect(nodes, i).props?.stackBorderStyle === 2 ? "5,3" : "0"
|
|
23537
|
-
).attr(
|
|
23865
|
+
).attr(
|
|
23866
|
+
"stroke-width",
|
|
23867
|
+
(d, i, nodes) => (getPropsForRect(nodes, i).props?.stackBorderWidth || 0) + "px"
|
|
23868
|
+
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("x", (d) => xScaleBottom(0)).attr("width", 0).attr("visibility", (d, i, nodes) => {
|
|
23538
23869
|
const props = getPropsForRect(nodes, i).props;
|
|
23539
23870
|
return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
23540
23871
|
}).on("mousemove", (event2, d) => {
|
|
@@ -25055,6 +25386,12 @@
|
|
|
25055
25386
|
let yMinLeft = Infinity;
|
|
25056
25387
|
let yMaxRight = -Infinity;
|
|
25057
25388
|
let yMinRight = Infinity;
|
|
25389
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
25390
|
+
chartJSON.hideZeroValues = true;
|
|
25391
|
+
seriesData.forEach((series) => {
|
|
25392
|
+
series.data = series.data.filter((d) => d.value !== 0);
|
|
25393
|
+
});
|
|
25394
|
+
}
|
|
25058
25395
|
seriesData.forEach((series) => {
|
|
25059
25396
|
legendList.push(
|
|
25060
25397
|
series.properties.alias ? series.properties.alias : series.legend
|
|
@@ -25089,9 +25426,6 @@
|
|
|
25089
25426
|
} else {
|
|
25090
25427
|
filteredDimension = chartJSON.dimensionList;
|
|
25091
25428
|
}
|
|
25092
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
25093
|
-
chartJSON.hideZeroValues = true;
|
|
25094
|
-
}
|
|
25095
25429
|
};
|
|
25096
25430
|
const initScale = () => {
|
|
25097
25431
|
let yAxisLabelArray = responsiveYaxisLabel$1(
|
|
@@ -25155,7 +25489,9 @@
|
|
|
25155
25489
|
)
|
|
25156
25490
|
).tickSize(
|
|
25157
25491
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
25158
|
-
).tickValues(
|
|
25492
|
+
).tickValues(
|
|
25493
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
25494
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
25159
25495
|
}
|
|
25160
25496
|
};
|
|
25161
25497
|
const getXAxis = () => {
|
|
@@ -25184,7 +25520,13 @@
|
|
|
25184
25520
|
areaGroupsEnter.append("path").attr("class", "area parentGroup").attr(
|
|
25185
25521
|
"fill",
|
|
25186
25522
|
(d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
|
|
25187
|
-
).style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr(
|
|
25523
|
+
).style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr(
|
|
25524
|
+
"hoverId",
|
|
25525
|
+
(d) => (d.properties?.alias || d.properties?.name || "Legend").replace(
|
|
25526
|
+
/\s+/g,
|
|
25527
|
+
"-"
|
|
25528
|
+
)
|
|
25529
|
+
).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
|
|
25188
25530
|
{
|
|
25189
25531
|
select$2(this).attr("d", areaGenerator(d.data));
|
|
25190
25532
|
}
|
|
@@ -25195,25 +25537,28 @@
|
|
|
25195
25537
|
"stroke",
|
|
25196
25538
|
(d2) => d2.properties.areaBorderColor !== "#ffffff" ? d2.properties.areaBorderColor : "none"
|
|
25197
25539
|
).attr("stroke-dasharray", (d2) => {
|
|
25540
|
+
const lineWidth = parseInt(d2.properties.lineWidth);
|
|
25198
25541
|
switch (d2.properties.lineStyle) {
|
|
25199
|
-
case
|
|
25200
|
-
return
|
|
25201
|
-
case
|
|
25202
|
-
return
|
|
25542
|
+
case staticLineStyle.dotted:
|
|
25543
|
+
return `0,${lineWidth + 2}`;
|
|
25544
|
+
case staticLineStyle.dashed:
|
|
25545
|
+
return strokeDashValues;
|
|
25203
25546
|
default:
|
|
25204
25547
|
return "";
|
|
25205
25548
|
}
|
|
25206
25549
|
}).attr(
|
|
25207
25550
|
"stroke-linecap",
|
|
25208
|
-
(d2) => d2.properties.lineStyle ===
|
|
25551
|
+
(d2) => d2.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : strokeLineCap.butt
|
|
25209
25552
|
).attr(
|
|
25210
25553
|
"stroke-width",
|
|
25211
|
-
(d2) => d2.properties.lineStyle !==
|
|
25554
|
+
(d2) => d2.properties.lineStyle !== staticLineStyle.none && formatOptions.plotArea.plotAreaHideLineAndMarkers ? d2.properties.lineWidth : "0"
|
|
25212
25555
|
).attr("fill", "none");
|
|
25213
25556
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => areaGenerator(d2.data)).attr("fill", "transparent").attr("stroke", "none").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
|
|
25214
25557
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true).attr("stroke-width", "2.5");
|
|
25215
25558
|
svg.selectAll(
|
|
25216
|
-
'[hoverId="' + getJQuerySelector(
|
|
25559
|
+
'[hoverId="' + getJQuerySelector(
|
|
25560
|
+
d2.properties?.alias || d2.properties?.name || "Legend"
|
|
25561
|
+
).replace(/\s+/g, "-") + '"]'
|
|
25217
25562
|
).classed("highlight", true).classed("unhighlight", false).attr("stroke-width", "3.5");
|
|
25218
25563
|
}).on("mouseleave", function(event2, d2) {
|
|
25219
25564
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false).attr("stroke-width", "2.5");
|
|
@@ -25361,10 +25706,7 @@
|
|
|
25361
25706
|
const barWidth = 0;
|
|
25362
25707
|
const chartType = chartTypes.StackAreaChart;
|
|
25363
25708
|
const svgRef = require$$0$1.useRef();
|
|
25364
|
-
const seriesData = generalizedChartData(
|
|
25365
|
-
data.ChartData,
|
|
25366
|
-
data.DimensionList
|
|
25367
|
-
)?.reverse() || [];
|
|
25709
|
+
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
25368
25710
|
const dimensionList = data.DimensionList;
|
|
25369
25711
|
const barChart = false;
|
|
25370
25712
|
const isSecondaryAxisDrawn = false;
|
|
@@ -25388,6 +25730,7 @@
|
|
|
25388
25730
|
let secondaryYLabel;
|
|
25389
25731
|
let maxNumberForPrimaryAxis;
|
|
25390
25732
|
let maxNumberForSecondaryAxis;
|
|
25733
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
25391
25734
|
let innerWidth2;
|
|
25392
25735
|
let innerHeight2;
|
|
25393
25736
|
let width;
|
|
@@ -25555,7 +25898,7 @@
|
|
|
25555
25898
|
width,
|
|
25556
25899
|
legendMargin,
|
|
25557
25900
|
formatOptions,
|
|
25558
|
-
seriesData,
|
|
25901
|
+
[...seriesData].reverse(),
|
|
25559
25902
|
chartId,
|
|
25560
25903
|
staticLegendShape.areaWithLine
|
|
25561
25904
|
);
|
|
@@ -25578,6 +25921,12 @@
|
|
|
25578
25921
|
const preProcessChartData = () => {
|
|
25579
25922
|
const allChartData = [];
|
|
25580
25923
|
const legendList = [];
|
|
25924
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
25925
|
+
chartJSON.hideZeroValues = true;
|
|
25926
|
+
seriesData.forEach((series) => {
|
|
25927
|
+
series.data = series.data.filter((d) => d.value !== 0);
|
|
25928
|
+
});
|
|
25929
|
+
}
|
|
25581
25930
|
seriesData.forEach((series, index2) => {
|
|
25582
25931
|
const prefixedLegend = `${index2}~$~${series.properties.alias}`;
|
|
25583
25932
|
series.properties.legend = prefixedLegend;
|
|
@@ -25626,9 +25975,6 @@
|
|
|
25626
25975
|
chartJSON.dimensionList.forEach((d, i) => {
|
|
25627
25976
|
chartJSON.formattedDimensionListMap.set(d, formatedDimensionList[i]);
|
|
25628
25977
|
});
|
|
25629
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
25630
|
-
chartJSON.hideZeroValues = true;
|
|
25631
|
-
}
|
|
25632
25978
|
};
|
|
25633
25979
|
const initScale = () => {
|
|
25634
25980
|
let yAxisLabelArray = responsiveYaxisLabel$1(
|
|
@@ -25692,7 +26038,9 @@
|
|
|
25692
26038
|
)
|
|
25693
26039
|
).tickSize(
|
|
25694
26040
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
25695
|
-
).tickValues(
|
|
26041
|
+
).tickValues(
|
|
26042
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
26043
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
25696
26044
|
}
|
|
25697
26045
|
};
|
|
25698
26046
|
const getXAxis = () => {
|
|
@@ -25722,29 +26070,34 @@
|
|
|
25722
26070
|
areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
|
|
25723
26071
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
25724
26072
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
|
|
25725
|
-
areaGroupsEnter.append("path").attr(
|
|
26073
|
+
areaGroupsEnter.append("path").attr(
|
|
26074
|
+
"hoverId",
|
|
26075
|
+
(d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
|
|
26076
|
+
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).each(function(d) {
|
|
25726
26077
|
{
|
|
25727
26078
|
select$2(this).attr("d", areaGenerator(d));
|
|
25728
26079
|
}
|
|
25729
26080
|
});
|
|
25730
26081
|
areaGroupsEnter.merge(areaGroups).each(function(d, i) {
|
|
25731
26082
|
const g = select$2(this);
|
|
25732
|
-
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => areaGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", () => {
|
|
25733
|
-
const
|
|
25734
|
-
|
|
25735
|
-
|
|
25736
|
-
|
|
25737
|
-
case
|
|
25738
|
-
return
|
|
26083
|
+
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => areaGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", (d2) => {
|
|
26084
|
+
const lineWidth = parseInt(
|
|
26085
|
+
seriesData[i].properties.lineWidth.toString()
|
|
26086
|
+
);
|
|
26087
|
+
switch (seriesData[i].properties.lineStyle) {
|
|
26088
|
+
case staticLineStyle.dotted:
|
|
26089
|
+
return `0,${lineWidth + 2}`;
|
|
26090
|
+
case staticLineStyle.dashed:
|
|
26091
|
+
return strokeDashValues;
|
|
25739
26092
|
default:
|
|
25740
26093
|
return "";
|
|
25741
26094
|
}
|
|
25742
26095
|
}).attr(
|
|
25743
26096
|
"stroke-linecap",
|
|
25744
|
-
() => seriesData[i]?.properties?.lineStyle ===
|
|
26097
|
+
() => seriesData[i]?.properties?.lineStyle.toLowerCase() === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
25745
26098
|
).attr(
|
|
25746
26099
|
"stroke-width",
|
|
25747
|
-
(d2, i2) => seriesData[i2].properties.lineStyle !==
|
|
26100
|
+
(d2, i2) => seriesData[i2].properties.lineStyle !== staticLineStyle.none ? seriesData[i2].properties.lineWidth : "0"
|
|
25748
26101
|
).attr("fill", "none").style("pointer-events", "none");
|
|
25749
26102
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => areaGenerator(d2)).attr("fill", "transparent").attr("stroke", "none").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
|
|
25750
26103
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
@@ -25795,6 +26148,7 @@
|
|
|
25795
26148
|
filteredData = fData;
|
|
25796
26149
|
filteredDimension = fDimension;
|
|
25797
26150
|
visibleBars = fVisibleBars;
|
|
26151
|
+
createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
|
|
25798
26152
|
createStackLineData();
|
|
25799
26153
|
drawLineChart();
|
|
25800
26154
|
};
|
|
@@ -25854,6 +26208,20 @@
|
|
|
25854
26208
|
true
|
|
25855
26209
|
).labelArray;
|
|
25856
26210
|
drawSeriesLabels(formatOptions, gTag, newSeriesLabelArray);
|
|
26211
|
+
addTotalValue(
|
|
26212
|
+
totalValueMap,
|
|
26213
|
+
xScale,
|
|
26214
|
+
yScaleLeft,
|
|
26215
|
+
margin,
|
|
26216
|
+
d3Annotation,
|
|
26217
|
+
[],
|
|
26218
|
+
formatOptions,
|
|
26219
|
+
chartType,
|
|
26220
|
+
height,
|
|
26221
|
+
width,
|
|
26222
|
+
svg,
|
|
26223
|
+
isReportEditable
|
|
26224
|
+
);
|
|
25857
26225
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
25858
26226
|
if (formatOptions.xAxisLabel.xAxisPosition != "1")
|
|
25859
26227
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
@@ -25906,6 +26274,7 @@
|
|
|
25906
26274
|
d["hideZero"] = JSON.parse(
|
|
25907
26275
|
JSON.stringify(seriesData[j].properties.hideZeroValues)
|
|
25908
26276
|
);
|
|
26277
|
+
d["properties"] = seriesData[j].properties;
|
|
25909
26278
|
})
|
|
25910
26279
|
);
|
|
25911
26280
|
};
|
|
@@ -25929,10 +26298,7 @@
|
|
|
25929
26298
|
const barWidth = 0;
|
|
25930
26299
|
const chartType = chartTypes.NormalizedStackAreaChart;
|
|
25931
26300
|
const svgRef = require$$0$1.useRef();
|
|
25932
|
-
const seriesData = generalizedChartData(
|
|
25933
|
-
data.ChartData,
|
|
25934
|
-
data.DimensionList
|
|
25935
|
-
)?.reverse() || [];
|
|
26301
|
+
const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
|
|
25936
26302
|
const dimensionList = data.DimensionList;
|
|
25937
26303
|
const barChart = false;
|
|
25938
26304
|
const isSecondaryAxisDrawn = false;
|
|
@@ -26115,7 +26481,7 @@
|
|
|
26115
26481
|
width,
|
|
26116
26482
|
legendMargin,
|
|
26117
26483
|
formatOptions,
|
|
26118
|
-
seriesData,
|
|
26484
|
+
[...seriesData].reverse(),
|
|
26119
26485
|
chartId,
|
|
26120
26486
|
staticLegendShape.areaWithLine
|
|
26121
26487
|
);
|
|
@@ -26137,6 +26503,12 @@
|
|
|
26137
26503
|
const preProcessChartData = () => {
|
|
26138
26504
|
const allChartData = [];
|
|
26139
26505
|
const legendList = [];
|
|
26506
|
+
if (formatOptions.plotArea.hideZeroValues) {
|
|
26507
|
+
chartJSON.hideZeroValues = true;
|
|
26508
|
+
seriesData.forEach((series) => {
|
|
26509
|
+
series.data = series.data.filter((d) => d.value !== 0);
|
|
26510
|
+
});
|
|
26511
|
+
}
|
|
26140
26512
|
seriesData.forEach((series, index2) => {
|
|
26141
26513
|
const prefixedLegend = `${index2}~$~${series.properties.alias}`;
|
|
26142
26514
|
series.properties.legend = prefixedLegend;
|
|
@@ -26161,9 +26533,6 @@
|
|
|
26161
26533
|
} else {
|
|
26162
26534
|
filteredDimension = chartJSON.dimensionList;
|
|
26163
26535
|
}
|
|
26164
|
-
if (formatOptions.plotArea.hideZeroValues) {
|
|
26165
|
-
chartJSON.hideZeroValues = true;
|
|
26166
|
-
}
|
|
26167
26536
|
const tempStackLineData = getStackedData(
|
|
26168
26537
|
chartJSON.dimensionList,
|
|
26169
26538
|
seriesData,
|
|
@@ -26234,8 +26603,10 @@
|
|
|
26234
26603
|
stackChartData.forEach(
|
|
26235
26604
|
(data2, i) => data2.forEach((item, position) => {
|
|
26236
26605
|
const total = item.data.total;
|
|
26237
|
-
lineData[i].data[position]
|
|
26238
|
-
|
|
26606
|
+
if (lineData[i].data[position]) {
|
|
26607
|
+
lineData[i].data[position][0] = item[0] = total === 0 ? 0 : item[0] / total;
|
|
26608
|
+
lineData[i].data[position][1] = item[1] = total === 0 ? 0 : item[1] / total;
|
|
26609
|
+
}
|
|
26239
26610
|
})
|
|
26240
26611
|
);
|
|
26241
26612
|
lineData.forEach((lData) => {
|
|
@@ -26257,7 +26628,10 @@
|
|
|
26257
26628
|
areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
|
|
26258
26629
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
26259
26630
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
|
|
26260
|
-
areaGroupsEnter.append("path").attr(
|
|
26631
|
+
areaGroupsEnter.append("path").attr(
|
|
26632
|
+
"hoverId",
|
|
26633
|
+
(d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
26634
|
+
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).each(function(d) {
|
|
26261
26635
|
const path2 = select$2(this);
|
|
26262
26636
|
{
|
|
26263
26637
|
path2.attr("d", columnGenerator(d));
|
|
@@ -26265,33 +26639,39 @@
|
|
|
26265
26639
|
});
|
|
26266
26640
|
areaGroupsEnter.merge(areaGroups).each(function(d, i) {
|
|
26267
26641
|
const g = select$2(this);
|
|
26268
|
-
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => columnGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", () => {
|
|
26269
|
-
const
|
|
26270
|
-
|
|
26271
|
-
|
|
26272
|
-
|
|
26273
|
-
case
|
|
26274
|
-
return
|
|
26642
|
+
g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => columnGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", (d2) => {
|
|
26643
|
+
const lineWidth = parseInt(
|
|
26644
|
+
seriesData[i].properties.lineWidth.toString()
|
|
26645
|
+
);
|
|
26646
|
+
switch (seriesData[i].properties.lineStyle) {
|
|
26647
|
+
case staticLineStyle.dotted:
|
|
26648
|
+
return `0,${lineWidth + 2}`;
|
|
26649
|
+
case staticLineStyle.dashed:
|
|
26650
|
+
return strokeDashValues;
|
|
26275
26651
|
default:
|
|
26276
26652
|
return "";
|
|
26277
26653
|
}
|
|
26278
26654
|
}).attr(
|
|
26279
26655
|
"stroke-linecap",
|
|
26280
|
-
() => seriesData[i]?.properties?.lineStyle ===
|
|
26656
|
+
() => seriesData[i]?.properties?.lineStyle.toLowerCase() === staticLineStyle.dotted ? strokeLineCap.round : ""
|
|
26281
26657
|
).attr(
|
|
26282
26658
|
"stroke-width",
|
|
26283
|
-
(d2, i2) => seriesData[i2].properties.lineStyle !==
|
|
26659
|
+
(d2, i2) => seriesData[i2].properties.lineStyle !== staticLineStyle.none ? seriesData[i2].properties.lineWidth : "0"
|
|
26284
26660
|
).attr("fill", "none").style("pointer-events", "none");
|
|
26285
26661
|
g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => columnGenerator(d2)).attr("fill", "transparent").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
|
|
26286
26662
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
|
|
26287
26663
|
svg.selectAll(
|
|
26288
|
-
'[hoverId="' + getJQuerySelector(
|
|
26664
|
+
'[hoverId="' + getJQuerySelector(
|
|
26665
|
+
(lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend").replace(/ /g, "-")
|
|
26666
|
+
) + '"]'
|
|
26289
26667
|
).classed("highlight", true).classed("unhighlight", false);
|
|
26290
26668
|
}).on("mouseleave", function() {
|
|
26291
26669
|
svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
|
|
26292
26670
|
});
|
|
26293
26671
|
svg.selectAll(
|
|
26294
|
-
'[hoverId="' + getJQuerySelector(
|
|
26672
|
+
'[hoverId="' + getJQuerySelector(
|
|
26673
|
+
(lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/ /g, "-")
|
|
26674
|
+
) + '"]'
|
|
26295
26675
|
).classed("highlight", false).classed("unhighlight", false);
|
|
26296
26676
|
});
|
|
26297
26677
|
areaGroups.exit().remove();
|
|
@@ -26428,8 +26808,10 @@
|
|
|
26428
26808
|
stackChartData = stack().keys(chartJSON.legendList).offset(none$3)(stackLineData2);
|
|
26429
26809
|
filteredData.forEach(
|
|
26430
26810
|
(data2, index2) => data2.data.forEach((axisData, position) => {
|
|
26431
|
-
|
|
26432
|
-
|
|
26811
|
+
if (stackChartData[index2][position]) {
|
|
26812
|
+
axisData["0"] = stackChartData[index2][position][0];
|
|
26813
|
+
axisData["1"] = stackChartData[index2][position][1];
|
|
26814
|
+
}
|
|
26433
26815
|
})
|
|
26434
26816
|
);
|
|
26435
26817
|
let seriesColor = formatOptions.annotation.annotationSetLabelColor;
|
|
@@ -27496,29 +27878,33 @@
|
|
|
27496
27878
|
);
|
|
27497
27879
|
}).on("mouseout", () => hideTooltipOnMouseOut());
|
|
27498
27880
|
leaf.append("clipPath").attr("id", (d, i) => `clip-${i}-${chartId}`).append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
|
|
27499
|
-
|
|
27500
|
-
"font-style",
|
|
27501
|
-
|
|
27502
|
-
|
|
27503
|
-
|
|
27504
|
-
|
|
27505
|
-
|
|
27506
|
-
|
|
27507
|
-
|
|
27508
|
-
|
|
27509
|
-
|
|
27510
|
-
|
|
27881
|
+
if (chartFormatOptions.plotArea.dataLabels) {
|
|
27882
|
+
leaf.append("text").style("fill", (d) => d.data.properties.labelFontColor).style("font-family", (d) => d.data.properties.fontFamily).style("font-size", (d) => d.data.properties.fontSize).style(
|
|
27883
|
+
"font-style",
|
|
27884
|
+
(d) => d.data.properties.fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
27885
|
+
).style(
|
|
27886
|
+
"text-decoration",
|
|
27887
|
+
(d) => d.data.properties.fontStyle.includes(fontStyleOptions.underline) ? fontStyleOptions.underline : ""
|
|
27888
|
+
).style(
|
|
27889
|
+
"font-weight",
|
|
27890
|
+
(d) => d.data.properties.fontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""
|
|
27891
|
+
).attr("clip-path", (d, i) => `url(#clip-${i}-${chartId})`);
|
|
27892
|
+
if (chartFormatOptions.plotArea.dataLabelName) {
|
|
27893
|
+
leaf.selectAll("text").append("tspan").attr("x", 5).attr("y", "1.1em").text((d) => d.data.legend);
|
|
27894
|
+
}
|
|
27895
|
+
if (chartFormatOptions.plotArea.dataLabelValue) {
|
|
27896
|
+
leaf.selectAll("text").append("tspan").attr("x", 5).attr(
|
|
27897
|
+
"y",
|
|
27898
|
+
chartFormatOptions.plotArea.dataLabelName ? "2.1em" : "1.1em"
|
|
27899
|
+
).text(
|
|
27900
|
+
(d) => getNumberWithFormatFunction(
|
|
27901
|
+
chartFormatOptions.plotArea.plotAreaDisplayUnits,
|
|
27902
|
+
chartFormatOptions.plotArea.dataLabelNumberFormat,
|
|
27903
|
+
chartFormatOptions.plotArea.dataLabelDecimalPrecision
|
|
27904
|
+
)(d.data.data[0].value)
|
|
27905
|
+
);
|
|
27906
|
+
}
|
|
27511
27907
|
}
|
|
27512
|
-
leaf.selectAll("text").append("tspan").attr("x", 5).attr(
|
|
27513
|
-
"y",
|
|
27514
|
-
chartFormatOptions.plotArea.dataLabelName ? "2.1em" : "1.1em"
|
|
27515
|
-
).text(
|
|
27516
|
-
(d) => getNumberWithFormatFunction(
|
|
27517
|
-
chartFormatOptions.plotArea.plotAreaDisplayUnits,
|
|
27518
|
-
chartFormatOptions.plotArea.dataLabelNumberFormat,
|
|
27519
|
-
chartFormatOptions.plotArea.dataLabelDecimalPrecision
|
|
27520
|
-
)(d.data.data[0].value)
|
|
27521
|
-
);
|
|
27522
27908
|
} catch (error) {
|
|
27523
27909
|
logError$2(fileName$6, "initChartRect", error);
|
|
27524
27910
|
}
|
|
@@ -27937,18 +28323,6 @@
|
|
|
27937
28323
|
data: []
|
|
27938
28324
|
};
|
|
27939
28325
|
});
|
|
27940
|
-
initLegendListWithTotalValueAllowance(
|
|
27941
|
-
chartFormatOptions,
|
|
27942
|
-
svg,
|
|
27943
|
-
seriesData,
|
|
27944
|
-
width,
|
|
27945
|
-
height,
|
|
27946
|
-
legendListWidth,
|
|
27947
|
-
chartTitleHeight,
|
|
27948
|
-
chartId,
|
|
27949
|
-
margins,
|
|
27950
|
-
staticLegendShape.circle
|
|
27951
|
-
);
|
|
27952
28326
|
} catch (error) {
|
|
27953
28327
|
logError$2(fileName$5, "initLegendList", error);
|
|
27954
28328
|
}
|
|
@@ -28539,9 +28913,9 @@
|
|
|
28539
28913
|
chartFormatOptions.plotArea.dataLabelValueFontFamily
|
|
28540
28914
|
).attr("font-size", chartFormatOptions.plotArea.dataLabelValueFontSize).text(() => {
|
|
28541
28915
|
return chartFormatOptions.plotArea.dataLabelNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
|
|
28542
|
-
chartFormatOptions.plotArea.
|
|
28916
|
+
chartFormatOptions.plotArea.plotAreaDisplayUnits,
|
|
28543
28917
|
chartFormatOptions.plotArea.dataLabelNumberFormatProgress,
|
|
28544
|
-
chartFormatOptions.plotArea.
|
|
28918
|
+
chartFormatOptions.plotArea.dataLabelDecimalPrecision
|
|
28545
28919
|
)(progressValue);
|
|
28546
28920
|
});
|
|
28547
28921
|
} catch (error) {
|
|
@@ -28625,10 +28999,9 @@
|
|
|
28625
28999
|
positionDominatorName = "height";
|
|
28626
29000
|
}
|
|
28627
29001
|
positionTransformString = centerTranslation(positionDominatorName);
|
|
28628
|
-
innerRadius =
|
|
28629
|
-
|
|
28630
|
-
|
|
28631
|
-
);
|
|
29002
|
+
innerRadius = convertStringToNumber(
|
|
29003
|
+
chartFormatOptions.plotArea.innerRadiusForSpeedometer
|
|
29004
|
+
) / 100 * radius;
|
|
28632
29005
|
} catch (error) {
|
|
28633
29006
|
logError$2(fileName2, "initChartRadius", error);
|
|
28634
29007
|
}
|
|
@@ -28685,9 +29058,12 @@
|
|
|
28685
29058
|
}
|
|
28686
29059
|
}
|
|
28687
29060
|
} else {
|
|
28688
|
-
if (
|
|
28689
|
-
|
|
28690
|
-
|
|
29061
|
+
if (chartFormatOptions.colorScale.showColor == colorThemeTypes.none) {
|
|
29062
|
+
const color2 = ChartData[0].properties?.color ?? "#bac8de";
|
|
29063
|
+
for (let index2 = 1; index2 <= customTicksCount; index2++) {
|
|
29064
|
+
colorThemeArray.push(color2);
|
|
29065
|
+
}
|
|
29066
|
+
} else if (chartFormatOptions.colorScale.showColor == colorThemeTypes.discrete) {
|
|
28691
29067
|
for (let index2 = 1; index2 <= customTicksCount; index2++) {
|
|
28692
29068
|
colorThemeArray.push(
|
|
28693
29069
|
chartFormatOptions.colorScale["division" + index2]
|
|
@@ -53549,7 +53925,9 @@
|
|
|
53549
53925
|
if (formatOptions.xAxisLabel.hideZeroValues) {
|
|
53550
53926
|
if (tempDimensionList.length > 0) {
|
|
53551
53927
|
tempDimensionList.forEach((dimension) => {
|
|
53552
|
-
chartJSON.legendList = chartJSON.legendList.filter(
|
|
53928
|
+
chartJSON.legendList = chartJSON.legendList.filter(
|
|
53929
|
+
(dim) => dim !== dimension
|
|
53930
|
+
);
|
|
53553
53931
|
});
|
|
53554
53932
|
}
|
|
53555
53933
|
chartJSON.dimensionList = chartJSON.legendList;
|
|
@@ -53568,7 +53946,11 @@
|
|
|
53568
53946
|
tempWaterfallChartData && tempWaterfallChartData.forEach((d, i) => {
|
|
53569
53947
|
if (d.dimension) {
|
|
53570
53948
|
tempDimensionList.push(d.dimension);
|
|
53571
|
-
tempDimensionListWithIndex.push({
|
|
53949
|
+
tempDimensionListWithIndex.push({
|
|
53950
|
+
dimension: d.dimension,
|
|
53951
|
+
chartDataIndex: i,
|
|
53952
|
+
selfIndex: tempDimensionListWithIndex.length
|
|
53953
|
+
});
|
|
53572
53954
|
}
|
|
53573
53955
|
});
|
|
53574
53956
|
if (isDateType) {
|
|
@@ -53579,7 +53961,9 @@
|
|
|
53579
53961
|
} else {
|
|
53580
53962
|
tempformatedDimensionList = tempDimensionList;
|
|
53581
53963
|
}
|
|
53582
|
-
let formatedDimensionList = JSON.parse(
|
|
53964
|
+
let formatedDimensionList = JSON.parse(
|
|
53965
|
+
JSON.stringify(chartJSON.legendList)
|
|
53966
|
+
);
|
|
53583
53967
|
tempDimensionListWithIndex.forEach((listItem, i) => {
|
|
53584
53968
|
formatedDimensionList[listItem.chartDataIndex] = tempformatedDimensionList[listItem.selfIndex];
|
|
53585
53969
|
});
|
|
@@ -53652,7 +54036,9 @@
|
|
|
53652
54036
|
)
|
|
53653
54037
|
).tickSize(
|
|
53654
54038
|
formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
|
|
53655
|
-
).tickValues(
|
|
54039
|
+
).tickValues(
|
|
54040
|
+
responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
|
|
54041
|
+
).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
|
|
53656
54042
|
}
|
|
53657
54043
|
colorScale = ordinal().domain(["base", "dimensionTotal", "up", "down"]).range([
|
|
53658
54044
|
formatOptions.plotArea.totalColor,
|
|
@@ -53668,9 +54054,7 @@
|
|
|
53668
54054
|
};
|
|
53669
54055
|
const getChartType = (lineData) => {
|
|
53670
54056
|
let totalStackData;
|
|
53671
|
-
waterFallData.forEach(
|
|
53672
|
-
(K2, j) => K2.forEach((d) => d["key"] = K2.key)
|
|
53673
|
-
);
|
|
54057
|
+
waterFallData.forEach((K2, j) => K2.forEach((d) => d["key"] = K2.key));
|
|
53674
54058
|
if (stackTotalData) {
|
|
53675
54059
|
let stackDataLegendList = filteredData.map((name) => name.legend);
|
|
53676
54060
|
totalStackData = stack().keys(stackDataLegendList)(stackTotalData);
|
|
@@ -53689,10 +54073,30 @@
|
|
|
53689
54073
|
let parentGroup = gTag.selectAll(`.parentGroup-${k2}`).data([null]);
|
|
53690
54074
|
parentGroup = parentGroup.enter().append("g").attr("class", `parentGroup parentGroup-${k2}`).merge(parentGroup);
|
|
53691
54075
|
let barGroups = parentGroup.selectAll(`.bar-group-${k2}`).data(waterFallData);
|
|
53692
|
-
const barGroupsEnter = barGroups.enter().append("g").attr("class", `bar-group-${k2}`).attr(
|
|
54076
|
+
const barGroupsEnter = barGroups.enter().append("g").attr("class", `bar-group-${k2}`).attr(
|
|
54077
|
+
"fill",
|
|
54078
|
+
(d) => d.color ? d.color : colorScale(d.key) !== "#ffffff" ? colorScale(d.key) : "none"
|
|
54079
|
+
).attr("opacity", (d) => d.opacity);
|
|
53693
54080
|
barGroups = barGroupsEnter.merge(barGroups);
|
|
53694
|
-
let rects = barGroups.selectAll("rect").data(
|
|
53695
|
-
|
|
54081
|
+
let rects = barGroups.selectAll("rect").data(
|
|
54082
|
+
(d) => d,
|
|
54083
|
+
(d) => d.key || d.Key
|
|
54084
|
+
);
|
|
54085
|
+
const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr(
|
|
54086
|
+
"class",
|
|
54087
|
+
(d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")
|
|
54088
|
+
).attr(
|
|
54089
|
+
"x",
|
|
54090
|
+
(d) => xScale(
|
|
54091
|
+
!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
|
|
54092
|
+
)
|
|
54093
|
+
).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr(
|
|
54094
|
+
"height",
|
|
54095
|
+
(d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0
|
|
54096
|
+
).attr("width", xScale.bandwidth()).attr(
|
|
54097
|
+
"visibility",
|
|
54098
|
+
(d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible"
|
|
54099
|
+
).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
|
|
53696
54100
|
const markerInfo = {
|
|
53697
54101
|
markerShape: "square",
|
|
53698
54102
|
markerColor: d.key === "dimensionTotal" ? formatOptions.plotArea.totalColor : d.key === "down" ? formatOptions.plotArea.negativeColor : formatOptions.plotArea.positiveColor
|
|
@@ -53731,7 +54135,15 @@
|
|
|
53731
54135
|
formatOptions.plotArea.dataLabelNumberFormat,
|
|
53732
54136
|
formatOptions.plotArea.dataLabelDecimalPrecision
|
|
53733
54137
|
)
|
|
53734
|
-
).attr(
|
|
54138
|
+
).attr(
|
|
54139
|
+
"x",
|
|
54140
|
+
(d) => xScale(
|
|
54141
|
+
!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
|
|
54142
|
+
) + xScale.bandwidth() / 2
|
|
54143
|
+
).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr(
|
|
54144
|
+
"visibility",
|
|
54145
|
+
(d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden"
|
|
54146
|
+
);
|
|
53735
54147
|
textGroups.exit().remove();
|
|
53736
54148
|
}
|
|
53737
54149
|
}
|
|
@@ -53894,7 +54306,11 @@
|
|
|
53894
54306
|
tempWaterFallData.push(waterFallArr2);
|
|
53895
54307
|
if (dataRequiredForStackTotal.length > 0) {
|
|
53896
54308
|
filteredData = dataRequiredForStackTotal;
|
|
53897
|
-
stackTotalData = getStackedData(
|
|
54309
|
+
stackTotalData = getStackedData(
|
|
54310
|
+
filteredDimension,
|
|
54311
|
+
dataRequiredForStackTotal,
|
|
54312
|
+
false
|
|
54313
|
+
);
|
|
53898
54314
|
}
|
|
53899
54315
|
return tempWaterFallData;
|
|
53900
54316
|
} catch (error) {
|
|
@@ -53902,14 +54318,8 @@
|
|
|
53902
54318
|
}
|
|
53903
54319
|
};
|
|
53904
54320
|
const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
|
|
53905
|
-
const isNonZero = (v) => !Number.isNaN(toNumber(v)) && toNumber(v) !== 0;
|
|
53906
54321
|
const mapAdvancedWaterfallData = (rawData) => {
|
|
53907
|
-
return rawData.filter((d) => d.Column1 && d.Column1 !== "*").
|
|
53908
|
-
const base = toNumber(d.Column3);
|
|
53909
|
-
const up = toNumber(d.Column4);
|
|
53910
|
-
const down = toNumber(d.Column5);
|
|
53911
|
-
return isNonZero(base) || isNonZero(up) || isNonZero(down);
|
|
53912
|
-
}).map((d) => ({
|
|
54322
|
+
return rawData.filter((d) => d.Column1 && d.Column1 !== "*").map((d) => ({
|
|
53913
54323
|
xKey: d.Column1,
|
|
53914
54324
|
base: toNumber(d.Column3),
|
|
53915
54325
|
up: toNumber(d.Column4),
|
|
@@ -53937,7 +54347,7 @@
|
|
|
53937
54347
|
const chartId = crypto.randomUUID();
|
|
53938
54348
|
let columnWidth = 0;
|
|
53939
54349
|
const chartType = chartTypes.TornadoChart;
|
|
53940
|
-
const
|
|
54350
|
+
const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart ?? false;
|
|
53941
54351
|
const svgRef = require$$0$1.useRef();
|
|
53942
54352
|
const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
|
|
53943
54353
|
const dimensionList = data.DimensionList;
|
|
@@ -54009,6 +54419,7 @@
|
|
|
54009
54419
|
svgRef,
|
|
54010
54420
|
formatOptions
|
|
54011
54421
|
));
|
|
54422
|
+
formatOptions.xAxisLabel.labelTextWrap = false;
|
|
54012
54423
|
preProcessChartData();
|
|
54013
54424
|
({ maxNumberForPrimaryAxis, maxNumberForSecondaryAxis } = customYscaleLabelFormatting$1(
|
|
54014
54425
|
// for calculating primary/secondary axis max number so that we can calculate margin accordinglt
|
|
@@ -54037,7 +54448,7 @@
|
|
|
54037
54448
|
maxNumberForSecondaryAxis,
|
|
54038
54449
|
chartJSON.yMaxLeft,
|
|
54039
54450
|
formatOptions,
|
|
54040
|
-
!
|
|
54451
|
+
!isAdvanceAnalyticsChart ? chartJSON.legendList.map((d) => d["alias"]) : chartJSON.legendList.map((d) => d["alias"].split(" - ")[0]),
|
|
54041
54452
|
chartJSON.dimensionList,
|
|
54042
54453
|
chartJSON.yMaxRight,
|
|
54043
54454
|
isSecondaryAxisDrawn,
|
|
@@ -54165,24 +54576,23 @@
|
|
|
54165
54576
|
mapSeriesDataWithLegendList(
|
|
54166
54577
|
seriesData,
|
|
54167
54578
|
chartJSON.legendList,
|
|
54168
|
-
|
|
54579
|
+
isAdvanceAnalyticsChart,
|
|
54169
54580
|
formatOptions
|
|
54170
54581
|
),
|
|
54171
54582
|
chartId,
|
|
54172
|
-
staticLegendShape.rectangle
|
|
54173
|
-
chartType
|
|
54583
|
+
staticLegendShape.rectangle
|
|
54174
54584
|
);
|
|
54175
54585
|
};
|
|
54176
|
-
const mapSeriesDataWithLegendList = (seriesData2, legendList,
|
|
54586
|
+
const mapSeriesDataWithLegendList = (seriesData2, legendList, isAdvanceAnalyticsChart2, formatOptions2) => {
|
|
54177
54587
|
return seriesData2.map((series, index2) => {
|
|
54178
54588
|
const legend = legendList[index2];
|
|
54179
54589
|
if (!legend) return { ...series, properties: {} };
|
|
54180
54590
|
let updatedAlias = legend.alias;
|
|
54181
|
-
if (
|
|
54591
|
+
if (isAdvanceAnalyticsChart2 && legend.alias) {
|
|
54182
54592
|
updatedAlias = legend.alias.split(" - ")[0].trim();
|
|
54183
54593
|
}
|
|
54184
54594
|
let updatedColor = legend.color;
|
|
54185
|
-
if (
|
|
54595
|
+
if (isAdvanceAnalyticsChart2 && updatedAlias) {
|
|
54186
54596
|
if (updatedAlias.includes("+ve")) {
|
|
54187
54597
|
updatedColor = formatOptions2.plotArea.plotAreaCalculatedHigh;
|
|
54188
54598
|
} else if (updatedAlias.includes("-ve")) {
|
|
@@ -54203,7 +54613,7 @@
|
|
|
54203
54613
|
};
|
|
54204
54614
|
const preProcessChartData = () => {
|
|
54205
54615
|
let processedSeriesData;
|
|
54206
|
-
if (!
|
|
54616
|
+
if (!isAdvanceAnalyticsChart) {
|
|
54207
54617
|
const firstMeasure = seriesData[0]?.properties.currentMeasure;
|
|
54208
54618
|
let yMaxLeft = 0;
|
|
54209
54619
|
let yMaxRight = -Infinity;
|
|
@@ -54237,12 +54647,13 @@
|
|
|
54237
54647
|
chartJSON.dimensionList
|
|
54238
54648
|
) : chartJSON.dimensionList;
|
|
54239
54649
|
chartJSON.dimensionList.forEach((dim, i) => {
|
|
54240
|
-
chartJSON.formattedDimensionListMap.set(
|
|
54241
|
-
dim,
|
|
54242
|
-
formatedDimensionList[i]
|
|
54243
|
-
);
|
|
54650
|
+
chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
|
|
54244
54651
|
});
|
|
54245
|
-
filteredData = JSON.parse(
|
|
54652
|
+
filteredData = JSON.parse(
|
|
54653
|
+
JSON.stringify(
|
|
54654
|
+
!isAdvanceAnalyticsChart ? processedSeriesData : seriesData
|
|
54655
|
+
)
|
|
54656
|
+
);
|
|
54246
54657
|
filteredDimension = !formatOptions.plotArea.fitChart ? chartJSON.dimensionList.slice(
|
|
54247
54658
|
scrollPosition,
|
|
54248
54659
|
scrollPosition + visibleBars
|
|
@@ -54266,7 +54677,10 @@
|
|
|
54266
54677
|
let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
|
|
54267
54678
|
let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? chartJSON.yMaxLeft / maxValue !== 1 ? Math.abs(chartJSON.yMaxLeft / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(chartJSON.yMaxRight / maxValue) * 100 < 10 ? 3 : 0 : 0;
|
|
54268
54679
|
chartJSON.yMaxLeft = chartJSON.yMaxLeft;
|
|
54269
|
-
xScaleForLegends = linear$1().domain([
|
|
54680
|
+
xScaleForLegends = linear$1().domain([
|
|
54681
|
+
chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)),
|
|
54682
|
+
chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))
|
|
54683
|
+
]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
|
|
54270
54684
|
xScale = xScaleForLegends;
|
|
54271
54685
|
calculatedRange = [0, innerWidth2];
|
|
54272
54686
|
getXScale();
|
|
@@ -54329,16 +54743,16 @@
|
|
|
54329
54743
|
filteredData.flatMap(
|
|
54330
54744
|
(d) => d.data.map((child) => ({
|
|
54331
54745
|
...child,
|
|
54332
|
-
legendText: !
|
|
54746
|
+
legendText: !isAdvanceAnalyticsChart ? chartJSON.dimensionList[0] == chartTypes.TornadoDefaultEntry ? "defaultEntry" : d.legend.split("-")[1]?.trim() ?? d.legend : d.legend.split("ve) - ")[1]?.trim() ?? d.legend,
|
|
54333
54747
|
properties: d.properties
|
|
54334
54748
|
}))
|
|
54335
54749
|
)
|
|
54336
|
-
).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(
|
|
54750
|
+
).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(chartTypes.TornadoDefaultEntry)).attr("height", yScaleLeft.bandwidth()).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr("stroke-dasharray", (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr("hoverId", (d) => ((isAdvanceAnalyticsChart ? d.legend.split(" - ")[0] : d["dimension"]) || "Legend").replace(/\s+/g, "-")).attr(
|
|
54337
54751
|
"stroke",
|
|
54338
54752
|
(d) => d.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.properties.stackBorderColor : "none"
|
|
54339
54753
|
).style(
|
|
54340
54754
|
"fill",
|
|
54341
|
-
(d) =>
|
|
54755
|
+
(d) => isAdvanceAnalyticsChart ? d.value > 0 ? positiveBarColor !== "#ffffff" ? positiveBarColor : "none" : negativeBarColor !== "#ffffff" ? negativeBarColor : "none" : d.properties.color
|
|
54342
54756
|
).on("mousemove", (event2, d) => {
|
|
54343
54757
|
showTooltipOnMouseMove(
|
|
54344
54758
|
[
|
|
@@ -54430,14 +54844,7 @@
|
|
|
54430
54844
|
};
|
|
54431
54845
|
const drawColumnChart = () => {
|
|
54432
54846
|
getChartType();
|
|
54433
|
-
initXaxisBar(
|
|
54434
|
-
formatOptions,
|
|
54435
|
-
gTag,
|
|
54436
|
-
xLabel,
|
|
54437
|
-
innerHeight2,
|
|
54438
|
-
innerWidth2,
|
|
54439
|
-
xAxis
|
|
54440
|
-
);
|
|
54847
|
+
initXaxisBar(formatOptions, gTag, xLabel, innerHeight2, innerWidth2, xAxis);
|
|
54441
54848
|
commonAnnotations(
|
|
54442
54849
|
filteredData,
|
|
54443
54850
|
yScaleLeft,
|
|
@@ -54463,7 +54870,7 @@
|
|
|
54463
54870
|
svg,
|
|
54464
54871
|
yScaleLeft,
|
|
54465
54872
|
columnWidth,
|
|
54466
|
-
|
|
54873
|
+
isAdvanceAnalyticsChart,
|
|
54467
54874
|
isReportEditable,
|
|
54468
54875
|
barChart
|
|
54469
54876
|
);
|