pace-chart-lib 1.0.28 → 1.0.30
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.
|
@@ -566,6 +566,7 @@ export declare const defaultChartFormatOptions: {
|
|
|
566
566
|
dataTableDecimalPrecision: string;
|
|
567
567
|
dataTableDisplayUnits: string;
|
|
568
568
|
dataTableLabelColor: commonColors;
|
|
569
|
+
dataTableAxisLabel: boolean;
|
|
569
570
|
};
|
|
570
571
|
dataTableOuterBorder: {
|
|
571
572
|
borderButtonVisibility: boolean;
|
|
@@ -11443,7 +11443,8 @@ const defaultChartFormatOptions = {
|
|
|
11443
11443
|
dataTableNumberFormat: ",",
|
|
11444
11444
|
dataTableDecimalPrecision: "2",
|
|
11445
11445
|
dataTableDisplayUnits: "None",
|
|
11446
|
-
dataTableLabelColor: commonColors.black
|
|
11446
|
+
dataTableLabelColor: commonColors.black,
|
|
11447
|
+
dataTableAxisLabel: true
|
|
11447
11448
|
},
|
|
11448
11449
|
dataTableOuterBorder: {
|
|
11449
11450
|
borderButtonVisibility: true,
|
|
@@ -11784,7 +11785,7 @@ function calculateVerticalMargins(windowWidth, windowHeight, maxNumberForPrimary
|
|
|
11784
11785
|
bottom2 = xAxisRelatedMargin + 5 + scrollHeightConstant;
|
|
11785
11786
|
break;
|
|
11786
11787
|
case staticLegendPosition.bottom:
|
|
11787
|
-
bottom2 =
|
|
11788
|
+
bottom2 = 30 + xAxisRelatedMargin + scrollHeightConstant;
|
|
11788
11789
|
top2 = metrics.chartTitleHeight + 5 + (isNormalizedChart ? 12 : 0);
|
|
11789
11790
|
break;
|
|
11790
11791
|
case staticLegendPosition.left:
|
|
@@ -13744,7 +13745,7 @@ const dataTablePreCalculation = (formatOptions, yLabel, yTitle, seriesData, dime
|
|
|
13744
13745
|
let dataTableHeight = 20;
|
|
13745
13746
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
13746
13747
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
13747
|
-
let exactAvailableWidth = yLabel + yTitle
|
|
13748
|
+
let exactAvailableWidth = yLabel + yTitle;
|
|
13748
13749
|
seriesData.forEach((data, i) => {
|
|
13749
13750
|
let tempObj = {
|
|
13750
13751
|
"data": data.data.filter((data2) => dimensionList.includes(data2.dimension)),
|
|
@@ -13836,14 +13837,14 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
|
|
|
13836
13837
|
selectAll("#dataTableG" + chartId).remove();
|
|
13837
13838
|
let tag = currentTag.append("g").attr("id", "dataTableG" + chartId);
|
|
13838
13839
|
dataTable.forEach((data, i) => {
|
|
13839
|
-
yCordinate = yCordinate + cellHeight;
|
|
13840
|
+
yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
|
|
13840
13841
|
cellHeight = data.properties.height;
|
|
13841
13842
|
getLegendsAppended(tag, i, data, cellHeight);
|
|
13842
13843
|
let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
|
|
13843
13844
|
"transform",
|
|
13844
13845
|
(d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
|
|
13845
13846
|
);
|
|
13846
|
-
if (i == 0) {
|
|
13847
|
+
if (i == 0 && formatOptions.dataTableProperties.dataTableAxisLabel) {
|
|
13847
13848
|
parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", "20px").append("xhtml:div").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${20}px`).style("border-width", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "width", "colHeaders")).style("border-style", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "style", "colHeaders")).style("border-color", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "color", "colHeaders")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
13848
13849
|
"text-decoration",
|
|
13849
13850
|
fontStyle.includes("Underline") ? "Underline" : ""
|
|
@@ -15434,7 +15435,7 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
|
|
|
15434
15435
|
svg,
|
|
15435
15436
|
seriesData,
|
|
15436
15437
|
7,
|
|
15437
|
-
height -
|
|
15438
|
+
height - 35,
|
|
15438
15439
|
width - 10,
|
|
15439
15440
|
30,
|
|
15440
15441
|
position,
|
|
@@ -16911,10 +16912,10 @@ const ColumnChart = ({
|
|
|
16911
16912
|
return yScale(0);
|
|
16912
16913
|
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16913
16914
|
"stroke-dasharray",
|
|
16914
|
-
(d) =>
|
|
16915
|
-
).attr("stroke-width", (d) => `${
|
|
16915
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
16916
|
+
).attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
16916
16917
|
"stroke",
|
|
16917
|
-
(d) => data2.properties.stackBorderStyle
|
|
16918
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
16918
16919
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
16919
16920
|
"visibility",
|
|
16920
16921
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17125,6 +17126,7 @@ const CustomColumnChart = ({
|
|
|
17125
17126
|
let yAxisLeft;
|
|
17126
17127
|
let xAxis;
|
|
17127
17128
|
let yAxisRight;
|
|
17129
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
17128
17130
|
let filteredDimension;
|
|
17129
17131
|
let filteredData = [];
|
|
17130
17132
|
let requiredData = [];
|
|
@@ -17621,9 +17623,9 @@ const CustomColumnChart = ({
|
|
|
17621
17623
|
}).attr("height", (d) => {
|
|
17622
17624
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17623
17625
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
17624
|
-
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) =>
|
|
17626
|
+
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
17625
17627
|
"stroke",
|
|
17626
|
-
(d) => data2.properties.stackBorderStyle
|
|
17628
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
17627
17629
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
17628
17630
|
"visibility",
|
|
17629
17631
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17686,7 +17688,7 @@ const CustomColumnChart = ({
|
|
|
17686
17688
|
).append("path").attr("class", "line").attr("fill", "none");
|
|
17687
17689
|
lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
|
|
17688
17690
|
"stroke",
|
|
17689
|
-
(d) => d.properties !== commonColors.white ? d.properties.color : "none"
|
|
17691
|
+
(d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
|
|
17690
17692
|
).attr("stroke-dasharray", (d) => {
|
|
17691
17693
|
switch (d.properties.lineStyle) {
|
|
17692
17694
|
case staticLineStyle.dotted:
|
|
@@ -17885,12 +17887,12 @@ const CustomColumnChart = ({
|
|
|
17885
17887
|
(sdata) => sdata.legend === d.key
|
|
17886
17888
|
);
|
|
17887
17889
|
const props = seriesData[seriesIndex]?.properties;
|
|
17888
|
-
return props?.stackBorderStyle
|
|
17890
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
17889
17891
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
17890
17892
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17891
17893
|
(sdata) => sdata.legend === d.key
|
|
17892
17894
|
);
|
|
17893
|
-
return seriesData[seriesIndex]?.properties.stackBorderStyle
|
|
17895
|
+
return seriesData[seriesIndex]?.properties.stackBorderStyle == 2 ? "5,3" : "0";
|
|
17894
17896
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
17895
17897
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17896
17898
|
(sdata) => sdata.legend === d.key
|
|
@@ -17932,6 +17934,7 @@ const CustomColumnChart = ({
|
|
|
17932
17934
|
filteredData = fData;
|
|
17933
17935
|
filteredDimension = fDimension;
|
|
17934
17936
|
visibleBars = fVisibleBars;
|
|
17937
|
+
createTotalMeasureValueMapForCustomColumChart(data, totalValueMap, filteredDimension);
|
|
17935
17938
|
checkAndupdateInputData(
|
|
17936
17939
|
primaryStackAreaAxisData,
|
|
17937
17940
|
primaryStackColumnAxisData,
|
|
@@ -17955,6 +17958,28 @@ const CustomColumnChart = ({
|
|
|
17955
17958
|
});
|
|
17956
17959
|
drawCustomChart();
|
|
17957
17960
|
};
|
|
17961
|
+
function createTotalMeasureValueMapForCustomColumChart(data2, totalValueMap2, filteredDimension2) {
|
|
17962
|
+
totalValueMap2.clear();
|
|
17963
|
+
if (filteredDimension2 && filteredDimension2.length > 0) {
|
|
17964
|
+
filteredDimension2.forEach((dimension) => {
|
|
17965
|
+
let totalMeasureValue = 0;
|
|
17966
|
+
totalValueMap2.set(dimension, totalMeasureValue);
|
|
17967
|
+
});
|
|
17968
|
+
}
|
|
17969
|
+
if (data2.ChartData && data2.ChartData.length > 0) {
|
|
17970
|
+
data2.ChartData.forEach((series) => {
|
|
17971
|
+
if (series.properties.type.includes("Stack")) {
|
|
17972
|
+
series.data.forEach((dataPoint, index2) => {
|
|
17973
|
+
if (totalValueMap2.has(dataPoint.dimension)) {
|
|
17974
|
+
let existingTotal = totalValueMap2.get(dataPoint.dimension) || 0;
|
|
17975
|
+
existingTotal += dataPoint.value || 0;
|
|
17976
|
+
totalValueMap2.set(dataPoint.dimension, existingTotal);
|
|
17977
|
+
}
|
|
17978
|
+
});
|
|
17979
|
+
}
|
|
17980
|
+
});
|
|
17981
|
+
}
|
|
17982
|
+
}
|
|
17958
17983
|
const drawCustomChart = () => {
|
|
17959
17984
|
getXScale();
|
|
17960
17985
|
getXAxis();
|
|
@@ -18003,6 +18028,20 @@ const CustomColumnChart = ({
|
|
|
18003
18028
|
xScaleForLegends,
|
|
18004
18029
|
isReportEditable
|
|
18005
18030
|
);
|
|
18031
|
+
addTotalValue(
|
|
18032
|
+
totalValueMap,
|
|
18033
|
+
xScale,
|
|
18034
|
+
yScaleLeft,
|
|
18035
|
+
margin,
|
|
18036
|
+
d3Annotation,
|
|
18037
|
+
[],
|
|
18038
|
+
formatOptions,
|
|
18039
|
+
chartType,
|
|
18040
|
+
height,
|
|
18041
|
+
width,
|
|
18042
|
+
svg,
|
|
18043
|
+
isReportEditable
|
|
18044
|
+
);
|
|
18006
18045
|
};
|
|
18007
18046
|
const createStackData = (requiredStackChatData) => {
|
|
18008
18047
|
let legendList = requiredStackChatData.data.map((d) => d.legend);
|
|
@@ -18457,10 +18496,10 @@ const LayeredColumnChart = ({
|
|
|
18457
18496
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
18458
18497
|
}).attr("fill", data2.properties.color).attr(
|
|
18459
18498
|
"stroke-dasharray",
|
|
18460
|
-
(d) =>
|
|
18461
|
-
).attr("stroke-width", (
|
|
18499
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
18500
|
+
).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18462
18501
|
"stroke",
|
|
18463
|
-
(
|
|
18502
|
+
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
18464
18503
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
18465
18504
|
"visibility",
|
|
18466
18505
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -18940,16 +18979,16 @@ const StackColumnChart = ({
|
|
|
18940
18979
|
return props?.color || "gray";
|
|
18941
18980
|
}).attr("stroke", (d, i, nodes) => {
|
|
18942
18981
|
const { props } = getPropsForRect(nodes, i);
|
|
18943
|
-
return props?.stackBorderStyle
|
|
18982
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
18944
18983
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
18945
18984
|
const { props } = getPropsForRect(nodes, i);
|
|
18946
|
-
return props?.stackBorderStyle
|
|
18985
|
+
return props?.stackBorderStyle == 2 ? "5,3" : "0";
|
|
18947
18986
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
18948
18987
|
const { props } = getPropsForRect(nodes, i);
|
|
18949
18988
|
return (props?.stackBorderWidth || 0) + "px";
|
|
18950
18989
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
18951
18990
|
const { props } = getPropsForRect(nodes, i);
|
|
18952
|
-
return d.data[d.key]
|
|
18991
|
+
return d.data[d.key] == 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
18953
18992
|
}).on("mousemove", (event2, d) => {
|
|
18954
18993
|
showTooltipOnMouseMove(
|
|
18955
18994
|
[
|
|
@@ -11446,7 +11446,8 @@
|
|
|
11446
11446
|
dataTableNumberFormat: ",",
|
|
11447
11447
|
dataTableDecimalPrecision: "2",
|
|
11448
11448
|
dataTableDisplayUnits: "None",
|
|
11449
|
-
dataTableLabelColor: commonColors.black
|
|
11449
|
+
dataTableLabelColor: commonColors.black,
|
|
11450
|
+
dataTableAxisLabel: true
|
|
11450
11451
|
},
|
|
11451
11452
|
dataTableOuterBorder: {
|
|
11452
11453
|
borderButtonVisibility: true,
|
|
@@ -11787,7 +11788,7 @@
|
|
|
11787
11788
|
bottom2 = xAxisRelatedMargin + 5 + scrollHeightConstant;
|
|
11788
11789
|
break;
|
|
11789
11790
|
case staticLegendPosition.bottom:
|
|
11790
|
-
bottom2 =
|
|
11791
|
+
bottom2 = 30 + xAxisRelatedMargin + scrollHeightConstant;
|
|
11791
11792
|
top2 = metrics.chartTitleHeight + 5 + (isNormalizedChart ? 12 : 0);
|
|
11792
11793
|
break;
|
|
11793
11794
|
case staticLegendPosition.left:
|
|
@@ -13747,7 +13748,7 @@
|
|
|
13747
13748
|
let dataTableHeight = 20;
|
|
13748
13749
|
if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
|
|
13749
13750
|
formatOptions.xAxisLabel.xAxisLabelVisibility = false;
|
|
13750
|
-
let exactAvailableWidth = yLabel + yTitle
|
|
13751
|
+
let exactAvailableWidth = yLabel + yTitle;
|
|
13751
13752
|
seriesData.forEach((data, i) => {
|
|
13752
13753
|
let tempObj = {
|
|
13753
13754
|
"data": data.data.filter((data2) => dimensionList.includes(data2.dimension)),
|
|
@@ -13839,14 +13840,14 @@
|
|
|
13839
13840
|
selectAll("#dataTableG" + chartId).remove();
|
|
13840
13841
|
let tag = currentTag.append("g").attr("id", "dataTableG" + chartId);
|
|
13841
13842
|
dataTable.forEach((data, i) => {
|
|
13842
|
-
yCordinate = yCordinate + cellHeight;
|
|
13843
|
+
yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
|
|
13843
13844
|
cellHeight = data.properties.height;
|
|
13844
13845
|
getLegendsAppended(tag, i, data, cellHeight);
|
|
13845
13846
|
let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
|
|
13846
13847
|
"transform",
|
|
13847
13848
|
(d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
|
|
13848
13849
|
);
|
|
13849
|
-
if (i == 0) {
|
|
13850
|
+
if (i == 0 && formatOptions.dataTableProperties.dataTableAxisLabel) {
|
|
13850
13851
|
parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", "20px").append("xhtml:div").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${20}px`).style("border-width", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "width", "colHeaders")).style("border-style", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "style", "colHeaders")).style("border-color", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "color", "colHeaders")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
|
|
13851
13852
|
"text-decoration",
|
|
13852
13853
|
fontStyle.includes("Underline") ? "Underline" : ""
|
|
@@ -15437,7 +15438,7 @@
|
|
|
15437
15438
|
svg,
|
|
15438
15439
|
seriesData,
|
|
15439
15440
|
7,
|
|
15440
|
-
height -
|
|
15441
|
+
height - 35,
|
|
15441
15442
|
width - 10,
|
|
15442
15443
|
30,
|
|
15443
15444
|
position,
|
|
@@ -16914,10 +16915,10 @@
|
|
|
16914
16915
|
return yScale(0);
|
|
16915
16916
|
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
16916
16917
|
"stroke-dasharray",
|
|
16917
|
-
(d) =>
|
|
16918
|
-
).attr("stroke-width", (d) => `${
|
|
16918
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
16919
|
+
).attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
16919
16920
|
"stroke",
|
|
16920
|
-
(d) => data2.properties.stackBorderStyle
|
|
16921
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
16921
16922
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
16922
16923
|
"visibility",
|
|
16923
16924
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17128,6 +17129,7 @@
|
|
|
17128
17129
|
let yAxisLeft;
|
|
17129
17130
|
let xAxis;
|
|
17130
17131
|
let yAxisRight;
|
|
17132
|
+
let totalValueMap = /* @__PURE__ */ new Map();
|
|
17131
17133
|
let filteredDimension;
|
|
17132
17134
|
let filteredData = [];
|
|
17133
17135
|
let requiredData = [];
|
|
@@ -17624,9 +17626,9 @@
|
|
|
17624
17626
|
}).attr("height", (d) => {
|
|
17625
17627
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17626
17628
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
17627
|
-
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) =>
|
|
17629
|
+
}).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${data2.properties.stackBorderWidth}px`).attr(
|
|
17628
17630
|
"stroke",
|
|
17629
|
-
(d) => data2.properties.stackBorderStyle
|
|
17631
|
+
(d) => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
17630
17632
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
|
|
17631
17633
|
"visibility",
|
|
17632
17634
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -17689,7 +17691,7 @@
|
|
|
17689
17691
|
).append("path").attr("class", "line").attr("fill", "none");
|
|
17690
17692
|
lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
|
|
17691
17693
|
"stroke",
|
|
17692
|
-
(d) => d.properties !== commonColors.white ? d.properties.color : "none"
|
|
17694
|
+
(d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
|
|
17693
17695
|
).attr("stroke-dasharray", (d) => {
|
|
17694
17696
|
switch (d.properties.lineStyle) {
|
|
17695
17697
|
case staticLineStyle.dotted:
|
|
@@ -17888,12 +17890,12 @@
|
|
|
17888
17890
|
(sdata) => sdata.legend === d.key
|
|
17889
17891
|
);
|
|
17890
17892
|
const props = seriesData[seriesIndex]?.properties;
|
|
17891
|
-
return props?.stackBorderStyle
|
|
17893
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
17892
17894
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
17893
17895
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17894
17896
|
(sdata) => sdata.legend === d.key
|
|
17895
17897
|
);
|
|
17896
|
-
return seriesData[seriesIndex]?.properties.stackBorderStyle
|
|
17898
|
+
return seriesData[seriesIndex]?.properties.stackBorderStyle == 2 ? "5,3" : "0";
|
|
17897
17899
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
17898
17900
|
const seriesIndex = Array.from(seriesData).findIndex(
|
|
17899
17901
|
(sdata) => sdata.legend === d.key
|
|
@@ -17935,6 +17937,7 @@
|
|
|
17935
17937
|
filteredData = fData;
|
|
17936
17938
|
filteredDimension = fDimension;
|
|
17937
17939
|
visibleBars = fVisibleBars;
|
|
17940
|
+
createTotalMeasureValueMapForCustomColumChart(data, totalValueMap, filteredDimension);
|
|
17938
17941
|
checkAndupdateInputData(
|
|
17939
17942
|
primaryStackAreaAxisData,
|
|
17940
17943
|
primaryStackColumnAxisData,
|
|
@@ -17958,6 +17961,28 @@
|
|
|
17958
17961
|
});
|
|
17959
17962
|
drawCustomChart();
|
|
17960
17963
|
};
|
|
17964
|
+
function createTotalMeasureValueMapForCustomColumChart(data2, totalValueMap2, filteredDimension2) {
|
|
17965
|
+
totalValueMap2.clear();
|
|
17966
|
+
if (filteredDimension2 && filteredDimension2.length > 0) {
|
|
17967
|
+
filteredDimension2.forEach((dimension) => {
|
|
17968
|
+
let totalMeasureValue = 0;
|
|
17969
|
+
totalValueMap2.set(dimension, totalMeasureValue);
|
|
17970
|
+
});
|
|
17971
|
+
}
|
|
17972
|
+
if (data2.ChartData && data2.ChartData.length > 0) {
|
|
17973
|
+
data2.ChartData.forEach((series) => {
|
|
17974
|
+
if (series.properties.type.includes("Stack")) {
|
|
17975
|
+
series.data.forEach((dataPoint, index2) => {
|
|
17976
|
+
if (totalValueMap2.has(dataPoint.dimension)) {
|
|
17977
|
+
let existingTotal = totalValueMap2.get(dataPoint.dimension) || 0;
|
|
17978
|
+
existingTotal += dataPoint.value || 0;
|
|
17979
|
+
totalValueMap2.set(dataPoint.dimension, existingTotal);
|
|
17980
|
+
}
|
|
17981
|
+
});
|
|
17982
|
+
}
|
|
17983
|
+
});
|
|
17984
|
+
}
|
|
17985
|
+
}
|
|
17961
17986
|
const drawCustomChart = () => {
|
|
17962
17987
|
getXScale();
|
|
17963
17988
|
getXAxis();
|
|
@@ -18006,6 +18031,20 @@
|
|
|
18006
18031
|
xScaleForLegends,
|
|
18007
18032
|
isReportEditable
|
|
18008
18033
|
);
|
|
18034
|
+
addTotalValue(
|
|
18035
|
+
totalValueMap,
|
|
18036
|
+
xScale,
|
|
18037
|
+
yScaleLeft,
|
|
18038
|
+
margin,
|
|
18039
|
+
d3Annotation,
|
|
18040
|
+
[],
|
|
18041
|
+
formatOptions,
|
|
18042
|
+
chartType,
|
|
18043
|
+
height,
|
|
18044
|
+
width,
|
|
18045
|
+
svg,
|
|
18046
|
+
isReportEditable
|
|
18047
|
+
);
|
|
18009
18048
|
};
|
|
18010
18049
|
const createStackData = (requiredStackChatData) => {
|
|
18011
18050
|
let legendList = requiredStackChatData.data.map((d) => d.legend);
|
|
@@ -18460,10 +18499,10 @@
|
|
|
18460
18499
|
return Math.abs(yScale(d.value) - yScale(0));
|
|
18461
18500
|
}).attr("fill", data2.properties.color).attr(
|
|
18462
18501
|
"stroke-dasharray",
|
|
18463
|
-
(d) =>
|
|
18464
|
-
).attr("stroke-width", (
|
|
18502
|
+
(d) => data2.properties.stackBorderStyle == 2 ? "5,3" : "0"
|
|
18503
|
+
).attr("stroke-width", () => `${data2.properties.stackBorderWidth}px`).attr(
|
|
18465
18504
|
"stroke",
|
|
18466
|
-
(
|
|
18505
|
+
() => data2.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderColor : "none"
|
|
18467
18506
|
).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("opacity", 0.7).attr(
|
|
18468
18507
|
"visibility",
|
|
18469
18508
|
(d) => d.value === 0 && formatOptions.xAxisLabel.hideZeroValues ? "hidden" : "visible"
|
|
@@ -18943,16 +18982,16 @@
|
|
|
18943
18982
|
return props?.color || "gray";
|
|
18944
18983
|
}).attr("stroke", (d, i, nodes) => {
|
|
18945
18984
|
const { props } = getPropsForRect(nodes, i);
|
|
18946
|
-
return props?.stackBorderStyle
|
|
18985
|
+
return props?.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
|
|
18947
18986
|
}).attr("stroke-dasharray", (d, i, nodes) => {
|
|
18948
18987
|
const { props } = getPropsForRect(nodes, i);
|
|
18949
|
-
return props?.stackBorderStyle
|
|
18988
|
+
return props?.stackBorderStyle == 2 ? "5,3" : "0";
|
|
18950
18989
|
}).attr("stroke-width", (d, i, nodes) => {
|
|
18951
18990
|
const { props } = getPropsForRect(nodes, i);
|
|
18952
18991
|
return (props?.stackBorderWidth || 0) + "px";
|
|
18953
18992
|
}).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("visibility", (d, i, nodes) => {
|
|
18954
18993
|
const { props } = getPropsForRect(nodes, i);
|
|
18955
|
-
return d.data[d.key]
|
|
18994
|
+
return d.data[d.key] == 0 && props?.hideZeroValues ? "hidden" : "visible";
|
|
18956
18995
|
}).on("mousemove", (event2, d) => {
|
|
18957
18996
|
showTooltipOnMouseMove(
|
|
18958
18997
|
[
|