pace-chart-lib 1.0.34 → 1.0.36
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 -3
- package/dist/Components/Charts/ChartsWithAxis/ChartsWithAxisTypes.types.d.ts +1 -0
- package/dist/Components/Charts/Core/Common.types.d.ts +1 -0
- package/dist/pace-chart-lib.es.js +543 -471
- package/dist/pace-chart-lib.umd.js +543 -471
- package/package.json +1 -1
|
@@ -12752,9 +12752,11 @@ const MONTH_NAMES = {
|
|
|
12752
12752
|
]
|
|
12753
12753
|
};
|
|
12754
12754
|
const getDateFromDimension = (dimension) => {
|
|
12755
|
-
const
|
|
12756
|
-
|
|
12757
|
-
const
|
|
12755
|
+
const serial = Number(dimension);
|
|
12756
|
+
if (!Number.isFinite(serial)) return null;
|
|
12757
|
+
const utcDays = Math.floor(serial - 25569);
|
|
12758
|
+
const date2 = new Date(utcDays * 86400 * 1e3);
|
|
12759
|
+
if (Number.isNaN(date2.getTime())) return null;
|
|
12758
12760
|
return {
|
|
12759
12761
|
day: date2.getUTCDate(),
|
|
12760
12762
|
month: date2.getUTCMonth(),
|
|
@@ -12813,8 +12815,9 @@ const formatDate = (day, month, year, format2) => {
|
|
|
12813
12815
|
const setDateFormats = (format2, dimensionmarks) => {
|
|
12814
12816
|
try {
|
|
12815
12817
|
return dimensionmarks.map((dim) => {
|
|
12816
|
-
const
|
|
12817
|
-
if (
|
|
12818
|
+
const date2 = getDateFromDimension(dim);
|
|
12819
|
+
if (!date2) return dim;
|
|
12820
|
+
const { day, month, year } = date2;
|
|
12818
12821
|
return formatDate(day, month, year, format2);
|
|
12819
12822
|
});
|
|
12820
12823
|
} catch (error) {
|
|
@@ -12966,9 +12969,10 @@ function getSlicedLegendForTornado(legend) {
|
|
|
12966
12969
|
return legend.slice(index2 + 3);
|
|
12967
12970
|
}
|
|
12968
12971
|
const getHoverText = (d, isAATornado) => isAATornado ? d?.legend?.split(" - ")[0] : d?.properties?.alias || d?.properties?.name || "Legend";
|
|
12969
|
-
function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor,
|
|
12972
|
+
function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, onDataLabelCoordinatesChange, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart, isAATornado) {
|
|
12970
12973
|
try {
|
|
12971
12974
|
const isTornadoChart = chartType === chartTypes.TornadoChart;
|
|
12975
|
+
let oldMap = /* @__PURE__ */ new Map();
|
|
12972
12976
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
12973
12977
|
let annotationPosition = formatOptions.annotation.annotationPosition.toString() != "4" ? formatOptions.annotation.annotationPosition : null;
|
|
12974
12978
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
@@ -12979,6 +12983,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12979
12983
|
let connector = formatOptions.annotation.connectorType;
|
|
12980
12984
|
let labelType = formatOptions.annotation.annotationVisibility;
|
|
12981
12985
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
12986
|
+
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
12982
12987
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
12983
12988
|
oldAnnotationList = conditionallyResetOldAnnotations(
|
|
12984
12989
|
oldAnnotationList,
|
|
@@ -12997,74 +13002,89 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
12997
13002
|
}
|
|
12998
13003
|
switch (labelType) {
|
|
12999
13004
|
case "2":
|
|
13000
|
-
chartData.forEach(
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13005
|
+
chartData.forEach(
|
|
13006
|
+
(d) => {
|
|
13007
|
+
if (d.data[0])
|
|
13008
|
+
labelData.push({
|
|
13009
|
+
Dimension: d.data[0].dimension,
|
|
13010
|
+
Measure: d.data[0].value,
|
|
13011
|
+
Legend: d.data[0].legend,
|
|
13012
|
+
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13013
|
+
Labelcolor: d.properties[dataLabelColor],
|
|
13014
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13015
|
+
Axis: d.properties.axis,
|
|
13016
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13017
|
+
});
|
|
13018
|
+
}
|
|
13019
|
+
);
|
|
13012
13020
|
break;
|
|
13013
13021
|
case "3":
|
|
13014
|
-
chartData.forEach(
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13022
|
+
chartData.forEach(
|
|
13023
|
+
(d) => {
|
|
13024
|
+
if (d.data[d.data.length - 1]) {
|
|
13025
|
+
labelData.push({
|
|
13026
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
13027
|
+
Measure: d.data[d.data.length - 1].value,
|
|
13028
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
13029
|
+
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13030
|
+
Labelcolor: d.properties[dataLabelColor],
|
|
13031
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13032
|
+
Axis: d.properties.axis,
|
|
13033
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13034
|
+
});
|
|
13035
|
+
}
|
|
13025
13036
|
}
|
|
13026
|
-
|
|
13037
|
+
);
|
|
13027
13038
|
break;
|
|
13028
13039
|
case "4":
|
|
13029
|
-
chartData.forEach(
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
Dimension: d.data[0].dimension,
|
|
13033
|
-
Measure: d.data[0].value,
|
|
13034
|
-
Legend: d.data[0].legend,
|
|
13035
|
-
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13036
|
-
Labelcolor: d.properties[dataLabelColor],
|
|
13037
|
-
hoverText: getHoverText(d, isAATornado),
|
|
13038
|
-
Axis: d.properties.axis
|
|
13039
|
-
});
|
|
13040
|
-
});
|
|
13041
|
-
chartData.forEach((d) => {
|
|
13042
|
-
if (d.data[d.data.length - 1])
|
|
13043
|
-
labelData.push({
|
|
13044
|
-
Dimension: d.data[d.data.length - 1].dimension,
|
|
13045
|
-
Measure: d.data[d.data.length - 1].value,
|
|
13046
|
-
Legend: d.data[d.data.length - 1].legend,
|
|
13047
|
-
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13048
|
-
Labelcolor: d.properties[dataLabelColor],
|
|
13049
|
-
hoverText: getHoverText(d, isAATornado),
|
|
13050
|
-
Axis: d.properties.axis
|
|
13051
|
-
});
|
|
13052
|
-
});
|
|
13053
|
-
break;
|
|
13054
|
-
case "1":
|
|
13055
|
-
for (let i = 0; i < chartData[0].data.length; i++) {
|
|
13056
|
-
chartData.forEach((d) => {
|
|
13057
|
-
if (d.data[i])
|
|
13040
|
+
chartData.forEach(
|
|
13041
|
+
(d) => {
|
|
13042
|
+
if (d.data[0])
|
|
13058
13043
|
labelData.push({
|
|
13059
|
-
Dimension: d.data[
|
|
13060
|
-
Measure: d.data[
|
|
13061
|
-
Legend: d.data[
|
|
13044
|
+
Dimension: d.data[0].dimension,
|
|
13045
|
+
Measure: d.data[0].value,
|
|
13046
|
+
Legend: d.data[0].legend,
|
|
13062
13047
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13063
13048
|
Labelcolor: d.properties[dataLabelColor],
|
|
13064
13049
|
hoverText: getHoverText(d, isAATornado),
|
|
13065
|
-
Axis: d.properties.axis
|
|
13050
|
+
Axis: d.properties.axis,
|
|
13051
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13066
13052
|
});
|
|
13067
|
-
}
|
|
13053
|
+
}
|
|
13054
|
+
);
|
|
13055
|
+
chartData.forEach(
|
|
13056
|
+
(d) => {
|
|
13057
|
+
if (d.data[d.data.length - 1])
|
|
13058
|
+
labelData.push({
|
|
13059
|
+
Dimension: d.data[d.data.length - 1].dimension,
|
|
13060
|
+
Measure: d.data[d.data.length - 1].value,
|
|
13061
|
+
Legend: d.data[d.data.length - 1].legend,
|
|
13062
|
+
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13063
|
+
Labelcolor: d.properties[dataLabelColor],
|
|
13064
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13065
|
+
Axis: d.properties.axis,
|
|
13066
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13067
|
+
});
|
|
13068
|
+
}
|
|
13069
|
+
);
|
|
13070
|
+
break;
|
|
13071
|
+
case "1":
|
|
13072
|
+
for (let i = 0; i < chartData[0].data.length; i++) {
|
|
13073
|
+
chartData.forEach(
|
|
13074
|
+
(d) => {
|
|
13075
|
+
if (d.data[i])
|
|
13076
|
+
labelData.push({
|
|
13077
|
+
Dimension: d.data[i].dimension,
|
|
13078
|
+
Measure: d.data[i].value,
|
|
13079
|
+
Legend: d.data[i].legend,
|
|
13080
|
+
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13081
|
+
Labelcolor: d.properties[dataLabelColor],
|
|
13082
|
+
hoverText: getHoverText(d, isAATornado),
|
|
13083
|
+
Axis: d.properties.axis,
|
|
13084
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13085
|
+
});
|
|
13086
|
+
}
|
|
13087
|
+
);
|
|
13068
13088
|
}
|
|
13069
13089
|
break;
|
|
13070
13090
|
case "5":
|
|
@@ -13084,7 +13104,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13084
13104
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13085
13105
|
Labelcolor: d.properties[dataLabelColor],
|
|
13086
13106
|
hoverText: getHoverText(d, isAATornado),
|
|
13087
|
-
Axis: d.properties.axis
|
|
13107
|
+
Axis: d.properties.axis,
|
|
13108
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13088
13109
|
});
|
|
13089
13110
|
}
|
|
13090
13111
|
break;
|
|
@@ -13100,7 +13121,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13100
13121
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13101
13122
|
Labelcolor: d.properties[dataLabelColor],
|
|
13102
13123
|
hoverText: getHoverText(d, isAATornado),
|
|
13103
|
-
Axis: d.properties.axis
|
|
13124
|
+
Axis: d.properties.axis,
|
|
13125
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13104
13126
|
});
|
|
13105
13127
|
break;
|
|
13106
13128
|
case "4":
|
|
@@ -13112,7 +13134,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13112
13134
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13113
13135
|
Labelcolor: d.properties[dataLabelColor],
|
|
13114
13136
|
hoverText: getHoverText(d, isAATornado),
|
|
13115
|
-
Axis: d.properties.axis
|
|
13137
|
+
Axis: d.properties.axis,
|
|
13138
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13116
13139
|
});
|
|
13117
13140
|
break;
|
|
13118
13141
|
case "5":
|
|
@@ -13124,7 +13147,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13124
13147
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13125
13148
|
Labelcolor: d.properties[dataLabelColor],
|
|
13126
13149
|
hoverText: getHoverText(d, isAATornado),
|
|
13127
|
-
Axis: d.properties.axis
|
|
13150
|
+
Axis: d.properties.axis,
|
|
13151
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13128
13152
|
});
|
|
13129
13153
|
if (d.data[d.data.length - 1])
|
|
13130
13154
|
labelData.push({
|
|
@@ -13134,7 +13158,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13134
13158
|
LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
|
|
13135
13159
|
Labelcolor: d.properties[dataLabelColor],
|
|
13136
13160
|
hoverText: getHoverText(d, isAATornado),
|
|
13137
|
-
Axis: d.properties.axis
|
|
13161
|
+
Axis: d.properties.axis,
|
|
13162
|
+
LegendUniqueId: d.properties.legendUniqueId
|
|
13138
13163
|
});
|
|
13139
13164
|
break;
|
|
13140
13165
|
}
|
|
@@ -13166,13 +13191,16 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13166
13191
|
currentLegend: d.Legend,
|
|
13167
13192
|
//d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
|
|
13168
13193
|
isVisible: true,
|
|
13169
|
-
hoverId: d.hoverText.replace(/\s+/g, "-")
|
|
13194
|
+
hoverId: d.hoverText.replace(/\s+/g, "-"),
|
|
13195
|
+
legendUniqueId: d.LegendUniqueId + "~$~" + d.Dimension + "~$~" + d.Measure
|
|
13170
13196
|
} : {
|
|
13171
13197
|
x: d.Dimension,
|
|
13172
13198
|
y: { measure: d.Measure, axis: d.Axis },
|
|
13173
13199
|
position: parseInt(d.LabelPosition),
|
|
13174
13200
|
currentLegend: d.Legend,
|
|
13175
|
-
isVisible: true
|
|
13201
|
+
isVisible: true,
|
|
13202
|
+
hoverId: d.hoverText.replace(/\s+/g, "-"),
|
|
13203
|
+
legendUniqueId: d.LegendUniqueId + "~$~" + d.Dimension + "~$~" + d.Measure
|
|
13176
13204
|
},
|
|
13177
13205
|
dx: 0,
|
|
13178
13206
|
dy: 0,
|
|
@@ -13186,65 +13214,71 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13186
13214
|
width: 15
|
|
13187
13215
|
},
|
|
13188
13216
|
color: d.Labelcolor,
|
|
13189
|
-
type: annotationTypeforCharts(
|
|
13190
|
-
d3Annotation2,
|
|
13191
|
-
parseFloat(annotationType)
|
|
13192
|
-
),
|
|
13217
|
+
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
13193
13218
|
height,
|
|
13194
13219
|
width
|
|
13195
13220
|
};
|
|
13196
13221
|
if (barChart) {
|
|
13197
13222
|
let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13198
|
-
(responsiveXaxisLabel(dimensionList, innerHeight2).includes(
|
|
13199
|
-
d.Dimension
|
|
13200
|
-
) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
|
|
13223
|
+
(responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
|
|
13201
13224
|
} else {
|
|
13202
|
-
responsiveXaxisLabel(dimensionList, innerWidth2).includes(
|
|
13203
|
-
d.Dimension
|
|
13204
|
-
) && !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;
|
|
13225
|
+
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;
|
|
13205
13226
|
}
|
|
13206
13227
|
});
|
|
13207
|
-
|
|
13208
|
-
|
|
13228
|
+
if (formatOptions.annotation.annotationHideZeroValues) {
|
|
13229
|
+
annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
|
|
13230
|
+
}
|
|
13231
|
+
if (oldAnnotationList.length === 0) {
|
|
13232
|
+
oldAnnotationList = annotationsList;
|
|
13233
|
+
oldMap = new Map(
|
|
13234
|
+
oldAnnotationList.map((d) => [
|
|
13235
|
+
d.data.legendUniqueId,
|
|
13236
|
+
{
|
|
13237
|
+
measure: barChart ? d.data.x.measure : d.data.y.measure,
|
|
13238
|
+
dimension: barChart ? d.data.y : d.data.x,
|
|
13239
|
+
legendUniqueId: d.data.legendUniqueId,
|
|
13240
|
+
dx: d.dx,
|
|
13241
|
+
dy: d.dy,
|
|
13242
|
+
connectorPoints: d.connector?.points || [],
|
|
13243
|
+
isVisible: d.data.isVisible ?? true,
|
|
13244
|
+
width: d.width,
|
|
13245
|
+
height: d.height
|
|
13246
|
+
}
|
|
13247
|
+
])
|
|
13248
|
+
);
|
|
13249
|
+
} else {
|
|
13250
|
+
oldMap = new Map(
|
|
13251
|
+
oldAnnotationList.map((d) => [
|
|
13252
|
+
d.legendUniqueId,
|
|
13253
|
+
d
|
|
13254
|
+
])
|
|
13255
|
+
);
|
|
13256
|
+
}
|
|
13209
13257
|
annotationsList.forEach((newAnnotation) => {
|
|
13210
|
-
|
|
13258
|
+
const legendKey = newAnnotation.data.legendUniqueId;
|
|
13211
13259
|
if (oldAnnotationList.length != 0) {
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
];
|
|
13224
|
-
}
|
|
13260
|
+
const old = oldMap.get(legendKey);
|
|
13261
|
+
if (old) {
|
|
13262
|
+
newAnnotation.dx = old.dx;
|
|
13263
|
+
newAnnotation.dy = old.dy;
|
|
13264
|
+
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13265
|
+
newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
|
|
13266
|
+
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
13267
|
+
newAnnotation.connector["points"] = [
|
|
13268
|
+
[0, 0],
|
|
13269
|
+
[0, 0]
|
|
13270
|
+
];
|
|
13225
13271
|
}
|
|
13226
|
-
}
|
|
13272
|
+
}
|
|
13227
13273
|
}
|
|
13228
13274
|
finalAnnotationList.push(newAnnotation);
|
|
13229
13275
|
});
|
|
13230
|
-
makeAnnotations.editMode(
|
|
13231
|
-
formatOptions.annotation.annotationDraggable && isReportEditable
|
|
13232
|
-
).accessors({
|
|
13276
|
+
makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
|
|
13233
13277
|
x: function(d) {
|
|
13234
13278
|
if (barChart) {
|
|
13235
13279
|
let requiredXScale = d.x.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
13236
13280
|
let axis2 = d.x.axis;
|
|
13237
|
-
return dataLabelsPositionForBarChartFamily(
|
|
13238
|
-
formatOptions,
|
|
13239
|
-
d.x.measure ? d.x.measure : 0,
|
|
13240
|
-
d.position,
|
|
13241
|
-
requiredXScale,
|
|
13242
|
-
minValue,
|
|
13243
|
-
void 0,
|
|
13244
|
-
chartType,
|
|
13245
|
-
isSensitivityChart,
|
|
13246
|
-
axis2
|
|
13247
|
-
);
|
|
13281
|
+
return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
|
|
13248
13282
|
} else if (chartType === chartTypes.ColumnChart) {
|
|
13249
13283
|
const legend = xScaleForLegends(d.currentLegend);
|
|
13250
13284
|
const x2 = legend != null ? xScale(d.x) + legend - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
|
|
@@ -13254,7 +13288,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13254
13288
|
}
|
|
13255
13289
|
},
|
|
13256
13290
|
y: function(d) {
|
|
13257
|
-
if (d.y
|
|
13291
|
+
if (d.y?.axis == axisTypes.primary) {
|
|
13258
13292
|
return dataLabelsPosition(
|
|
13259
13293
|
d.y.measure,
|
|
13260
13294
|
parseFloat(d.position),
|
|
@@ -13265,7 +13299,8 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13265
13299
|
);
|
|
13266
13300
|
} else {
|
|
13267
13301
|
if (barChart) {
|
|
13268
|
-
|
|
13302
|
+
const legendUniqueId = d.legendUniqueId.includes("~$~") ? d.legendUniqueId.split("~$~")[0] : d.legendUniqueId;
|
|
13303
|
+
return isTornadoChart ? xScaleForLegends(d.y) + xScaleForLegends.bandwidth() / 2 : xScaleForLegends ? xScale(d.y) + xScaleForLegends(legendUniqueId) - (columnWidth - xScaleForLegends.bandwidth()) / 2 - 5 : xScale(d.y) - 5;
|
|
13269
13304
|
} else
|
|
13270
13305
|
return dataLabelsPosition(
|
|
13271
13306
|
d.y.measure,
|
|
@@ -13290,17 +13325,32 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13290
13325
|
});
|
|
13291
13326
|
}
|
|
13292
13327
|
oldAnnotationList.forEach((d) => {
|
|
13293
|
-
if (d.data
|
|
13328
|
+
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13294
13329
|
d.dx = annotation2._dx * width / d.width;
|
|
13295
13330
|
d.dy = annotation2._dy * height / d.height;
|
|
13296
|
-
d.
|
|
13331
|
+
d.connectorPoints = annotation2.connector.points;
|
|
13297
13332
|
}
|
|
13298
13333
|
});
|
|
13334
|
+
if (onDataLabelCoordinatesChange) {
|
|
13335
|
+
const cleaned = oldAnnotationList.map((d) => ({
|
|
13336
|
+
legendUniqueId: d.data?.legendUniqueId || d.legendUniqueId,
|
|
13337
|
+
dx: d.dx,
|
|
13338
|
+
dy: d.dy,
|
|
13339
|
+
connectorPoints: d.connectorPoints || [],
|
|
13340
|
+
isVisible: (d.data?.isVisible || d.isVisible) ?? true,
|
|
13341
|
+
width: d.width,
|
|
13342
|
+
height: d.height
|
|
13343
|
+
}));
|
|
13344
|
+
onDataLabelCoordinatesChange(cleaned);
|
|
13345
|
+
}
|
|
13299
13346
|
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
13300
13347
|
"stroke-dasharray",
|
|
13301
13348
|
connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]
|
|
13302
13349
|
);
|
|
13303
|
-
annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style(
|
|
13350
|
+
annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style(
|
|
13351
|
+
"stroke",
|
|
13352
|
+
formatOptions.annotation.connectorColor || "#ccc"
|
|
13353
|
+
);
|
|
13304
13354
|
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
13305
13355
|
"stroke-dasharray",
|
|
13306
13356
|
connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]
|
|
@@ -13339,12 +13389,13 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
|
|
|
13339
13389
|
throw error;
|
|
13340
13390
|
}
|
|
13341
13391
|
}
|
|
13342
|
-
function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, stackColumnData, stackAreaData, labelExcludeList, individualLabelColor, columnWidth,
|
|
13392
|
+
function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, stackColumnData, stackAreaData, labelExcludeList, individualLabelColor, columnWidth, formatOptions, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, onDataLabelCoordinatesChange, xScaleForLegends, isReportEditable) {
|
|
13343
13393
|
try {
|
|
13344
13394
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
13345
13395
|
if (formatOptions.annotation.annotationVisibility) {
|
|
13346
13396
|
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
13347
13397
|
let labelData = [];
|
|
13398
|
+
let oldMap = /* @__PURE__ */ new Map();
|
|
13348
13399
|
let makeAnnotations = d3Annotation2.annotation();
|
|
13349
13400
|
let connector = formatOptions.annotation.connectorType;
|
|
13350
13401
|
let labelType = formatOptions.annotation.annotationVisibility;
|
|
@@ -13352,11 +13403,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13352
13403
|
let stackData = [];
|
|
13353
13404
|
let getChartType = [];
|
|
13354
13405
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
13355
|
-
oldAnnotationList =
|
|
13356
|
-
|
|
13357
|
-
formatOptions,
|
|
13358
|
-
chartTypes.CustomColumnChart
|
|
13359
|
-
);
|
|
13406
|
+
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
13407
|
+
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
|
|
13360
13408
|
let annotationsList = [];
|
|
13361
13409
|
let finalAnnotationList = [];
|
|
13362
13410
|
if (oldAnnotationList.length != 0) {
|
|
@@ -13380,7 +13428,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13380
13428
|
case chartTypes.ColumnChart:
|
|
13381
13429
|
case chartTypes.LineChart:
|
|
13382
13430
|
case chartTypes.AreaChart:
|
|
13383
|
-
labelData.push(d.data[0]);
|
|
13431
|
+
labelData.push({ ...d.data[0], alias: d.properties?.alias });
|
|
13384
13432
|
break;
|
|
13385
13433
|
case chartTypes.StackColumnChart:
|
|
13386
13434
|
stackColumnData.forEach((dta) => labelData.push(dta[0]));
|
|
@@ -13397,7 +13445,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13397
13445
|
case chartTypes.ColumnChart:
|
|
13398
13446
|
case chartTypes.LineChart:
|
|
13399
13447
|
case chartTypes.AreaChart:
|
|
13400
|
-
labelData.push(d.data[d.data.length - 1]);
|
|
13448
|
+
labelData.push({ ...d.data[d.data.length - 1], alias: d.properties?.alias });
|
|
13401
13449
|
break;
|
|
13402
13450
|
case chartTypes.StackColumnChart:
|
|
13403
13451
|
stackColumnData.forEach(
|
|
@@ -13418,7 +13466,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13418
13466
|
case chartTypes.ColumnChart:
|
|
13419
13467
|
case chartTypes.LineChart:
|
|
13420
13468
|
case chartTypes.AreaChart:
|
|
13421
|
-
labelData.push(d.data[0]);
|
|
13469
|
+
labelData.push({ ...d.data[0], alias: d.properties?.alias });
|
|
13422
13470
|
break;
|
|
13423
13471
|
case chartTypes.StackColumnChart:
|
|
13424
13472
|
stackColumnData.forEach((dta) => labelData.push(dta[0]));
|
|
@@ -13433,7 +13481,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13433
13481
|
case chartTypes.ColumnChart:
|
|
13434
13482
|
case chartTypes.LineChart:
|
|
13435
13483
|
case chartTypes.AreaChart:
|
|
13436
|
-
labelData.push(
|
|
13484
|
+
labelData.push(
|
|
13485
|
+
{ ...d.data[d.data.length - 1], alias: d.properties?.alias }
|
|
13486
|
+
);
|
|
13437
13487
|
break;
|
|
13438
13488
|
case chartTypes.StackColumnChart:
|
|
13439
13489
|
stackColumnData.forEach(
|
|
@@ -13454,26 +13504,18 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13454
13504
|
case chartTypes.ColumnChart:
|
|
13455
13505
|
case chartTypes.LineChart:
|
|
13456
13506
|
case chartTypes.AreaChart:
|
|
13457
|
-
d.data.forEach((j) => labelData.push(j));
|
|
13507
|
+
d.data.forEach((j) => labelData.push({ ...j, alias: d.properties?.alias }));
|
|
13458
13508
|
break;
|
|
13459
13509
|
case chartTypes.StackColumnChart:
|
|
13460
|
-
let stackColumnIndex = stackColumnData.findIndex(
|
|
13461
|
-
(id2) => id2.key === d.properties.legend
|
|
13462
|
-
);
|
|
13510
|
+
let stackColumnIndex = stackColumnData.findIndex((id2) => id2.key === d.properties.legend);
|
|
13463
13511
|
if (stackColumnIndex !== -1) {
|
|
13464
|
-
stackColumnData[stackColumnIndex].forEach(
|
|
13465
|
-
(dta) => labelData.push(dta)
|
|
13466
|
-
);
|
|
13512
|
+
stackColumnData[stackColumnIndex].forEach((dta) => labelData.push(dta));
|
|
13467
13513
|
}
|
|
13468
13514
|
break;
|
|
13469
13515
|
case chartTypes.StackAreaChart:
|
|
13470
|
-
let stackAreaIndex = stackAreaData.findIndex(
|
|
13471
|
-
(id2) => id2.key === d.properties.legend
|
|
13472
|
-
);
|
|
13516
|
+
let stackAreaIndex = stackAreaData.findIndex((id2) => id2.key === d.properties.legend);
|
|
13473
13517
|
if (stackAreaIndex !== -1) {
|
|
13474
|
-
stackAreaData[stackAreaIndex].forEach(
|
|
13475
|
-
(dta) => labelData.push(dta)
|
|
13476
|
-
);
|
|
13518
|
+
stackAreaData[stackAreaIndex].forEach((dta) => labelData.push(dta));
|
|
13477
13519
|
}
|
|
13478
13520
|
break;
|
|
13479
13521
|
}
|
|
@@ -13513,72 +13555,83 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13513
13555
|
switch (annotationVisibility) {
|
|
13514
13556
|
case "1":
|
|
13515
13557
|
for (let i = 0; i < chartData[k2].data.length; i++) {
|
|
13516
|
-
labelData.push(
|
|
13517
|
-
|
|
13518
|
-
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13522
|
-
|
|
13523
|
-
|
|
13524
|
-
|
|
13558
|
+
labelData.push(
|
|
13559
|
+
{
|
|
13560
|
+
dimension: d.data[i].dimension,
|
|
13561
|
+
value: d.data[i].value,
|
|
13562
|
+
legend: d.data[i].legend,
|
|
13563
|
+
labelPosition: d.data[i].labelPosition,
|
|
13564
|
+
labelColor: d.data[i].labelColor,
|
|
13565
|
+
axis: d.data[i].axis,
|
|
13566
|
+
type: chartTypes.LineChart,
|
|
13567
|
+
alias: d.properties?.alias
|
|
13568
|
+
}
|
|
13569
|
+
);
|
|
13525
13570
|
}
|
|
13526
13571
|
break;
|
|
13527
13572
|
case "2":
|
|
13528
13573
|
labelData;
|
|
13529
13574
|
break;
|
|
13530
13575
|
case "3":
|
|
13531
|
-
labelData.push(
|
|
13532
|
-
|
|
13533
|
-
|
|
13534
|
-
|
|
13535
|
-
|
|
13536
|
-
|
|
13537
|
-
|
|
13538
|
-
|
|
13539
|
-
|
|
13576
|
+
labelData.push(
|
|
13577
|
+
{
|
|
13578
|
+
dimension: d.data[0].dimension,
|
|
13579
|
+
value: d.data[0].value,
|
|
13580
|
+
legend: d.data[0].legend,
|
|
13581
|
+
labelPosition: d.data[0].labelPosition,
|
|
13582
|
+
labelcolor: d.data[0].labelColor,
|
|
13583
|
+
axis: d.data[0].axis,
|
|
13584
|
+
type: chartTypes.LineChart,
|
|
13585
|
+
alias: d.properties?.alias
|
|
13586
|
+
}
|
|
13587
|
+
);
|
|
13540
13588
|
break;
|
|
13541
13589
|
case "4":
|
|
13542
|
-
labelData.push(
|
|
13543
|
-
|
|
13544
|
-
|
|
13545
|
-
|
|
13546
|
-
|
|
13547
|
-
|
|
13548
|
-
|
|
13549
|
-
|
|
13550
|
-
|
|
13590
|
+
labelData.push(
|
|
13591
|
+
{
|
|
13592
|
+
dimension: d.data[d.data.length - 1].dimension,
|
|
13593
|
+
value: d.data[d.data.length - 1].value,
|
|
13594
|
+
legend: d.data[d.data.length - 1].legend,
|
|
13595
|
+
labelPosition: d.data[d.data.length - 1].labelPosition,
|
|
13596
|
+
labelcolor: d.data[d.data.length - 1].labelColor,
|
|
13597
|
+
axis: d.data[d.data.length - 1].axis,
|
|
13598
|
+
type: chartTypes.LineChart,
|
|
13599
|
+
alias: d.properties?.alias
|
|
13600
|
+
}
|
|
13601
|
+
);
|
|
13551
13602
|
break;
|
|
13552
13603
|
case "5":
|
|
13553
|
-
labelData.push(
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
13570
|
-
|
|
13604
|
+
labelData.push(
|
|
13605
|
+
{
|
|
13606
|
+
dimension: d.data[0].dimension,
|
|
13607
|
+
value: d.data[0].value,
|
|
13608
|
+
legend: d.data[0].legend,
|
|
13609
|
+
labelPosition: d.data[0].labelPosition,
|
|
13610
|
+
labelcolor: d.data[0].labelColor,
|
|
13611
|
+
axis: d.data[0].axis,
|
|
13612
|
+
type: chartTypes.LineChart,
|
|
13613
|
+
alias: d.properties?.alias
|
|
13614
|
+
}
|
|
13615
|
+
);
|
|
13616
|
+
labelData.push(
|
|
13617
|
+
{
|
|
13618
|
+
dimension: d.data[d.data.length - 1].dimension,
|
|
13619
|
+
value: d.data[d.data.length - 1].value,
|
|
13620
|
+
legend: d.data[d.data.length - 1].legend,
|
|
13621
|
+
labelPosition: d.data[d.data.length - 1].labelPosition,
|
|
13622
|
+
labelcolor: d.data[d.data.length - 1].labelColor,
|
|
13623
|
+
axis: d.data[d.data.length - 1].axis,
|
|
13624
|
+
type: chartTypes.LineChart,
|
|
13625
|
+
alias: d.properties?.alias
|
|
13626
|
+
}
|
|
13627
|
+
);
|
|
13571
13628
|
break;
|
|
13572
13629
|
}
|
|
13573
13630
|
break;
|
|
13574
13631
|
case chartTypes.StackColumnChart:
|
|
13575
|
-
const stackColumnIndex = stackColumnData.findIndex(
|
|
13576
|
-
(id2) => id2.key === d.properties.legend
|
|
13577
|
-
);
|
|
13632
|
+
const stackColumnIndex = stackColumnData.findIndex((id2) => id2.key === d.properties.legend);
|
|
13578
13633
|
stackColumnIndex !== -1 && stackColumnData[stackColumnIndex].forEach((dta, j) => {
|
|
13579
|
-
switch (String(
|
|
13580
|
-
stackColumnData[stackColumnIndex].individualAnnotationVisibility
|
|
13581
|
-
)) {
|
|
13634
|
+
switch (String(stackColumnData[stackColumnIndex].individualAnnotationVisibility)) {
|
|
13582
13635
|
case "1":
|
|
13583
13636
|
labelData.push(stackColumnData[stackColumnIndex][j]);
|
|
13584
13637
|
break;
|
|
@@ -13598,26 +13651,18 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13598
13651
|
case "5":
|
|
13599
13652
|
let label5 = stackColumnData[stackColumnIndex][0];
|
|
13600
13653
|
let label6 = stackColumnData[stackColumnIndex][stackColumnData[0].length - 1];
|
|
13601
|
-
if (!labelData.find(
|
|
13602
|
-
(data) => data.key == label5.key || data.key == label6.key
|
|
13603
|
-
)) {
|
|
13654
|
+
if (!labelData.find((data) => data.key == label5.key || data.key == label6.key)) {
|
|
13604
13655
|
labelData.push(stackColumnData[stackColumnIndex][0]);
|
|
13605
|
-
labelData.push(
|
|
13606
|
-
stackColumnData[stackColumnIndex][stackColumnData[0].length - 1]
|
|
13607
|
-
);
|
|
13656
|
+
labelData.push(stackColumnData[stackColumnIndex][stackColumnData[0].length - 1]);
|
|
13608
13657
|
break;
|
|
13609
13658
|
}
|
|
13610
13659
|
}
|
|
13611
13660
|
});
|
|
13612
13661
|
break;
|
|
13613
13662
|
case chartTypes.StackAreaChart:
|
|
13614
|
-
const stackIndex = stackAreaData.findIndex(
|
|
13615
|
-
(id2) => id2.key === d.properties.legend
|
|
13616
|
-
);
|
|
13663
|
+
const stackIndex = stackAreaData.findIndex((id2) => id2.key === d.properties.legend);
|
|
13617
13664
|
stackIndex != -1 && stackAreaData[stackIndex].forEach((dta, j) => {
|
|
13618
|
-
switch (String(
|
|
13619
|
-
stackAreaData[stackIndex].individualAnnotationVisibility
|
|
13620
|
-
)) {
|
|
13665
|
+
switch (String(stackAreaData[stackIndex].individualAnnotationVisibility)) {
|
|
13621
13666
|
case "1":
|
|
13622
13667
|
labelData.push(stackAreaData[stackIndex][j]);
|
|
13623
13668
|
break;
|
|
@@ -13637,9 +13682,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13637
13682
|
case "5":
|
|
13638
13683
|
let label5 = stackAreaData[stackIndex][0];
|
|
13639
13684
|
let label6 = stackAreaData[stackIndex][stackAreaData[0].length - 1];
|
|
13640
|
-
if (!labelData.find(
|
|
13641
|
-
(data) => data.key == label5.key || data.key == label6.key
|
|
13642
|
-
)) {
|
|
13685
|
+
if (!labelData.find((data) => data.key == label5.key || data.key == label6.key)) {
|
|
13643
13686
|
labelData.push(label5);
|
|
13644
13687
|
labelData.push(label6);
|
|
13645
13688
|
break;
|
|
@@ -13656,6 +13699,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13656
13699
|
if (maxValue < d.value) {
|
|
13657
13700
|
maxValue = d.value;
|
|
13658
13701
|
}
|
|
13702
|
+
;
|
|
13659
13703
|
});
|
|
13660
13704
|
let minValue = maxValue * 0.1;
|
|
13661
13705
|
labelData.forEach((d, i) => {
|
|
@@ -13676,24 +13720,15 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13676
13720
|
align: "middle"
|
|
13677
13721
|
},
|
|
13678
13722
|
data: {
|
|
13679
|
-
x: d.dimension && d.legend ? {
|
|
13680
|
-
dimension: d.dimension,
|
|
13681
|
-
legend: d.legend,
|
|
13682
|
-
type: d.type,
|
|
13683
|
-
axis: d.axis || d.data.axis
|
|
13684
|
-
} : {
|
|
13685
|
-
dimension: d.data.dimension,
|
|
13686
|
-
legend: d.key,
|
|
13687
|
-
type: d.data.type,
|
|
13688
|
-
stacklegend: d.data.legend,
|
|
13689
|
-
axis: d.data.axis
|
|
13690
|
-
},
|
|
13723
|
+
x: d.dimension && d.legend ? { dimension: d.dimension, legend: d.legend, type: d.type, axis: d.axis || d.data.axis } : { dimension: d.data.dimension, legend: d.key, type: d.data.type, stacklegend: d.data.legend, axis: d.data.axis },
|
|
13691
13724
|
y: d.value || d.value == 0 ? d.value : d.data.type != chartTypes.StackColumnChart ? d[1] ? d[1] : 0 : d[1] > 0 ? d[1] : d[0],
|
|
13692
13725
|
prevValue: d[0] >= 0 ? d[0] : d[1],
|
|
13693
13726
|
position: parseInt(d.labelPosition) ? parseInt(d.labelPosition) : parseInt(d.data.labelPosition),
|
|
13694
13727
|
type: d.type,
|
|
13695
13728
|
currentLegend: d.legend?.includes("~$~") ? d.legend.split("~$~")[1] : d.key?.includes("~$~") ? d.key.split("~$~")[1] : d.legend ?? d.key,
|
|
13696
|
-
isVisible: true
|
|
13729
|
+
isVisible: true,
|
|
13730
|
+
hoverId: d?.alias?.replaceAll(" ", "-"),
|
|
13731
|
+
legendUniqueId: d.legendUniqueId + "~$~" + (d.dimension ?? d.data.dimension) + "~$~" + (d.value || d.value == 0 ? d.value : d.data.type != chartTypes.StackColumnChart ? d[1] ? d[1] : 0 : d[1] > 0 ? d[1] : d[0])
|
|
13697
13732
|
},
|
|
13698
13733
|
dx: 0,
|
|
13699
13734
|
dy: 0,
|
|
@@ -13707,50 +13742,66 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13707
13742
|
width: 15
|
|
13708
13743
|
},
|
|
13709
13744
|
color: d.labelColor || d.data.labelColor,
|
|
13710
|
-
type: annotationTypeforCharts(
|
|
13711
|
-
d3Annotation2,
|
|
13712
|
-
parseFloat(annotationType)
|
|
13713
|
-
),
|
|
13745
|
+
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
13714
13746
|
height,
|
|
13715
13747
|
width
|
|
13716
13748
|
};
|
|
13717
13749
|
d["legend"] && d.dimension ? (
|
|
13718
13750
|
// ? finalLegendseries.includes(d.Legend.includes("~$~") ? d.Legend.split("~$~")[1] : d.Legend) &&
|
|
13719
13751
|
// filteredDimensionList.includes(d.Dimension) &&
|
|
13720
|
-
!labelExcludeList.includes(
|
|
13721
|
-
d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
|
|
13722
|
-
) && (d.axis == axisTypes.primary ? yScaleLeft(d.value) <= innerHeight2 && yScaleLeft(d.value) >= 0 : yScaleRight(d.value) <= innerHeight2 && yScaleRight(d.value) >= 0) ? annotationsList.push(singleAnnotation) : null
|
|
13752
|
+
!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
|
|
13723
13753
|
) : (
|
|
13724
13754
|
// finalLegendseries.includes(d["key"].includes("~$~") ? d["key"].split("~$~")[1] : d["key"]) &&
|
|
13725
13755
|
// this.filteredDimensionList.includes(d.data["Dimension"]) &&
|
|
13726
13756
|
!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
|
|
13727
13757
|
);
|
|
13728
13758
|
});
|
|
13729
|
-
|
|
13759
|
+
if (oldAnnotationList.length === 0) {
|
|
13760
|
+
oldAnnotationList = annotationsList;
|
|
13761
|
+
oldMap = new Map(
|
|
13762
|
+
oldAnnotationList.map((d) => [
|
|
13763
|
+
d.data.legendUniqueId,
|
|
13764
|
+
{
|
|
13765
|
+
measure: d.data.y,
|
|
13766
|
+
dimension: d.data.x.dimension,
|
|
13767
|
+
legendUniqueId: d.data.legendUniqueId,
|
|
13768
|
+
dx: d.dx,
|
|
13769
|
+
dy: d.dy,
|
|
13770
|
+
connectorPoints: d.connector?.points || [],
|
|
13771
|
+
isVisible: d.data.isVisible ?? true,
|
|
13772
|
+
width: d.width,
|
|
13773
|
+
height: d.height
|
|
13774
|
+
}
|
|
13775
|
+
])
|
|
13776
|
+
);
|
|
13777
|
+
} else {
|
|
13778
|
+
oldMap = new Map(
|
|
13779
|
+
oldAnnotationList.map((d) => [
|
|
13780
|
+
d.legendUniqueId,
|
|
13781
|
+
d
|
|
13782
|
+
])
|
|
13783
|
+
);
|
|
13784
|
+
}
|
|
13730
13785
|
annotationsList.forEach((newAnnotation) => {
|
|
13731
|
-
|
|
13786
|
+
const legendKey = newAnnotation.data.legendUniqueId;
|
|
13732
13787
|
if (oldAnnotationList.length != 0) {
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
];
|
|
13745
|
-
}
|
|
13788
|
+
const old = oldMap.get(legendKey);
|
|
13789
|
+
if (old) {
|
|
13790
|
+
newAnnotation.dx = old.dx;
|
|
13791
|
+
newAnnotation.dy = old.dy;
|
|
13792
|
+
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
13793
|
+
newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
|
|
13794
|
+
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
13795
|
+
newAnnotation.connector["points"] = [
|
|
13796
|
+
[0, 0],
|
|
13797
|
+
[0, 0]
|
|
13798
|
+
];
|
|
13746
13799
|
}
|
|
13747
|
-
}
|
|
13800
|
+
}
|
|
13748
13801
|
}
|
|
13749
13802
|
finalAnnotationList.push(newAnnotation);
|
|
13750
13803
|
});
|
|
13751
|
-
makeAnnotations.editMode(
|
|
13752
|
-
formatOptions.annotation.annotationDraggable && isReportEditable
|
|
13753
|
-
).accessors({
|
|
13804
|
+
makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
|
|
13754
13805
|
x: function(d) {
|
|
13755
13806
|
const chartType = d.x.type || d.type;
|
|
13756
13807
|
if (getChartType.includes(chartType)) {
|
|
@@ -13764,7 +13815,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13764
13815
|
}
|
|
13765
13816
|
} else {
|
|
13766
13817
|
if (d.x.legend) {
|
|
13767
|
-
|
|
13818
|
+
const legendUniqueId = d.legendUniqueId.includes("~$~") ? d.legendUniqueId.split("~$~")[0] : d.legendUniqueId;
|
|
13819
|
+
return xScale(d.x.dimension) + xScaleForLegends(legendUniqueId) - (columnWidth - xScaleForLegends.bandwidth()) / 2;
|
|
13768
13820
|
}
|
|
13769
13821
|
return xScale(d.x.dimension);
|
|
13770
13822
|
}
|
|
@@ -13772,23 +13824,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13772
13824
|
y: function(d) {
|
|
13773
13825
|
const chartType = d.type ?? d.x.type;
|
|
13774
13826
|
if (d.x.axis == axisTypes.primary) {
|
|
13775
|
-
return dataLabelsPosition(
|
|
13776
|
-
d.y,
|
|
13777
|
-
parseFloat(d.position),
|
|
13778
|
-
yScaleLeft,
|
|
13779
|
-
minValue,
|
|
13780
|
-
d.prevValue,
|
|
13781
|
-
chartType
|
|
13782
|
-
);
|
|
13827
|
+
return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
|
|
13783
13828
|
} else {
|
|
13784
|
-
return dataLabelsPosition(
|
|
13785
|
-
d.y,
|
|
13786
|
-
parseFloat(d.position),
|
|
13787
|
-
yScaleRight,
|
|
13788
|
-
minValue,
|
|
13789
|
-
d.prevValue,
|
|
13790
|
-
chartType
|
|
13791
|
-
);
|
|
13829
|
+
return dataLabelsPosition(d.y, parseFloat(d.position), yScaleRight, minValue, d.prevValue, chartType);
|
|
13792
13830
|
}
|
|
13793
13831
|
}
|
|
13794
13832
|
}).on("dragend", function(annotation2) {
|
|
@@ -13796,38 +13834,41 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13796
13834
|
annotation2.data.isVisible = true;
|
|
13797
13835
|
oldAnnotationList.forEach((d) => {
|
|
13798
13836
|
if (d.data.x.dimension == annotation2.data.x.dimension && d.data.x.legend == annotation2.data.x.legend && d.data.x.type == annotation2.data.x.type && d.data.prevValue == annotation2.data.prevValue) {
|
|
13799
|
-
annotations.selectAll(".annotation-note-label").filter(
|
|
13800
|
-
(d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue
|
|
13801
|
-
).attr("display", "block");
|
|
13837
|
+
annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue).attr("display", "block");
|
|
13802
13838
|
d.data.isVisible = true;
|
|
13803
13839
|
}
|
|
13804
13840
|
});
|
|
13805
13841
|
}
|
|
13842
|
+
;
|
|
13806
13843
|
oldAnnotationList.forEach((d) => {
|
|
13807
|
-
if (d.data
|
|
13844
|
+
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
13808
13845
|
d.dx = annotation2._dx * width / d.width;
|
|
13809
13846
|
d.dy = annotation2._dy * height / d.height;
|
|
13810
|
-
d.
|
|
13847
|
+
d.connectorPoints = annotation2.connector.points;
|
|
13811
13848
|
}
|
|
13812
13849
|
});
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13850
|
+
if (onDataLabelCoordinatesChange) {
|
|
13851
|
+
const cleaned = oldAnnotationList.map((d) => ({
|
|
13852
|
+
legendUniqueId: d.data?.legendUniqueId || d.legendUniqueId,
|
|
13853
|
+
dx: d.dx,
|
|
13854
|
+
dy: d.dy,
|
|
13855
|
+
connectorPoints: d.connector.points || d.connectorPoints || [],
|
|
13856
|
+
isVisible: (d.data?.isVisible || d.isVisible) ?? true,
|
|
13857
|
+
width: d.width,
|
|
13858
|
+
height: d.height
|
|
13859
|
+
}));
|
|
13860
|
+
onDataLabelCoordinatesChange(cleaned);
|
|
13861
|
+
}
|
|
13862
|
+
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]);
|
|
13817
13863
|
annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
|
|
13818
|
-
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
13819
|
-
"stroke-dasharray",
|
|
13820
|
-
connectedStyle[formatOptions.annotation.connectorStyle]
|
|
13821
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
13864
|
+
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
13822
13865
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
13823
13866
|
}).on("noteclick", function(annotation2) {
|
|
13824
13867
|
if (formatOptions.annotation.annotationDraggable && isReportEditable) {
|
|
13825
13868
|
annotation2.data.isVisible = false;
|
|
13826
13869
|
oldAnnotationList.forEach((d) => {
|
|
13827
13870
|
if (d.data.x.dimension == annotation2.data.x.dimension && d.data.x.legend == annotation2.data.x.legend && d.data.x.type == annotation2.data.x.type && d.data.prevValue == annotation2.data.prevValue) {
|
|
13828
|
-
annotations.selectAll(".annotation-note-label").filter(
|
|
13829
|
-
(d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue
|
|
13830
|
-
).attr("display", "none");
|
|
13871
|
+
annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue).attr("display", "none");
|
|
13831
13872
|
d.data.isVisible = false;
|
|
13832
13873
|
}
|
|
13833
13874
|
});
|
|
@@ -13837,17 +13878,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
|
|
|
13837
13878
|
x: (d) => xScale.invert(d.x),
|
|
13838
13879
|
y: (d) => d.x.axis == axisTypes.primary ? yScaleLeft.invert(d.y) : yScaleRight.invert(d.y)
|
|
13839
13880
|
}).notePadding(0).annotations(finalAnnotationList);
|
|
13840
|
-
if (!formatOptions.plotArea.fitChart)
|
|
13841
|
-
|
|
13842
|
-
let annotations = appendAnnotations(
|
|
13843
|
-
svg,
|
|
13844
|
-
formatOptions,
|
|
13845
|
-
margin,
|
|
13846
|
-
fontStyle,
|
|
13847
|
-
makeAnnotations,
|
|
13848
|
-
connectorType,
|
|
13849
|
-
false
|
|
13850
|
-
);
|
|
13881
|
+
if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
|
|
13882
|
+
let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
|
|
13851
13883
|
}
|
|
13852
13884
|
} catch (error) {
|
|
13853
13885
|
throw error;
|
|
@@ -14973,24 +15005,21 @@ function prepareDataForSeriesLabel(innerWidth2, yScaleLeft, formatOptions, filte
|
|
|
14973
15005
|
throw error;
|
|
14974
15006
|
}
|
|
14975
15007
|
}
|
|
14976
|
-
function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor,
|
|
15008
|
+
function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, onDataLabelCoordinatesChange, dataTableHeight, isReportEditable, barChart) {
|
|
14977
15009
|
try {
|
|
14978
|
-
let fromReportBuilder = false;
|
|
14979
15010
|
let annotationType = formatOptions.annotation.annotationType ?? "1";
|
|
14980
15011
|
if (formatOptions.annotation.annotationVisibility) {
|
|
14981
15012
|
let Disable = [annotationType == "1" ? "connector" : ""];
|
|
14982
15013
|
let labelData = [];
|
|
15014
|
+
let oldMap = /* @__PURE__ */ new Map();
|
|
14983
15015
|
let makeAnnotations = d3Annotation2.annotation();
|
|
14984
15016
|
let connector = formatOptions.annotation.connectorType;
|
|
14985
15017
|
let labelType = formatOptions.annotation.annotationVisibility;
|
|
14986
15018
|
let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
|
|
14987
15019
|
let fontStyle = formatOptions.annotation.annotationFontStyle;
|
|
14988
15020
|
let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
|
|
14989
|
-
oldAnnotationList =
|
|
14990
|
-
|
|
14991
|
-
formatOptions,
|
|
14992
|
-
chartType
|
|
14993
|
-
);
|
|
15021
|
+
let oldAnnotationList = JSON.parse(JSON.stringify(formatOptions.plotArea.dataLabelsCoordinates));
|
|
15022
|
+
oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
|
|
14994
15023
|
let annotationsList = [];
|
|
14995
15024
|
let finalAnnotationList = [];
|
|
14996
15025
|
if (oldAnnotationList.length != 0) {
|
|
@@ -15022,7 +15051,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15022
15051
|
break;
|
|
15023
15052
|
case "6":
|
|
15024
15053
|
chartData.forEach((d) => {
|
|
15025
|
-
let annotationVisibility = d[0]
|
|
15054
|
+
let annotationVisibility = d[0]?.properties?.annotation?.toString();
|
|
15026
15055
|
switch (annotationVisibility) {
|
|
15027
15056
|
case "1":
|
|
15028
15057
|
for (let i = 0; i < chartData[0].length; i++) {
|
|
@@ -15071,7 +15100,8 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15071
15100
|
position: formatOptions.annotation.annotationPosition == "4" ? d.data.labelPosition : JSON.parse(formatOptions.annotation.annotationPosition),
|
|
15072
15101
|
currentLegend: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key,
|
|
15073
15102
|
isVisible: true,
|
|
15074
|
-
hoverId: d.properties.alias ? getHoverId(d.properties.alias) : getHoverId(d.key)
|
|
15103
|
+
hoverId: d.properties.alias ? getHoverId(d.properties.alias) : getHoverId(d.key),
|
|
15104
|
+
legendUniqueId: d.properties.legendUniqueId + "~$~" + d.data.dimension + "~$~" + (d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key) + "~$~" + (d[1] > 0 ? d[1] : d[0])
|
|
15075
15105
|
} : {
|
|
15076
15106
|
x: d.data.dimension,
|
|
15077
15107
|
y: d[1] > 0 ? d[1] : d[0],
|
|
@@ -15079,7 +15109,8 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15079
15109
|
position: formatOptions.annotation.annotationPosition == "4" ? d.data.labelPosition : JSON.parse(formatOptions.annotation.annotationPosition),
|
|
15080
15110
|
currentLegend: d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key,
|
|
15081
15111
|
isVisible: true,
|
|
15082
|
-
hoverId: d.properties
|
|
15112
|
+
hoverId: d.properties?.alias ? getHoverId(d.properties.alias) : getHoverId(d.key),
|
|
15113
|
+
legendUniqueId: d.properties.legendUniqueId + "~$~" + d.data.dimension + "~$~" + (d.key.includes("~$~") ? d.key.split("~$~")[1] : d.key) + "~$~" + (d[1] > 0 ? d[1] : d[0])
|
|
15083
15114
|
},
|
|
15084
15115
|
dx: 0,
|
|
15085
15116
|
dy: 0,
|
|
@@ -15092,54 +15123,64 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15092
15123
|
height: 15,
|
|
15093
15124
|
width: 15
|
|
15094
15125
|
},
|
|
15095
|
-
color: d.properties[dataLabelColor],
|
|
15096
|
-
type: annotationTypeforCharts(
|
|
15097
|
-
d3Annotation2,
|
|
15098
|
-
parseFloat(annotationType)
|
|
15099
|
-
),
|
|
15126
|
+
color: d.properties && d.properties[dataLabelColor] ? d.properties[dataLabelColor] : d.data.labelColor,
|
|
15127
|
+
type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
|
|
15100
15128
|
height,
|
|
15101
15129
|
width
|
|
15102
15130
|
};
|
|
15103
15131
|
dimensionList.includes(d.data.dimension) && // !labelExcludeList.includes(d.key) && (d.data.total > 0 ? (yScaleLeft(d[1]) <= barChart ? innerWidth : innerHeight && yScaleLeft(d[1]) >= 0) : (yScaleLeft(d[0]) < (dataTableHeight > 0 ? barChart ? innerWidth : innerHeight - dataTableHeight : barChart ? innerWidth : innerHeight)))
|
|
15104
|
-
// ?
|
|
15132
|
+
// ?
|
|
15105
15133
|
annotationsList.push(singleAnnotation);
|
|
15106
15134
|
});
|
|
15107
|
-
|
|
15135
|
+
if (oldAnnotationList.length === 0) {
|
|
15136
|
+
oldAnnotationList = annotationsList;
|
|
15137
|
+
oldMap = new Map(
|
|
15138
|
+
oldAnnotationList.map((d) => [
|
|
15139
|
+
d.data.legendUniqueId,
|
|
15140
|
+
{
|
|
15141
|
+
measure: barChart ? d.data.x : d.data.y,
|
|
15142
|
+
dimension: barChart ? d.data.y : d.data.x,
|
|
15143
|
+
legendUniqueId: d.data.legendUniqueId,
|
|
15144
|
+
dx: d.dx,
|
|
15145
|
+
dy: d.dy,
|
|
15146
|
+
connectorPoints: d.connector?.points || [],
|
|
15147
|
+
isVisible: d.data.isVisible ?? true,
|
|
15148
|
+
width: d.width,
|
|
15149
|
+
height: d.height
|
|
15150
|
+
}
|
|
15151
|
+
])
|
|
15152
|
+
);
|
|
15153
|
+
} else {
|
|
15154
|
+
oldMap = new Map(
|
|
15155
|
+
oldAnnotationList.map((d) => [
|
|
15156
|
+
d.legendUniqueId,
|
|
15157
|
+
d
|
|
15158
|
+
])
|
|
15159
|
+
);
|
|
15160
|
+
}
|
|
15108
15161
|
annotationsList.forEach((newAnnotation) => {
|
|
15109
|
-
|
|
15162
|
+
const legendKey = newAnnotation.data.legendUniqueId;
|
|
15110
15163
|
if (oldAnnotationList.length != 0) {
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15120
|
-
|
|
15121
|
-
|
|
15122
|
-
];
|
|
15123
|
-
}
|
|
15164
|
+
const old = oldMap.get(legendKey);
|
|
15165
|
+
if (old) {
|
|
15166
|
+
newAnnotation.dx = old.dx;
|
|
15167
|
+
newAnnotation.dy = old.dy;
|
|
15168
|
+
newAnnotation.data.isVisible = old.isVisible ?? true;
|
|
15169
|
+
newAnnotation.connector.points = old.connectorPoints?.length ? old.connectorPoints : [[0, 0], [0, 0]];
|
|
15170
|
+
if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
|
|
15171
|
+
newAnnotation.connector["points"] = [
|
|
15172
|
+
[0, 0],
|
|
15173
|
+
[0, 0]
|
|
15174
|
+
];
|
|
15124
15175
|
}
|
|
15125
|
-
}
|
|
15176
|
+
}
|
|
15126
15177
|
}
|
|
15127
15178
|
finalAnnotationList.push(newAnnotation);
|
|
15128
15179
|
});
|
|
15129
|
-
makeAnnotations.editMode(
|
|
15130
|
-
formatOptions.annotation.annotationDraggable && isReportEditable
|
|
15131
|
-
).accessors({
|
|
15180
|
+
makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
|
|
15132
15181
|
x: function(d) {
|
|
15133
15182
|
if (barChart) {
|
|
15134
|
-
return dataLabelsPositionForBarChartFamily(
|
|
15135
|
-
formatOptions,
|
|
15136
|
-
d.x,
|
|
15137
|
-
parseFloat(d.position),
|
|
15138
|
-
yScaleLeft,
|
|
15139
|
-
minValue,
|
|
15140
|
-
d.prevValue,
|
|
15141
|
-
chartType
|
|
15142
|
-
);
|
|
15183
|
+
return dataLabelsPositionForBarChartFamily(formatOptions, d.x, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
|
|
15143
15184
|
} else {
|
|
15144
15185
|
return xScale(d.x) + xScale.bandwidth() / 2;
|
|
15145
15186
|
}
|
|
@@ -15148,14 +15189,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15148
15189
|
if (barChart) {
|
|
15149
15190
|
return xScale(d.y) + xScale.bandwidth() / 2;
|
|
15150
15191
|
} else {
|
|
15151
|
-
return dataLabelsPosition(
|
|
15152
|
-
d.y,
|
|
15153
|
-
parseFloat(d.position),
|
|
15154
|
-
yScaleLeft,
|
|
15155
|
-
minValue,
|
|
15156
|
-
d.prevValue,
|
|
15157
|
-
chartType
|
|
15158
|
-
);
|
|
15192
|
+
return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
|
|
15159
15193
|
}
|
|
15160
15194
|
}
|
|
15161
15195
|
}).on("dragend", function(annotation2) {
|
|
@@ -15163,32 +15197,41 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15163
15197
|
annotation2.data.isVisible = true;
|
|
15164
15198
|
oldAnnotationList.forEach((d) => {
|
|
15165
15199
|
if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
|
|
15166
|
-
annotations.selectAll(".annotation-note-label").filter(
|
|
15167
|
-
(d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y
|
|
15168
|
-
).attr("display", "block");
|
|
15200
|
+
annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y).attr("display", "block");
|
|
15169
15201
|
d.data.isVisible = true;
|
|
15170
15202
|
}
|
|
15171
15203
|
});
|
|
15172
15204
|
}
|
|
15205
|
+
;
|
|
15173
15206
|
oldAnnotationList.forEach((d) => {
|
|
15174
|
-
if (d.data
|
|
15207
|
+
if (d.data?.legendUniqueId == annotation2.data.legendUniqueId || d.legendUniqueId == annotation2.data.legendUniqueId) {
|
|
15175
15208
|
d.dx = annotation2._dx * width / d.width;
|
|
15176
15209
|
d.dy = annotation2._dy * height / d.height;
|
|
15177
|
-
d.
|
|
15210
|
+
d.connectorPoints = annotation2.connector.points;
|
|
15178
15211
|
}
|
|
15179
15212
|
});
|
|
15180
|
-
|
|
15213
|
+
if (onDataLabelCoordinatesChange) {
|
|
15214
|
+
const cleaned = oldAnnotationList.map((d) => ({
|
|
15215
|
+
legendUniqueId: d.data?.legendUniqueId || d.legendUniqueId,
|
|
15216
|
+
dx: d.dx,
|
|
15217
|
+
dy: d.dy,
|
|
15218
|
+
connectorPoints: d.connectorPoints || [],
|
|
15219
|
+
isVisible: (d.data?.isVisible || d.isVisible) ?? true,
|
|
15220
|
+
width: d.width,
|
|
15221
|
+
height: d.height
|
|
15222
|
+
}));
|
|
15223
|
+
onDataLabelCoordinatesChange(cleaned);
|
|
15224
|
+
}
|
|
15225
|
+
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]);
|
|
15181
15226
|
annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
|
|
15182
|
-
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15227
|
+
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15183
15228
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
|
|
15184
15229
|
}).on("noteclick", function(annotation2) {
|
|
15185
15230
|
if (formatOptions.annotation.annotationDraggable && isReportEditable) {
|
|
15186
15231
|
annotation2.data.isVisible = false;
|
|
15187
15232
|
oldAnnotationList.forEach((d) => {
|
|
15188
15233
|
if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
|
|
15189
|
-
annotations.selectAll(".annotation-note-label").filter(
|
|
15190
|
-
(d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y
|
|
15191
|
-
).attr("display", "none");
|
|
15234
|
+
annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y).attr("display", "none");
|
|
15192
15235
|
d.data.isVisible = false;
|
|
15193
15236
|
}
|
|
15194
15237
|
});
|
|
@@ -15199,15 +15242,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
|
|
|
15199
15242
|
y: (d) => yScaleLeft.invert(d.y)
|
|
15200
15243
|
}).notePadding(0).annotations(finalAnnotationList);
|
|
15201
15244
|
if (true) svg.selectAll(".annotation-group").remove();
|
|
15202
|
-
let annotations = appendAnnotations(
|
|
15203
|
-
svg,
|
|
15204
|
-
formatOptions,
|
|
15205
|
-
margin,
|
|
15206
|
-
fontStyle,
|
|
15207
|
-
makeAnnotations,
|
|
15208
|
-
connectorType,
|
|
15209
|
-
false
|
|
15210
|
-
);
|
|
15245
|
+
let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, barChart);
|
|
15211
15246
|
}
|
|
15212
15247
|
} catch (error) {
|
|
15213
15248
|
throw error;
|
|
@@ -15221,22 +15256,16 @@ const appendAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotation
|
|
|
15221
15256
|
).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").call(makeAnnotations);
|
|
15222
15257
|
annotations.selectAll("rect").style("visibility", "hidden");
|
|
15223
15258
|
annotations.selectAll(".annotation-subject").remove();
|
|
15224
|
-
annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
15225
|
-
|
|
15226
|
-
|
|
15227
|
-
);
|
|
15228
|
-
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
|
|
15229
|
-
annotations.selectAll(".note-line").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
|
|
15230
|
-
"stroke-dasharray",
|
|
15231
|
-
connectedStyle[formatOptions.annotation.connectorStyle]
|
|
15232
|
-
).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15259
|
+
annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]).style("visibility", (d) => (isBarChart ? parseFloat(d.data.x) == 0 : parseFloat(d.data.y) == 0) && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible");
|
|
15260
|
+
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc").style("visibility", (d) => (isBarChart ? parseFloat(d.data.x) == 0 : parseFloat(d.data.y) == 0) && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible");
|
|
15261
|
+
annotations.selectAll(".note-line").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15233
15262
|
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
15234
15263
|
annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
|
|
15235
15264
|
formatOptions.annotation.annotationType == "1" && annotations.selectAll(".annotation-note-content").attr("transform", function() {
|
|
15236
15265
|
const transform = select$2(this).attr("transform");
|
|
15237
15266
|
const translateValues = transform.match(/translate\(([^,]+),([^,]+)\)/);
|
|
15238
15267
|
if (translateValues) {
|
|
15239
|
-
const currentX = parseFloat(translateValues[1]);
|
|
15268
|
+
const currentX = isBarChart ? 0 : parseFloat(translateValues[1]);
|
|
15240
15269
|
return `translate(${currentX}, 0)`;
|
|
15241
15270
|
}
|
|
15242
15271
|
});
|
|
@@ -15693,9 +15722,9 @@ const appendTotalAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnot
|
|
|
15693
15722
|
).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").call(makeAnnotations);
|
|
15694
15723
|
annotations.selectAll("rect").style("visibility", "hidden");
|
|
15695
15724
|
annotations.selectAll(".annotation-subject").remove();
|
|
15696
|
-
annotations.selectAll(".connector").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle]);
|
|
15725
|
+
annotations.selectAll(".connector").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]);
|
|
15697
15726
|
annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.total.connectorColor || "#ccc").style("stroke", formatOptions.total.connectorColor || "#ccc");
|
|
15698
|
-
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();
|
|
15727
|
+
annotations.selectAll(".note-line").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]).filter((d) => d._dx == 0 && d._dy == 0).remove();
|
|
15699
15728
|
annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
|
|
15700
15729
|
formatOptions.total.annotationType == "1" && annotations.selectAll(".annotation-note-content").attr("transform", function() {
|
|
15701
15730
|
const transform = select$2(this).attr("transform");
|
|
@@ -15925,6 +15954,7 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
|
|
|
15925
15954
|
j["markerShape"] = [chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) && !formatOptions.plotArea.plotAreaHideLineAndMarkers ? "None" : d.properties.markerShape ? d.properties.markerShape : "Circle";
|
|
15926
15955
|
j["currentMeasure"] = d.properties.currentMeasure;
|
|
15927
15956
|
j["markerColor"] = d.properties.markerColor ? d.properties.markerColor : "Blue";
|
|
15957
|
+
j["alias"] = d.properties.alias;
|
|
15928
15958
|
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;
|
|
15929
15959
|
}
|
|
15930
15960
|
)
|
|
@@ -15970,7 +16000,7 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
|
|
|
15970
16000
|
},
|
|
15971
16001
|
{
|
|
15972
16002
|
key: "Legend",
|
|
15973
|
-
value: legendEntry.
|
|
16003
|
+
value: legendEntry.alias.includes("~$~") ? legendEntry.alias.split("~$~")[1] : legendEntry.alias
|
|
15974
16004
|
}
|
|
15975
16005
|
// {
|
|
15976
16006
|
// key: "Calculated Tooltip",
|
|
@@ -16960,7 +16990,8 @@ const ColumnChart = ({
|
|
|
16960
16990
|
isDateType,
|
|
16961
16991
|
formatOptions,
|
|
16962
16992
|
data,
|
|
16963
|
-
isReportEditable
|
|
16993
|
+
isReportEditable,
|
|
16994
|
+
onDataLabelCoordinatesChange
|
|
16964
16995
|
}) => {
|
|
16965
16996
|
const chartId = crypto.randomUUID();
|
|
16966
16997
|
let columnWidth = 0;
|
|
@@ -17199,7 +17230,7 @@ const ColumnChart = ({
|
|
|
17199
17230
|
let yMaxRight = -Infinity;
|
|
17200
17231
|
let yMinRight = Infinity;
|
|
17201
17232
|
seriesData.forEach((series) => {
|
|
17202
|
-
legendList.push(series.
|
|
17233
|
+
legendList.push(series.properties.legendUniqueId);
|
|
17203
17234
|
series.data.forEach((point2) => {
|
|
17204
17235
|
allChartData.push(point2);
|
|
17205
17236
|
if (series.properties.axis === "Secondary") {
|
|
@@ -17345,13 +17376,14 @@ const ColumnChart = ({
|
|
|
17345
17376
|
lData.data.forEach((cData) => {
|
|
17346
17377
|
cData.hideZero = lData.properties.hideZeroValues;
|
|
17347
17378
|
cData.axis = lData.properties.axis;
|
|
17379
|
+
cData.legendUniqueId = lData.properties.legendUniqueId;
|
|
17348
17380
|
});
|
|
17349
17381
|
});
|
|
17350
17382
|
filteredDimension.forEach((dim) => {
|
|
17351
17383
|
gTag.append("rect").attr("id", `dim-background-${dim}`).attr("class", "dimension-background").attr("x", xScale(dim) - xScale.step() / 2).attr("width", xScale.step()).attr("y", 0).attr("height", innerHeight2).attr("fill", "#f3f4f6").attr("visibility", "hidden").lower();
|
|
17352
17384
|
});
|
|
17353
17385
|
lineData.forEach((data2) => {
|
|
17354
|
-
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.
|
|
17386
|
+
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
|
|
17355
17387
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
17356
17388
|
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
|
|
17357
17389
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
@@ -17372,7 +17404,7 @@ const ColumnChart = ({
|
|
|
17372
17404
|
"transform",
|
|
17373
17405
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
17374
17406
|
);
|
|
17375
|
-
const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.
|
|
17407
|
+
const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
17376
17408
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
17377
17409
|
return yScale(0);
|
|
17378
17410
|
}).attr("height", 0).attr("fill", data2.properties.color).attr(
|
|
@@ -17477,8 +17509,7 @@ const ColumnChart = ({
|
|
|
17477
17509
|
//this.labelExcludeList,
|
|
17478
17510
|
[],
|
|
17479
17511
|
//this.individualLabelColor,
|
|
17480
|
-
[],
|
|
17481
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
17512
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
17482
17513
|
formatOptions,
|
|
17483
17514
|
chartType,
|
|
17484
17515
|
height,
|
|
@@ -17488,6 +17519,7 @@ const ColumnChart = ({
|
|
|
17488
17519
|
innerHeight2,
|
|
17489
17520
|
chartId,
|
|
17490
17521
|
svg,
|
|
17522
|
+
onDataLabelCoordinatesChange,
|
|
17491
17523
|
xScaleForLegends,
|
|
17492
17524
|
columnWidth,
|
|
17493
17525
|
isReportEditable
|
|
@@ -17532,7 +17564,8 @@ const CustomColumnChart = ({
|
|
|
17532
17564
|
isDateType,
|
|
17533
17565
|
formatOptions,
|
|
17534
17566
|
data,
|
|
17535
|
-
isReportEditable
|
|
17567
|
+
isReportEditable,
|
|
17568
|
+
onDataLabelCoordinatesChange
|
|
17536
17569
|
}) => {
|
|
17537
17570
|
const chartId = crypto.randomUUID();
|
|
17538
17571
|
let columnWidth = 0;
|
|
@@ -17785,7 +17818,7 @@ const CustomColumnChart = ({
|
|
|
17785
17818
|
seriesData.forEach((series, i) => {
|
|
17786
17819
|
if (![chartTypes.StackColumnChart, chartTypes.StackAreaChart].includes(series.properties.type)) {
|
|
17787
17820
|
tempChartData.push(series);
|
|
17788
|
-
series.properties.type !== chartTypes.LineChart && series.properties.type !== chartTypes.AreaChart && legendList.push(series.
|
|
17821
|
+
series.properties.type !== chartTypes.LineChart && series.properties.type !== chartTypes.AreaChart && legendList.push(series.properties.legendUniqueId);
|
|
17789
17822
|
} else {
|
|
17790
17823
|
if (chartTypes.StackColumnChart === series.properties.type) {
|
|
17791
17824
|
if (!legendList.includes(chartTypes.StackColumnChart)) {
|
|
@@ -17817,7 +17850,8 @@ const CustomColumnChart = ({
|
|
|
17817
17850
|
type: series.properties.type,
|
|
17818
17851
|
axis: series.properties.axis,
|
|
17819
17852
|
labelPosition: formatOptions?.annotation?.annotationPosition.toString() === "4" ? series.properties.dataLabelPosition.toString() : formatOptions?.annotation?.annotationPosition.toString(),
|
|
17820
|
-
labelColor: series.properties.labelColor
|
|
17853
|
+
labelColor: series.properties.labelColor,
|
|
17854
|
+
legendUniqueId: series.properties.legendUniqueId
|
|
17821
17855
|
};
|
|
17822
17856
|
if (newPoint.axis === "Secondary") {
|
|
17823
17857
|
isSecondaryAxisDrawn = true;
|
|
@@ -17892,7 +17926,8 @@ const CustomColumnChart = ({
|
|
|
17892
17926
|
axis: d.properties.axis,
|
|
17893
17927
|
type: d.properties.type,
|
|
17894
17928
|
legend: d.properties.legend,
|
|
17895
|
-
annotation: d.properties.annotation
|
|
17929
|
+
annotation: d.properties.annotation,
|
|
17930
|
+
alias: d.properties.alias
|
|
17896
17931
|
},
|
|
17897
17932
|
stackData: tempStackAreaChartDataForPrimaryAxis,
|
|
17898
17933
|
data: primaryStackAreaAxisData2
|
|
@@ -17904,7 +17939,8 @@ const CustomColumnChart = ({
|
|
|
17904
17939
|
axis: d.properties.axis,
|
|
17905
17940
|
type: d.properties.type,
|
|
17906
17941
|
legend: d.properties.legend,
|
|
17907
|
-
annotation: d.properties.annotation
|
|
17942
|
+
annotation: d.properties.annotation,
|
|
17943
|
+
alias: d.properties.alias
|
|
17908
17944
|
},
|
|
17909
17945
|
stackData: tempStackAreaChartDataForSecondaryAxis,
|
|
17910
17946
|
data: secondaryStackAreaAxisData2
|
|
@@ -17916,7 +17952,8 @@ const CustomColumnChart = ({
|
|
|
17916
17952
|
axis: d.properties.axis,
|
|
17917
17953
|
type: d.properties.type,
|
|
17918
17954
|
legend: d.properties.legend,
|
|
17919
|
-
annotation: d.properties.annotation
|
|
17955
|
+
annotation: d.properties.annotation,
|
|
17956
|
+
alias: d.properties.alias
|
|
17920
17957
|
},
|
|
17921
17958
|
stackData: tempStackColumnChartDataForPrimaryAxis,
|
|
17922
17959
|
data: primaryStackColumnAxisData2
|
|
@@ -17928,7 +17965,8 @@ const CustomColumnChart = ({
|
|
|
17928
17965
|
axis: d.properties.axis,
|
|
17929
17966
|
type: d.properties.type,
|
|
17930
17967
|
legend: d.properties.legend,
|
|
17931
|
-
annotation: d.properties.annotation
|
|
17968
|
+
annotation: d.properties.annotation,
|
|
17969
|
+
alias: d.properties.alias
|
|
17932
17970
|
},
|
|
17933
17971
|
stackData: tempStackColumnChartDataForSecondaryAxis,
|
|
17934
17972
|
data: secondaryStackColumnAxisData2
|
|
@@ -18072,9 +18110,9 @@ const CustomColumnChart = ({
|
|
|
18072
18110
|
gTag.selectAll(".parentGroup").raise();
|
|
18073
18111
|
};
|
|
18074
18112
|
const drawColumnChart = (data2) => {
|
|
18075
|
-
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.
|
|
18113
|
+
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties?.legendUniqueId);
|
|
18076
18114
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
18077
|
-
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.
|
|
18115
|
+
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legendUniqueId);
|
|
18078
18116
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
18079
18117
|
"hoverId",
|
|
18080
18118
|
(d) => (data2.properties.alias || data2.properties.name).includes("-") ? (data2.properties.alias || data2.properties.name).replace("-", "`").split("`")[1].replace(/ /g, "-") : (data2.properties.alias || data2.properties.name).replace(/ /g, "-")
|
|
@@ -18083,7 +18121,7 @@ const CustomColumnChart = ({
|
|
|
18083
18121
|
"transform",
|
|
18084
18122
|
(d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
|
|
18085
18123
|
);
|
|
18086
|
-
columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.
|
|
18124
|
+
columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legendUniqueId)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
|
|
18087
18125
|
const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
|
|
18088
18126
|
return d.value > 0 ? yScale(d.value) : yScale(0);
|
|
18089
18127
|
}).attr("height", (d) => {
|
|
@@ -18134,6 +18172,7 @@ const CustomColumnChart = ({
|
|
|
18134
18172
|
lData.data.forEach((cData) => {
|
|
18135
18173
|
cData.hideZero = lData.properties.hideZeroValues;
|
|
18136
18174
|
cData.axis = lData.properties.axis;
|
|
18175
|
+
cData.legendUniqueId = lData.properties.legendUniqueId;
|
|
18137
18176
|
});
|
|
18138
18177
|
});
|
|
18139
18178
|
const lineGenerator = line$1().x(
|
|
@@ -18143,7 +18182,7 @@ const CustomColumnChart = ({
|
|
|
18143
18182
|
).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
|
|
18144
18183
|
let lines = gTag.selectAll(".lines.parentGroup").data([1]);
|
|
18145
18184
|
lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
|
|
18146
|
-
let lineGroups = lines.selectAll(".line-group").data(lineData, (d) => d.
|
|
18185
|
+
let lineGroups = lines.selectAll(".line-group").data(lineData, (d) => d.properties.legendUniqueId);
|
|
18147
18186
|
let lineGroupsEnter = lineGroups.enter().append("g").attr("class", "line-group");
|
|
18148
18187
|
lineGroupsEnter.attr(
|
|
18149
18188
|
"hoverId",
|
|
@@ -18193,6 +18232,7 @@ const CustomColumnChart = ({
|
|
|
18193
18232
|
lData.data.forEach((cData) => {
|
|
18194
18233
|
cData.hideZero = lData.properties.hideZeroValues;
|
|
18195
18234
|
cData.axis = lData.properties.axis;
|
|
18235
|
+
cData.legendUniqueId = lData.properties.legendUniqueId;
|
|
18196
18236
|
});
|
|
18197
18237
|
});
|
|
18198
18238
|
const areaGenerator = area().x(
|
|
@@ -18215,13 +18255,13 @@ const CustomColumnChart = ({
|
|
|
18215
18255
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
|
|
18216
18256
|
let areaGroups = areas.selectAll(".area-group").data(lineData, (d) => d.legend);
|
|
18217
18257
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", "area-group");
|
|
18218
|
-
areaGroupsEnter.attr(
|
|
18258
|
+
areaGroupsEnter.append("path").attr(
|
|
18219
18259
|
"hoverId",
|
|
18220
18260
|
(d) => (d.properties.alias || d.properties.name || "Legend").replace(
|
|
18221
18261
|
/\s+/g,
|
|
18222
18262
|
"-"
|
|
18223
18263
|
)
|
|
18224
|
-
).
|
|
18264
|
+
).attr("class", "area parentGroup").attr(
|
|
18225
18265
|
"fill",
|
|
18226
18266
|
(d) => d.properties.color !== commonColors.white ? d.properties.color : "none"
|
|
18227
18267
|
).style("fill-opacity", formatOptions.plotArea.fillOpacity);
|
|
@@ -18276,6 +18316,7 @@ const CustomColumnChart = ({
|
|
|
18276
18316
|
lData.data.forEach((cData) => {
|
|
18277
18317
|
cData.hideZero = lData.properties.hideZeroValues;
|
|
18278
18318
|
cData.axis = lData.properties.axis;
|
|
18319
|
+
cData.legendUniqueId = lData.properties.legendUniqueId;
|
|
18279
18320
|
});
|
|
18280
18321
|
});
|
|
18281
18322
|
const areaGenerator = area().x(
|
|
@@ -18290,10 +18331,10 @@ const CustomColumnChart = ({
|
|
|
18290
18331
|
areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
|
|
18291
18332
|
let areaGroups = areas.selectAll(".area-group").data((d) => d);
|
|
18292
18333
|
let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
|
|
18293
|
-
areaGroupsEnter.attr(
|
|
18334
|
+
areaGroupsEnter.append("path").attr(
|
|
18294
18335
|
"hoverId",
|
|
18295
18336
|
(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, "-")
|
|
18296
|
-
).
|
|
18337
|
+
).attr("class", "area parentGroup").attr("fill", (d) => d.color !== commonColors.white ? d.color : "none");
|
|
18297
18338
|
areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d, i) => areaGenerator(d)).style("opacity", formatOptions.plotArea.fillOpacity).attr(
|
|
18298
18339
|
"stroke",
|
|
18299
18340
|
(d) => d.color !== commonColors.white ? d.color : "none"
|
|
@@ -18336,7 +18377,7 @@ const CustomColumnChart = ({
|
|
|
18336
18377
|
(d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
|
|
18337
18378
|
).merge(rects).attr(
|
|
18338
18379
|
"hoverId",
|
|
18339
|
-
(d) => d.
|
|
18380
|
+
(d) => d.alias.includes("~$~") ? d.alias.split("~$~")[1].replace(/ /g, "-") : d.alias.replace(/ /g, "-")
|
|
18340
18381
|
).attr("x", (d) => xScaleForLegends(chartTypes.StackColumnChart)).attr(
|
|
18341
18382
|
"y",
|
|
18342
18383
|
(d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
|
|
@@ -18482,8 +18523,7 @@ const CustomColumnChart = ({
|
|
|
18482
18523
|
[],
|
|
18483
18524
|
// individualLabelColor
|
|
18484
18525
|
columnWidth,
|
|
18485
|
-
[],
|
|
18486
|
-
//old annotation list
|
|
18526
|
+
// [], //old annotation list
|
|
18487
18527
|
formatOptions,
|
|
18488
18528
|
height,
|
|
18489
18529
|
width,
|
|
@@ -18492,6 +18532,7 @@ const CustomColumnChart = ({
|
|
|
18492
18532
|
innerHeight2,
|
|
18493
18533
|
chartId,
|
|
18494
18534
|
svg,
|
|
18535
|
+
onDataLabelCoordinatesChange,
|
|
18495
18536
|
xScaleForLegends,
|
|
18496
18537
|
isReportEditable
|
|
18497
18538
|
);
|
|
@@ -18523,6 +18564,8 @@ const CustomColumnChart = ({
|
|
|
18523
18564
|
stackChartData.forEach((stackData, j) => {
|
|
18524
18565
|
stackData.forEach((d) => {
|
|
18525
18566
|
d["key"] = stackData.key;
|
|
18567
|
+
d["alias"] = requiredStackChatData.data[j].properties.alias;
|
|
18568
|
+
stackData["alias"] = requiredStackChatData.data[j].properties.alias;
|
|
18526
18569
|
stackData["color"] = JSON.parse(
|
|
18527
18570
|
JSON.stringify(requiredStackChatData.data[j].properties.color)
|
|
18528
18571
|
);
|
|
@@ -18592,7 +18635,8 @@ const LayeredColumnChart = ({
|
|
|
18592
18635
|
isDateType,
|
|
18593
18636
|
formatOptions,
|
|
18594
18637
|
data,
|
|
18595
|
-
isReportEditable
|
|
18638
|
+
isReportEditable,
|
|
18639
|
+
onDataLabelCoordinatesChange
|
|
18596
18640
|
}) => {
|
|
18597
18641
|
const chartId = crypto.randomUUID();
|
|
18598
18642
|
let columnWidth = 0;
|
|
@@ -18819,7 +18863,7 @@ const LayeredColumnChart = ({
|
|
|
18819
18863
|
let yMaxRight = -Infinity;
|
|
18820
18864
|
let yMinRight = Infinity;
|
|
18821
18865
|
seriesData.forEach((series) => {
|
|
18822
|
-
legendList.push(series.
|
|
18866
|
+
legendList.push(series.properties.legendUniqueId);
|
|
18823
18867
|
series.data.forEach((point2) => {
|
|
18824
18868
|
allChartData.push(point2);
|
|
18825
18869
|
yMaxLeft = Math.max(yMaxLeft, point2.value);
|
|
@@ -18934,9 +18978,9 @@ const LayeredColumnChart = ({
|
|
|
18934
18978
|
});
|
|
18935
18979
|
});
|
|
18936
18980
|
lineData.forEach((data2, index2) => {
|
|
18937
|
-
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.
|
|
18981
|
+
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
|
|
18938
18982
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
18939
|
-
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.
|
|
18983
|
+
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
|
|
18940
18984
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
18941
18985
|
"hoverId",
|
|
18942
18986
|
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
@@ -19050,8 +19094,7 @@ const LayeredColumnChart = ({
|
|
|
19050
19094
|
//this.labelExcludeList,
|
|
19051
19095
|
[],
|
|
19052
19096
|
//this.individualLabelColor,
|
|
19053
|
-
[],
|
|
19054
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
19097
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
19055
19098
|
formatOptions,
|
|
19056
19099
|
chartType,
|
|
19057
19100
|
height,
|
|
@@ -19061,6 +19104,7 @@ const LayeredColumnChart = ({
|
|
|
19061
19104
|
innerHeight2,
|
|
19062
19105
|
chartId,
|
|
19063
19106
|
svg,
|
|
19107
|
+
onDataLabelCoordinatesChange,
|
|
19064
19108
|
void 0,
|
|
19065
19109
|
columnWidth,
|
|
19066
19110
|
isReportEditable
|
|
@@ -19114,7 +19158,8 @@ const StackColumnChart = ({
|
|
|
19114
19158
|
isDateType,
|
|
19115
19159
|
formatOptions,
|
|
19116
19160
|
data,
|
|
19117
|
-
isReportEditable
|
|
19161
|
+
isReportEditable,
|
|
19162
|
+
onDataLabelCoordinatesChange
|
|
19118
19163
|
}) => {
|
|
19119
19164
|
const chartId = crypto.randomUUID();
|
|
19120
19165
|
let columnWidth = 0;
|
|
@@ -19535,8 +19580,7 @@ const StackColumnChart = ({
|
|
|
19535
19580
|
//this.labelExcludeList,
|
|
19536
19581
|
[],
|
|
19537
19582
|
//this.individualLabelColor,
|
|
19538
|
-
[],
|
|
19539
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
19583
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
19540
19584
|
formatOptions,
|
|
19541
19585
|
chartType,
|
|
19542
19586
|
height,
|
|
@@ -19546,6 +19590,7 @@ const StackColumnChart = ({
|
|
|
19546
19590
|
innerHeight2,
|
|
19547
19591
|
chartId,
|
|
19548
19592
|
svg,
|
|
19593
|
+
onDataLabelCoordinatesChange,
|
|
19549
19594
|
dataTableHeight,
|
|
19550
19595
|
isReportEditable
|
|
19551
19596
|
);
|
|
@@ -19831,7 +19876,8 @@ const NormalizedStackColumnChart = ({
|
|
|
19831
19876
|
isDateType,
|
|
19832
19877
|
formatOptions,
|
|
19833
19878
|
data,
|
|
19834
|
-
isReportEditable
|
|
19879
|
+
isReportEditable,
|
|
19880
|
+
onDataLabelCoordinatesChange
|
|
19835
19881
|
}) => {
|
|
19836
19882
|
const chartId = crypto.randomUUID();
|
|
19837
19883
|
let columnWidth = 0;
|
|
@@ -20266,8 +20312,7 @@ const NormalizedStackColumnChart = ({
|
|
|
20266
20312
|
//this.labelExcludeList,
|
|
20267
20313
|
[],
|
|
20268
20314
|
//this.individualLabelColor,
|
|
20269
|
-
[],
|
|
20270
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
20315
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
20271
20316
|
formatOptions,
|
|
20272
20317
|
chartType,
|
|
20273
20318
|
height,
|
|
@@ -20277,6 +20322,7 @@ const NormalizedStackColumnChart = ({
|
|
|
20277
20322
|
innerHeight2,
|
|
20278
20323
|
chartId,
|
|
20279
20324
|
svg,
|
|
20325
|
+
onDataLabelCoordinatesChange,
|
|
20280
20326
|
dataTableHeight,
|
|
20281
20327
|
isReportEditable
|
|
20282
20328
|
);
|
|
@@ -21364,7 +21410,8 @@ const LineChart = ({
|
|
|
21364
21410
|
isDateType,
|
|
21365
21411
|
formatOptions,
|
|
21366
21412
|
data,
|
|
21367
|
-
isReportEditable
|
|
21413
|
+
isReportEditable,
|
|
21414
|
+
onDataLabelCoordinatesChange
|
|
21368
21415
|
}) => {
|
|
21369
21416
|
const chartId = crypto.randomUUID();
|
|
21370
21417
|
const barWidth = 0;
|
|
@@ -21624,7 +21671,7 @@ const LineChart = ({
|
|
|
21624
21671
|
chartJSON.chartData = allChartData;
|
|
21625
21672
|
chartJSON.legendList = legendList;
|
|
21626
21673
|
chartJSON.yMaxLeft = yMaxLeft;
|
|
21627
|
-
chartJSON.yMinLeft = yMinLeft
|
|
21674
|
+
chartJSON.yMinLeft = yMinLeft;
|
|
21628
21675
|
chartJSON.yMaxRight = yMaxRight;
|
|
21629
21676
|
chartJSON.yMinRight = yMinRight;
|
|
21630
21677
|
formatedDimensionList = isDateType ? setDateFormats(
|
|
@@ -21658,7 +21705,7 @@ const LineChart = ({
|
|
|
21658
21705
|
chartJSON.yMinLeft = yAxisLabelArray[0];
|
|
21659
21706
|
{
|
|
21660
21707
|
yScaleLeft = linear$1().domain([
|
|
21661
|
-
chartJSON.yMinLeft >= 0 ? customYaxisMinValue !== void 0 && !Number.isNaN(customYaxisMinValue) ? customYaxisMinValue : 0 : chartJSON.yMinLeft < 0 ? chartJSON.yMinLeft * 1.1 : chartJSON.yMinLeft * 0.9,
|
|
21708
|
+
chartJSON.yMinLeft >= 0 ? customYaxisMinValue !== void 0 && !Number.isNaN(customYaxisMinValue) ? customYaxisMinValue : chartJSON.yMinLeft * 0.9 : chartJSON.yMinLeft < 0 ? chartJSON.yMinLeft * 1.1 : chartJSON.yMinLeft * 0.9,
|
|
21662
21709
|
chartJSON.yMaxLeft <= 0 ? 0 : customYaxisMaxValue !== void 0 && !Number.isNaN(customYaxisMaxValue) ? customYaxisMaxValue : chartJSON.yMaxLeft * 1.1
|
|
21663
21710
|
]).range([
|
|
21664
21711
|
dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2,
|
|
@@ -21849,8 +21896,7 @@ const LineChart = ({
|
|
|
21849
21896
|
//this.labelExcludeList,
|
|
21850
21897
|
[],
|
|
21851
21898
|
//this.individualLabelColor,
|
|
21852
|
-
[],
|
|
21853
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
21899
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
21854
21900
|
formatOptions,
|
|
21855
21901
|
chartType,
|
|
21856
21902
|
height,
|
|
@@ -21860,6 +21906,9 @@ const LineChart = ({
|
|
|
21860
21906
|
innerHeight2,
|
|
21861
21907
|
chartId,
|
|
21862
21908
|
svg,
|
|
21909
|
+
onDataLabelCoordinatesChange,
|
|
21910
|
+
void 0,
|
|
21911
|
+
void 0,
|
|
21863
21912
|
isReportEditable
|
|
21864
21913
|
);
|
|
21865
21914
|
let newSeriesLabelArray = prepareDataForSeriesLabel(
|
|
@@ -21914,7 +21963,8 @@ const StackLineChart = ({
|
|
|
21914
21963
|
isDateType,
|
|
21915
21964
|
formatOptions,
|
|
21916
21965
|
data,
|
|
21917
|
-
isReportEditable
|
|
21966
|
+
isReportEditable,
|
|
21967
|
+
onDataLabelCoordinatesChange
|
|
21918
21968
|
}) => {
|
|
21919
21969
|
const chartId = crypto.randomUUID();
|
|
21920
21970
|
const barWidth = 0;
|
|
@@ -22384,8 +22434,7 @@ const StackLineChart = ({
|
|
|
22384
22434
|
//this.labelExcludeList,
|
|
22385
22435
|
[],
|
|
22386
22436
|
//this.individualLabelColor,
|
|
22387
|
-
[],
|
|
22388
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
22437
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
22389
22438
|
formatOptions,
|
|
22390
22439
|
chartType,
|
|
22391
22440
|
height,
|
|
@@ -22395,6 +22444,7 @@ const StackLineChart = ({
|
|
|
22395
22444
|
innerHeight2,
|
|
22396
22445
|
chartId,
|
|
22397
22446
|
svg,
|
|
22447
|
+
onDataLabelCoordinatesChange,
|
|
22398
22448
|
dataTableHeight,
|
|
22399
22449
|
isReportEditable
|
|
22400
22450
|
);
|
|
@@ -22465,6 +22515,7 @@ const StackLineChart = ({
|
|
|
22465
22515
|
d["hideZero"] = JSON.parse(
|
|
22466
22516
|
JSON.stringify(seriesData[j].properties.hideZeroValues)
|
|
22467
22517
|
);
|
|
22518
|
+
d["properties"] = seriesData[j].properties;
|
|
22468
22519
|
})
|
|
22469
22520
|
);
|
|
22470
22521
|
};
|
|
@@ -22489,7 +22540,8 @@ const NormalisedStackLineChart = ({
|
|
|
22489
22540
|
isDateType,
|
|
22490
22541
|
formatOptions,
|
|
22491
22542
|
data,
|
|
22492
|
-
isReportEditable
|
|
22543
|
+
isReportEditable,
|
|
22544
|
+
onDataLabelCoordinatesChange
|
|
22493
22545
|
}) => {
|
|
22494
22546
|
const chartId = crypto.randomUUID();
|
|
22495
22547
|
const barWidth = 0;
|
|
@@ -22910,8 +22962,7 @@ const NormalisedStackLineChart = ({
|
|
|
22910
22962
|
//this.labelExcludeList,
|
|
22911
22963
|
[],
|
|
22912
22964
|
//this.individualLabelColor,
|
|
22913
|
-
[],
|
|
22914
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
22965
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
22915
22966
|
formatOptions,
|
|
22916
22967
|
chartType,
|
|
22917
22968
|
height,
|
|
@@ -22921,6 +22972,7 @@ const NormalisedStackLineChart = ({
|
|
|
22921
22972
|
innerHeight2,
|
|
22922
22973
|
chartId,
|
|
22923
22974
|
svg,
|
|
22975
|
+
onDataLabelCoordinatesChange,
|
|
22924
22976
|
dataTableHeight,
|
|
22925
22977
|
isReportEditable
|
|
22926
22978
|
);
|
|
@@ -22986,6 +23038,7 @@ const NormalisedStackLineChart = ({
|
|
|
22986
23038
|
d["hideZero"] = JSON.parse(
|
|
22987
23039
|
JSON.stringify(seriesData[j].properties.hideZeroValues)
|
|
22988
23040
|
);
|
|
23041
|
+
d["properties"] = seriesData[j].properties;
|
|
22989
23042
|
})
|
|
22990
23043
|
);
|
|
22991
23044
|
};
|
|
@@ -23003,7 +23056,8 @@ const HorizontalBarChart = ({
|
|
|
23003
23056
|
isDateType,
|
|
23004
23057
|
formatOptions,
|
|
23005
23058
|
data,
|
|
23006
|
-
isReportEditable
|
|
23059
|
+
isReportEditable,
|
|
23060
|
+
onDataLabelCoordinatesChange
|
|
23007
23061
|
}) => {
|
|
23008
23062
|
const chartId = crypto.randomUUID();
|
|
23009
23063
|
let columnWidth = 0;
|
|
@@ -23227,7 +23281,7 @@ const HorizontalBarChart = ({
|
|
|
23227
23281
|
let yMaxRight = -Infinity;
|
|
23228
23282
|
let yMinRight = Infinity;
|
|
23229
23283
|
seriesData.forEach((series) => {
|
|
23230
|
-
legendList.push(series.
|
|
23284
|
+
legendList.push(series.properties.legendUniqueId);
|
|
23231
23285
|
series.data.forEach((point2) => {
|
|
23232
23286
|
allChartData.push(point2);
|
|
23233
23287
|
if (series.properties.axis === "Secondary") {
|
|
@@ -23356,13 +23410,14 @@ const HorizontalBarChart = ({
|
|
|
23356
23410
|
lData.data.forEach((cData) => {
|
|
23357
23411
|
cData.hideZero = lData.properties.hideZeroValues;
|
|
23358
23412
|
cData.axis = lData.properties.axis;
|
|
23413
|
+
cData.legendUniqueId = lData.properties.legendUniqueId;
|
|
23359
23414
|
});
|
|
23360
23415
|
});
|
|
23361
23416
|
filteredDimension.forEach((dim) => {
|
|
23362
23417
|
gTag.append("rect").attr("id", `dim-background-${dim}`).attr("class", "dimension-background").attr("y", yScale(dim) - columnWidth / 2).attr("height", columnWidth).attr("x", 0).attr("width", innerWidth2).attr("fill", "#E5E5E5").attr("visibility", "hidden").lower();
|
|
23363
23418
|
});
|
|
23364
23419
|
lineData.forEach((data2) => {
|
|
23365
|
-
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.
|
|
23420
|
+
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
|
|
23366
23421
|
column = column.enter().append("g").attr("class", "column parentGroup").merge(column);
|
|
23367
23422
|
let columnGroups = column.selectAll(".column-group").data(
|
|
23368
23423
|
data2.data.map((d) => ({ ...d, properties: data2.properties })),
|
|
@@ -23386,7 +23441,7 @@ const HorizontalBarChart = ({
|
|
|
23386
23441
|
"transform",
|
|
23387
23442
|
(d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
|
|
23388
23443
|
);
|
|
23389
|
-
const bars = columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegends(d.
|
|
23444
|
+
const bars = columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegends(d.legendUniqueId)).attr("height", yScaleLegends.bandwidth()).attr("x", (d) => {
|
|
23390
23445
|
const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
|
|
23391
23446
|
return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(0);
|
|
23392
23447
|
}).attr("width", 0).attr("fill", data2.properties.color).attr(
|
|
@@ -23500,8 +23555,7 @@ const HorizontalBarChart = ({
|
|
|
23500
23555
|
//this.labelExcludeList,
|
|
23501
23556
|
[],
|
|
23502
23557
|
//this.individualLabelColor,
|
|
23503
|
-
[],
|
|
23504
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
23558
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
23505
23559
|
formatOptions,
|
|
23506
23560
|
chartType,
|
|
23507
23561
|
height,
|
|
@@ -23511,10 +23565,11 @@ const HorizontalBarChart = ({
|
|
|
23511
23565
|
innerHeight2,
|
|
23512
23566
|
chartId,
|
|
23513
23567
|
svg,
|
|
23568
|
+
onDataLabelCoordinatesChange,
|
|
23514
23569
|
yScaleLegends,
|
|
23515
23570
|
columnWidth,
|
|
23516
|
-
false,
|
|
23517
23571
|
isReportEditable,
|
|
23572
|
+
false,
|
|
23518
23573
|
barChart
|
|
23519
23574
|
);
|
|
23520
23575
|
};
|
|
@@ -23532,7 +23587,8 @@ const StackHorizontalChart = ({
|
|
|
23532
23587
|
isDateType,
|
|
23533
23588
|
formatOptions,
|
|
23534
23589
|
data,
|
|
23535
|
-
isReportEditable
|
|
23590
|
+
isReportEditable,
|
|
23591
|
+
onDataLabelCoordinatesChange
|
|
23536
23592
|
}) => {
|
|
23537
23593
|
const chartId = crypto.randomUUID();
|
|
23538
23594
|
let columnWidth = 0;
|
|
@@ -23955,8 +24011,7 @@ const StackHorizontalChart = ({
|
|
|
23955
24011
|
//this.labelExcludeList,
|
|
23956
24012
|
[],
|
|
23957
24013
|
//this.individualLabelColor,
|
|
23958
|
-
[],
|
|
23959
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
24014
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
23960
24015
|
formatOptions,
|
|
23961
24016
|
chartType,
|
|
23962
24017
|
height,
|
|
@@ -23966,6 +24021,7 @@ const StackHorizontalChart = ({
|
|
|
23966
24021
|
innerHeight2,
|
|
23967
24022
|
chartId,
|
|
23968
24023
|
svg,
|
|
24024
|
+
onDataLabelCoordinatesChange,
|
|
23969
24025
|
0,
|
|
23970
24026
|
isReportEditable,
|
|
23971
24027
|
barChart
|
|
@@ -24236,7 +24292,8 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
24236
24292
|
isDateType,
|
|
24237
24293
|
formatOptions,
|
|
24238
24294
|
data,
|
|
24239
|
-
isReportEditable
|
|
24295
|
+
isReportEditable,
|
|
24296
|
+
onDataLabelCoordinatesChange
|
|
24240
24297
|
}) => {
|
|
24241
24298
|
const chartId = crypto.randomUUID();
|
|
24242
24299
|
let columnWidth = 0;
|
|
@@ -24632,8 +24689,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
24632
24689
|
//this.labelExcludeList,
|
|
24633
24690
|
[],
|
|
24634
24691
|
//this.individualLabelColor,
|
|
24635
|
-
[],
|
|
24636
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
24692
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
24637
24693
|
formatOptions,
|
|
24638
24694
|
chartType,
|
|
24639
24695
|
height,
|
|
@@ -24643,6 +24699,7 @@ const NormalizedStackHorizontalBarChart = ({
|
|
|
24643
24699
|
innerHeight2,
|
|
24644
24700
|
chartId,
|
|
24645
24701
|
svg,
|
|
24702
|
+
onDataLabelCoordinatesChange,
|
|
24646
24703
|
0,
|
|
24647
24704
|
isReportEditable,
|
|
24648
24705
|
barChart
|
|
@@ -24696,7 +24753,8 @@ const LayeredHorizontalBarChart = ({
|
|
|
24696
24753
|
isDateType,
|
|
24697
24754
|
formatOptions,
|
|
24698
24755
|
data,
|
|
24699
|
-
isReportEditable
|
|
24756
|
+
isReportEditable,
|
|
24757
|
+
onDataLabelCoordinatesChange
|
|
24700
24758
|
}) => {
|
|
24701
24759
|
const chartId = crypto.randomUUID();
|
|
24702
24760
|
let columnWidth = 0;
|
|
@@ -24893,7 +24951,7 @@ const LayeredHorizontalBarChart = ({
|
|
|
24893
24951
|
let yMaxRight = -Infinity;
|
|
24894
24952
|
let yMinRight = Infinity;
|
|
24895
24953
|
seriesData.forEach((series) => {
|
|
24896
|
-
legendList.push(series.
|
|
24954
|
+
legendList.push(series.properties.legendUniqueId);
|
|
24897
24955
|
series.data.forEach((point2) => {
|
|
24898
24956
|
allChartData.push(point2);
|
|
24899
24957
|
yMaxLeft = Math.max(yMaxLeft, point2.value);
|
|
@@ -25001,9 +25059,9 @@ const LayeredHorizontalBarChart = ({
|
|
|
25001
25059
|
});
|
|
25002
25060
|
});
|
|
25003
25061
|
lineData.forEach((data2, index2) => {
|
|
25004
|
-
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.
|
|
25062
|
+
let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.properties.legendUniqueId);
|
|
25005
25063
|
column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
|
|
25006
|
-
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.
|
|
25064
|
+
let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.properties.legendUniqueId);
|
|
25007
25065
|
let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
|
|
25008
25066
|
"hoverId",
|
|
25009
25067
|
(data2.properties.alias || data2.properties.name || "Legend").replace(
|
|
@@ -25125,8 +25183,7 @@ const LayeredHorizontalBarChart = ({
|
|
|
25125
25183
|
//this.labelExcludeList,
|
|
25126
25184
|
[],
|
|
25127
25185
|
//this.individualLabelColor,
|
|
25128
|
-
[],
|
|
25129
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
25186
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
25130
25187
|
formatOptions,
|
|
25131
25188
|
chartType,
|
|
25132
25189
|
height,
|
|
@@ -25136,6 +25193,7 @@ const LayeredHorizontalBarChart = ({
|
|
|
25136
25193
|
innerHeight2,
|
|
25137
25194
|
chartId,
|
|
25138
25195
|
svg,
|
|
25196
|
+
onDataLabelCoordinatesChange,
|
|
25139
25197
|
yScale,
|
|
25140
25198
|
columnWidth,
|
|
25141
25199
|
false,
|
|
@@ -25888,7 +25946,8 @@ const AreaChart = ({
|
|
|
25888
25946
|
isDateType,
|
|
25889
25947
|
formatOptions,
|
|
25890
25948
|
data,
|
|
25891
|
-
isReportEditable
|
|
25949
|
+
isReportEditable,
|
|
25950
|
+
onDataLabelCoordinatesChange
|
|
25892
25951
|
}) => {
|
|
25893
25952
|
const chartId = crypto.randomUUID();
|
|
25894
25953
|
const barWidth = 0;
|
|
@@ -26354,8 +26413,7 @@ const AreaChart = ({
|
|
|
26354
26413
|
//this.labelExcludeList,
|
|
26355
26414
|
[],
|
|
26356
26415
|
//this.individualLabelColor,
|
|
26357
|
-
[],
|
|
26358
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
26416
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
26359
26417
|
formatOptions,
|
|
26360
26418
|
chartType,
|
|
26361
26419
|
height,
|
|
@@ -26365,6 +26423,9 @@ const AreaChart = ({
|
|
|
26365
26423
|
innerHeight2,
|
|
26366
26424
|
chartId,
|
|
26367
26425
|
svg,
|
|
26426
|
+
onDataLabelCoordinatesChange,
|
|
26427
|
+
void 0,
|
|
26428
|
+
void 0,
|
|
26368
26429
|
isReportEditable
|
|
26369
26430
|
);
|
|
26370
26431
|
let newSeriesLabelArray = prepareDataForSeriesLabel(
|
|
@@ -26420,7 +26481,8 @@ const StackAreaChart = ({
|
|
|
26420
26481
|
isDateType,
|
|
26421
26482
|
formatOptions,
|
|
26422
26483
|
data,
|
|
26423
|
-
isReportEditable
|
|
26484
|
+
isReportEditable,
|
|
26485
|
+
onDataLabelCoordinatesChange
|
|
26424
26486
|
}) => {
|
|
26425
26487
|
const chartId = crypto.randomUUID();
|
|
26426
26488
|
const barWidth = 0;
|
|
@@ -26903,8 +26965,7 @@ const StackAreaChart = ({
|
|
|
26903
26965
|
//this.labelExcludeList,
|
|
26904
26966
|
[],
|
|
26905
26967
|
//this.individualLabelColor,
|
|
26906
|
-
[],
|
|
26907
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
26968
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
26908
26969
|
formatOptions,
|
|
26909
26970
|
chartType,
|
|
26910
26971
|
height,
|
|
@@ -26914,6 +26975,7 @@ const StackAreaChart = ({
|
|
|
26914
26975
|
innerHeight2,
|
|
26915
26976
|
chartId,
|
|
26916
26977
|
svg,
|
|
26978
|
+
onDataLabelCoordinatesChange,
|
|
26917
26979
|
dataTableHeight,
|
|
26918
26980
|
isReportEditable
|
|
26919
26981
|
);
|
|
@@ -27011,7 +27073,8 @@ const NormalizedStackAreaChart = ({
|
|
|
27011
27073
|
isDateType,
|
|
27012
27074
|
formatOptions,
|
|
27013
27075
|
data,
|
|
27014
|
-
isReportEditable
|
|
27076
|
+
isReportEditable,
|
|
27077
|
+
onDataLabelCoordinatesChange
|
|
27015
27078
|
}) => {
|
|
27016
27079
|
const chartId = crypto.randomUUID();
|
|
27017
27080
|
const barWidth = 0;
|
|
@@ -27490,8 +27553,7 @@ const NormalizedStackAreaChart = ({
|
|
|
27490
27553
|
//this.labelExcludeList,
|
|
27491
27554
|
[],
|
|
27492
27555
|
//this.individualLabelColor,
|
|
27493
|
-
[],
|
|
27494
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
27556
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
27495
27557
|
formatOptions,
|
|
27496
27558
|
chartType,
|
|
27497
27559
|
height,
|
|
@@ -27501,8 +27563,10 @@ const NormalizedStackAreaChart = ({
|
|
|
27501
27563
|
innerHeight2,
|
|
27502
27564
|
chartId,
|
|
27503
27565
|
svg,
|
|
27566
|
+
onDataLabelCoordinatesChange,
|
|
27504
27567
|
dataTableHeight,
|
|
27505
|
-
isReportEditable
|
|
27568
|
+
isReportEditable,
|
|
27569
|
+
false
|
|
27506
27570
|
);
|
|
27507
27571
|
let newSeriesLabelArray = prepareDataForSeriesLabel(
|
|
27508
27572
|
innerWidth2,
|
|
@@ -27540,6 +27604,7 @@ const NormalizedStackAreaChart = ({
|
|
|
27540
27604
|
d["hideZero"] = JSON.parse(
|
|
27541
27605
|
JSON.stringify(seriesData[j].properties.hideZeroValues)
|
|
27542
27606
|
);
|
|
27607
|
+
d["properties"] = seriesData[j].properties;
|
|
27543
27608
|
})
|
|
27544
27609
|
);
|
|
27545
27610
|
};
|
|
@@ -27643,7 +27708,7 @@ const drawTotalValue = (chartFormatOptions, totalValue, chartTitleHeight, chartA
|
|
|
27643
27708
|
chartFormatOptions.total.totalDecimalPrecision
|
|
27644
27709
|
)(totalValue);
|
|
27645
27710
|
let cords = getTotalValueCords(chartFormatOptions, chartTitleHeight, innerWidth2, innerHeight2);
|
|
27646
|
-
chartAreaTagG.append("g").attr("transform", `translate(${cords.x}, ${cords.y})`).style("user-select", "none").append("text").text(
|
|
27711
|
+
chartAreaTagG.append("g").attr("transform", `translate(${cords.x}, ${cords.y})`).style("user-select", "none").append("text").text(`${chartFormatOptions.total.editTotalText} : ${formatedTotalValue}`).style(
|
|
27647
27712
|
"fill",
|
|
27648
27713
|
chartFormatOptions.total.totalColor !== commonColors.white ? chartFormatOptions.total.totalColor : "none"
|
|
27649
27714
|
).style("font-family", chartFormatOptions.total.totalFontFamily).style("font-size", chartFormatOptions.total.totalFontSize).style("font-style", fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : "").style(
|
|
@@ -27873,7 +27938,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
27873
27938
|
).attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
27874
27939
|
const { plotArea } = chartFormatOptions;
|
|
27875
27940
|
if (plotArea.dataLabelName) {
|
|
27876
|
-
return d.data.legend;
|
|
27941
|
+
return d.data.properties?.alias || d.data.legend;
|
|
27877
27942
|
}
|
|
27878
27943
|
return "";
|
|
27879
27944
|
});
|
|
@@ -27909,7 +27974,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
27909
27974
|
(d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible"
|
|
27910
27975
|
).attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr(
|
|
27911
27976
|
"dy",
|
|
27912
|
-
chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "
|
|
27977
|
+
chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0em"
|
|
27913
27978
|
).text((d) => {
|
|
27914
27979
|
if (chartFormatOptions.plotArea.dataLabelValue) {
|
|
27915
27980
|
const dataValue = d.data.data[0].value;
|
|
@@ -27932,7 +27997,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
|
|
|
27932
27997
|
}
|
|
27933
27998
|
}).append("tspan").attr("x", 0).attr(
|
|
27934
27999
|
"y",
|
|
27935
|
-
chartFormatOptions.plotArea.dataLabelValue ? chartFormatOptions.plotArea.dataLabelName ? "2.45em" : "
|
|
28000
|
+
chartFormatOptions.plotArea.dataLabelValue ? chartFormatOptions.plotArea.dataLabelName ? "2.45em" : "1.65em" : null
|
|
27936
28001
|
).attr(
|
|
27937
28002
|
"font-weight",
|
|
27938
28003
|
(d) => d.data.properties?.valueFontStyle?.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"
|
|
@@ -28278,7 +28343,7 @@ const DonutChart = ({
|
|
|
28278
28343
|
).attr("dy", "-0.35em").attr("text-anchor", "middle").attr("alignment-baseline", "middle").text((d) => {
|
|
28279
28344
|
const { plotArea } = chartFormatOptions;
|
|
28280
28345
|
if (plotArea.dataLabelName) {
|
|
28281
|
-
return d.data.legend;
|
|
28346
|
+
return d.data?.properties?.alias || d.data.legend;
|
|
28282
28347
|
}
|
|
28283
28348
|
return "";
|
|
28284
28349
|
});
|
|
@@ -28317,7 +28382,7 @@ const DonutChart = ({
|
|
|
28317
28382
|
(d) => d.endAngle - d.startAngle < 0.17 ? "hidden" : "visible"
|
|
28318
28383
|
).attr("text-anchor", "middle").attr("alignment-baseline", "middle").attr(
|
|
28319
28384
|
"dy",
|
|
28320
|
-
chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "
|
|
28385
|
+
chartFormatOptions.plotArea.dataLabelName ? "1.00em" : "0em"
|
|
28321
28386
|
).text((d) => {
|
|
28322
28387
|
if (chartFormatOptions.plotArea.dataLabelValue) {
|
|
28323
28388
|
const dataValue = d.data.data[0].value;
|
|
@@ -28340,7 +28405,7 @@ const DonutChart = ({
|
|
|
28340
28405
|
}
|
|
28341
28406
|
}).append("tspan").attr("x", 0).attr(
|
|
28342
28407
|
"y",
|
|
28343
|
-
chartFormatOptions.plotArea.dataLabelValue ? chartFormatOptions.plotArea.dataLabelName ? "2.45em" : "
|
|
28408
|
+
chartFormatOptions.plotArea.dataLabelValue ? chartFormatOptions.plotArea.dataLabelName ? "2.45em" : "1.65em" : null
|
|
28344
28409
|
).attr(
|
|
28345
28410
|
"font-weight",
|
|
28346
28411
|
(d) => d.data.properties?.valueFontStyle?.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"
|
|
@@ -29249,7 +29314,7 @@ const PyramidChart = ({
|
|
|
29249
29314
|
const bottomWidth = pyramidSide * (inversionConstant - stackHeightArray[i + 1] / pyramidHeight);
|
|
29250
29315
|
const centerX = innerWidth2 / 2;
|
|
29251
29316
|
const pyramidContainer = chartAreaTagG.append("g").attr("id", "PyramidChart").attr("class", "parentGroup");
|
|
29252
|
-
pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend).attr(
|
|
29317
|
+
pyramidContainer.append("polygon").attr("class", "segment").attr("hoverId", d.legend.replace(/\s+/g, "-")).attr(
|
|
29253
29318
|
"points",
|
|
29254
29319
|
`
|
|
29255
29320
|
${centerX - topWidth / 2},${yTop}
|
|
@@ -29317,7 +29382,7 @@ const PyramidChart = ({
|
|
|
29317
29382
|
}
|
|
29318
29383
|
}).on("dragend", function(annotation2) {
|
|
29319
29384
|
try {
|
|
29320
|
-
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend).style(
|
|
29385
|
+
annotations.selectAll(".connector").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style(
|
|
29321
29386
|
"stroke",
|
|
29322
29387
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
29323
29388
|
).attr(
|
|
@@ -29331,7 +29396,7 @@ const PyramidChart = ({
|
|
|
29331
29396
|
"stroke",
|
|
29332
29397
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
29333
29398
|
);
|
|
29334
|
-
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style(
|
|
29399
|
+
annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend.replace(/\s+/g, "-")).style(
|
|
29335
29400
|
"stroke",
|
|
29336
29401
|
chartFormatOptions.annotation.connectorColor || "#ccc"
|
|
29337
29402
|
).attr(
|
|
@@ -29382,7 +29447,7 @@ const PyramidChart = ({
|
|
|
29382
29447
|
annotations.selectAll(".annotation-note-title").attr("text-anchor", "middle");
|
|
29383
29448
|
annotations.selectAll(".annotation-note-content").attr("transform", `translate(0,-28)`);
|
|
29384
29449
|
!chartFormatOptions.plotArea.dataLabelName && annotations.selectAll("tspan").attr("dy", "0");
|
|
29385
|
-
chartFormatOptions.plotArea.dataLabelName && annotations.selectAll(".annotation-note-title").attr("hoverId", (d) => d.data.legend).style("font-size", (d) => d.data.labelFontSize).attr("font-family", (d) => d.data.labelFontFamily).style(
|
|
29450
|
+
chartFormatOptions.plotArea.dataLabelName && annotations.selectAll(".annotation-note-title").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style("font-size", (d) => d.data.labelFontSize).attr("font-family", (d) => d.data.labelFontFamily).style(
|
|
29386
29451
|
"font-style",
|
|
29387
29452
|
(d) => d.data.labelFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
29388
29453
|
).style(
|
|
@@ -29392,7 +29457,7 @@ const PyramidChart = ({
|
|
|
29392
29457
|
"font-weight",
|
|
29393
29458
|
(d) => d.data.labelFontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : "300"
|
|
29394
29459
|
).style("fill", (d) => d.data.labelFontColor);
|
|
29395
|
-
chartFormatOptions.plotArea.dataLabelValue && annotations.selectAll(".annotation-note-label").attr("hoverId", (d) => d.data.legend).style("font-size", (d) => d.data.valueFontSize).attr("font-family", (d) => d.data.valueFontFamily).style(
|
|
29460
|
+
chartFormatOptions.plotArea.dataLabelValue && annotations.selectAll(".annotation-note-label").attr("hoverId", (d) => d.data.legend.replace(/\s+/g, "-")).style("font-size", (d) => d.data.valueFontSize).attr("font-family", (d) => d.data.valueFontFamily).style(
|
|
29396
29461
|
"font-style",
|
|
29397
29462
|
(d) => d.data.valueFontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
|
|
29398
29463
|
).style(
|
|
@@ -29597,6 +29662,9 @@ const ProgressChart = ({
|
|
|
29597
29662
|
chartAreaTagG.append("path").attr("class", "secondary-circle").attr("fill", ChartData[arcIndex].properties.color).attr(
|
|
29598
29663
|
"fill-opacity",
|
|
29599
29664
|
chartFormatOptions.plotArea.opacityforProgressScale
|
|
29665
|
+
).attr(
|
|
29666
|
+
"hoverId",
|
|
29667
|
+
(d) => (ChartData[arcIndex]?.properties?.alias || ChartData[arcIndex]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
29600
29668
|
).attr("d", arc2({ endAngle: completeAngle })).on("mousemove", (d) => {
|
|
29601
29669
|
try {
|
|
29602
29670
|
showTooltipOnMouseMove(
|
|
@@ -29635,6 +29703,9 @@ const ProgressChart = ({
|
|
|
29635
29703
|
chartAreaTagG.append("path").attr("class", "progress-circle").attr("fill", ChartData[progressIndex].properties.color).attr(
|
|
29636
29704
|
"fill-opacity",
|
|
29637
29705
|
chartFormatOptions.plotArea.opacityforProgressGoal
|
|
29706
|
+
).attr(
|
|
29707
|
+
"hoverId",
|
|
29708
|
+
(d) => (ChartData[progressIndex]?.properties?.alias || ChartData[progressIndex]?.properties?.name || "Legend").replace(/\s+/g, "-")
|
|
29638
29709
|
).attr("d", arc2({ endAngle: progressAngle })).on("mousemove", (d) => {
|
|
29639
29710
|
try {
|
|
29640
29711
|
showTooltipOnMouseMove(
|
|
@@ -29643,16 +29714,16 @@ const ProgressChart = ({
|
|
|
29643
29714
|
key: ChartData[progressIndex].properties.alias,
|
|
29644
29715
|
value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
|
|
29645
29716
|
chartFormatOptions.toolTip.toolTipDisplayUnits,
|
|
29646
|
-
chartFormatOptions.toolTip.
|
|
29647
|
-
chartFormatOptions.toolTip.
|
|
29717
|
+
chartFormatOptions.toolTip.toolTipNumberFormatProgress,
|
|
29718
|
+
chartFormatOptions.toolTip.toolTipDecimalPrecision
|
|
29648
29719
|
)(maxValue)
|
|
29649
29720
|
},
|
|
29650
29721
|
{
|
|
29651
29722
|
key: ChartData[arcIndex].properties.alias,
|
|
29652
29723
|
value: chartFormatOptions.toolTip.toolTipNumberFormatProgress == ",.0%" ? "100 %" : getNumberWithFormatFunction(
|
|
29653
29724
|
chartFormatOptions.toolTip.toolTipDisplayUnits,
|
|
29654
|
-
chartFormatOptions.toolTip.
|
|
29655
|
-
chartFormatOptions.toolTip.
|
|
29725
|
+
chartFormatOptions.toolTip.toolTipNumberFormatProgress,
|
|
29726
|
+
chartFormatOptions.toolTip.toolTipDecimalPrecision
|
|
29656
29727
|
)(progressValue)
|
|
29657
29728
|
}
|
|
29658
29729
|
],
|
|
@@ -55147,7 +55218,8 @@ const TornadoChart = ({
|
|
|
55147
55218
|
isDateType,
|
|
55148
55219
|
formatOptions,
|
|
55149
55220
|
data,
|
|
55150
|
-
isReportEditable
|
|
55221
|
+
isReportEditable,
|
|
55222
|
+
onDataLabelCoordinatesChange
|
|
55151
55223
|
}) => {
|
|
55152
55224
|
const chartId = crypto.randomUUID();
|
|
55153
55225
|
let columnWidth = 0;
|
|
@@ -55425,11 +55497,11 @@ const TornadoChart = ({
|
|
|
55425
55497
|
const preProcessChartData = () => {
|
|
55426
55498
|
let processedSeriesData;
|
|
55427
55499
|
if (!isAdvanceAnalyticsChart) {
|
|
55428
|
-
const firstMeasure = seriesData[0]?.properties.currentMeasure;
|
|
55500
|
+
const firstMeasure = "0~$~" + seriesData[0]?.properties.currentMeasure;
|
|
55429
55501
|
let yMaxLeft = 0;
|
|
55430
55502
|
let yMaxRight = -Infinity;
|
|
55431
|
-
processedSeriesData = seriesData.map((series) => {
|
|
55432
|
-
const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
|
|
55503
|
+
processedSeriesData = seriesData.map((series, index2) => {
|
|
55504
|
+
const isFirstMeasure = index2 + "~$~" + series.properties.currentMeasure === firstMeasure;
|
|
55433
55505
|
const newData = series.data.map((point2) => {
|
|
55434
55506
|
const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
|
|
55435
55507
|
return {
|
|
@@ -55676,8 +55748,7 @@ const TornadoChart = ({
|
|
|
55676
55748
|
//this.labelExcludeList,
|
|
55677
55749
|
[],
|
|
55678
55750
|
//this.individualLabelColor,
|
|
55679
|
-
[],
|
|
55680
|
-
//this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
55751
|
+
// [], //this.attributes.Id ? formatOptions.plotArea.dataLabelsCoordinates : this.parentReference.objService.tempAnnotationArray
|
|
55681
55752
|
formatOptions,
|
|
55682
55753
|
chartType,
|
|
55683
55754
|
height,
|
|
@@ -55687,6 +55758,7 @@ const TornadoChart = ({
|
|
|
55687
55758
|
innerHeight2,
|
|
55688
55759
|
chartId,
|
|
55689
55760
|
svg,
|
|
55761
|
+
onDataLabelCoordinatesChange,
|
|
55690
55762
|
yScaleLeft,
|
|
55691
55763
|
columnWidth,
|
|
55692
55764
|
isReportEditable,
|