pace-chart-lib 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10718,11 +10718,24 @@ var connectedStyle = /* @__PURE__ */ ((connectedStyle2) => {
10718
10718
  return connectedStyle2;
10719
10719
  })(connectedStyle || {});
10720
10720
  var staticLineStyle = /* @__PURE__ */ ((staticLineStyle2) => {
10721
- staticLineStyle2["solid"] = "solid";
10722
- staticLineStyle2["dotted"] = "dotted";
10723
- staticLineStyle2["dashed"] = "dashed";
10721
+ staticLineStyle2["none"] = "None";
10722
+ staticLineStyle2["solid"] = "Solid";
10723
+ staticLineStyle2["dotted"] = "Dotted";
10724
+ staticLineStyle2["dashed"] = "Dashed";
10724
10725
  return staticLineStyle2;
10725
10726
  })(staticLineStyle || {});
10727
+ var strokeLineCap = /* @__PURE__ */ ((strokeLineCap2) => {
10728
+ strokeLineCap2["butt"] = "butt";
10729
+ strokeLineCap2["round"] = "round";
10730
+ strokeLineCap2["square"] = "square";
10731
+ return strokeLineCap2;
10732
+ })(strokeLineCap || {});
10733
+ var axisTypes = /* @__PURE__ */ ((axisTypes2) => {
10734
+ axisTypes2["primary"] = "Primary";
10735
+ axisTypes2["secondary"] = "Secondary";
10736
+ return axisTypes2;
10737
+ })(axisTypes || {});
10738
+ const strokeDashValues = "20,10,5,5,5,10";
10726
10739
  const ConnecterCurve = {
10727
10740
  "1": "",
10728
10741
  "2": curveLinear$1,
@@ -11470,6 +11483,10 @@ var chartTypes = /* @__PURE__ */ ((chartTypes2) => {
11470
11483
  chartTypes2["PyramidChart"] = "PyramidChart";
11471
11484
  chartTypes2["ProgressChart"] = "ProgressChart";
11472
11485
  chartTypes2["RadialBarChart"] = "RadialBarChart";
11486
+ chartTypes2["CombinationLine"] = "CombinationLine";
11487
+ chartTypes2["CombinationArea"] = "CombinationArea";
11488
+ chartTypes2["CombinationStackArea"] = "CombinationStackArea";
11489
+ chartTypes2["TornadoDefaultEntry"] = "defaultEntry";
11473
11490
  return chartTypes2;
11474
11491
  })(chartTypes || {});
11475
11492
  const connecterCurve = {
@@ -11524,7 +11541,7 @@ function calculateWidthHeightDynamically(content, fontSize, fontFamily, rotation
11524
11541
  var boundingRect = div.getBoundingClientRect();
11525
11542
  var width = boundingRect.width;
11526
11543
  var height = boundingRect.height;
11527
- if (rotationDegree) {
11544
+ if (rotationDegree != null) {
11528
11545
  div.style.transform = `rotate(${rotationDegree}deg)`;
11529
11546
  boundingRect = div.getBoundingClientRect();
11530
11547
  div.remove();
@@ -11594,8 +11611,7 @@ function computeMarginMetrics(windowWidth, windowHeight, maxNumberForPrimaryAxis
11594
11611
  "Helvetica"
11595
11612
  )[1] : 0;
11596
11613
  yTitle = yTitle > width * 0.1 ? width * 0.1 : yTitle;
11597
- let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) + 10 : getYAxisLabel(formatOptions, max$2(legendList, (d) => d?.length || 0) || 0) + 10;
11598
- yLabel += 8;
11614
+ let yLabel = formatOptions.yAxisLabel.yAxisLabelVisibility ? responsiveYaxisMargin(maxNumberForPrimaryAxis, yMaxLeft, formatOptions, false, isNormalizedChart) + 5 : getYAxisLabel(formatOptions, max$2(legendList, (d) => d?.length || 0) || 0) + 10;
11599
11615
  let secondaryYLabel = formatOptions.secondaryYAxisLabel.secondaryYAxisLabelVisibility ? responsiveYaxisMargin(
11600
11616
  maxNumberForSecondaryAxis,
11601
11617
  yMaxRight,
@@ -11662,7 +11678,7 @@ function calculateHorizontalMargins(windowWidth, windowHeight, maxNumberForPrima
11662
11678
  left2 = yAxisRelatedMargin + 5;
11663
11679
  break;
11664
11680
  case staticLegendPosition.top:
11665
- right2 = 5 + secondaryExtra;
11681
+ right2 = 15 + secondaryExtra;
11666
11682
  left2 = yAxisRelatedMargin + 5;
11667
11683
  break;
11668
11684
  case staticLegendPosition.right:
@@ -12835,61 +12851,77 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12835
12851
  switch (labelType) {
12836
12852
  case "2":
12837
12853
  chartData.forEach(
12838
- (d) => labelData.push({
12839
- Dimension: d.data[0].dimension,
12840
- Measure: d.data[0].value,
12841
- Legend: d.data[0].legend,
12842
- LabelPosition: d.properties.dataLabelPosition,
12843
- Labelcolor: d.properties.labelColor,
12844
- Axis: d.properties.axis
12845
- })
12854
+ (d) => {
12855
+ if (d.data[0])
12856
+ labelData.push({
12857
+ Dimension: d.data[0].dimension,
12858
+ Measure: d.data[0].value,
12859
+ Legend: d.data[0].legend,
12860
+ LabelPosition: d.properties.annotationPosition,
12861
+ Labelcolor: d.properties.labelColor,
12862
+ Axis: d.properties.axis
12863
+ });
12864
+ }
12846
12865
  );
12847
12866
  break;
12848
12867
  case "3":
12849
12868
  chartData.forEach(
12850
- (d) => labelData.push({
12851
- Dimension: d.data[d.data.length - 1].dimension,
12852
- Measure: d.data[d.data.length - 1].value,
12853
- Legend: d.data[d.data.length - 1].legend,
12854
- LabelPosition: d.properties.dataLabelPosition,
12855
- Labelcolor: d.properties.labelColor,
12856
- Axis: d.properties.axis
12857
- })
12869
+ (d) => {
12870
+ if (d.data[d.data.length - 1]) {
12871
+ labelData.push({
12872
+ Dimension: d.data[d.data.length - 1].dimension,
12873
+ Measure: d.data[d.data.length - 1].value,
12874
+ Legend: d.data[d.data.length - 1].legend,
12875
+ LabelPosition: d.properties.annotationPosition,
12876
+ Labelcolor: d.properties.labelColor,
12877
+ Axis: d.properties.axis
12878
+ });
12879
+ }
12880
+ }
12858
12881
  );
12859
12882
  break;
12860
12883
  case "4":
12861
12884
  chartData.forEach(
12862
- (d) => labelData.push({
12863
- Dimension: d.data[0].dimension,
12864
- Measure: d.data[0].value,
12865
- Legend: d.data[0].legend,
12866
- LabelPosition: d.properties.dataLabelPosition,
12867
- Labelcolor: d.properties.labelColor,
12868
- Axis: d.properties.axis
12869
- })
12885
+ (d) => {
12886
+ if (d.data[0])
12887
+ labelData.push({
12888
+ Dimension: d.data[0].dimension,
12889
+ Measure: d.data[0].value,
12890
+ Legend: d.data[0].legend,
12891
+ LabelPosition: d.properties.annotationPosition,
12892
+ Labelcolor: d.properties.labelColor,
12893
+ Axis: d.properties.axis
12894
+ });
12895
+ }
12870
12896
  );
12871
12897
  chartData.forEach(
12872
- (d) => labelData.push({
12873
- Dimension: d.data[d.data.length - 1].dimension,
12874
- Measure: d.data[d.data.length - 1].value,
12875
- Legend: d.data[d.data.length - 1].legend,
12876
- LabelPosition: d.properties.dataLabelPosition,
12877
- Labelcolor: d.properties.labelColor,
12878
- Axis: d.properties.axis
12879
- })
12898
+ (d) => {
12899
+ if (d.data[d.data.length - 1])
12900
+ labelData.push({
12901
+ Dimension: d.data[d.data.length - 1].dimension,
12902
+ Measure: d.data[d.data.length - 1].value,
12903
+ Legend: d.data[d.data.length - 1].legend,
12904
+ LabelPosition: d.properties.annotationPosition,
12905
+ Labelcolor: d.properties.labelColor,
12906
+ Axis: d.properties.axis
12907
+ });
12908
+ }
12880
12909
  );
12881
12910
  break;
12882
12911
  case "1":
12883
12912
  for (let i = 0; i < chartData[0].data.length; i++) {
12884
12913
  chartData.forEach(
12885
- (d) => labelData.push({
12886
- Dimension: d.data[i].dimension,
12887
- Measure: d.data[i].value,
12888
- Legend: d.data[i].legend,
12889
- LabelPosition: d.properties.dataLabelPosition,
12890
- Labelcolor: d.properties.labelColor,
12891
- Axis: d.properties.axis
12892
- })
12914
+ (d) => {
12915
+ if (d.data[i])
12916
+ labelData.push({
12917
+ Dimension: d.data[i].dimension,
12918
+ Measure: d.data[i].value,
12919
+ Legend: d.data[i].legend,
12920
+ LabelPosition: d.properties.annotationPosition,
12921
+ Labelcolor: d.properties.labelColor,
12922
+ Axis: d.properties.axis
12923
+ });
12924
+ }
12893
12925
  );
12894
12926
  }
12895
12927
  break;
@@ -12898,60 +12930,65 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12898
12930
  break;
12899
12931
  case "6":
12900
12932
  chartData.forEach((d) => {
12901
- let annotationVisibility = d.properties.individualAnnotationVisibility;
12933
+ let annotationVisibility = d.properties.annotation.toString();
12902
12934
  switch (annotationVisibility) {
12903
12935
  case "1":
12904
12936
  for (let i = 0; i < chartData[0].data.length; i++) {
12905
- labelData.push({
12906
- Dimension: d.data[i].dimension,
12907
- Measure: d.data[i].value,
12908
- Legend: d.data[i].legend,
12909
- LabelPosition: d.properties.dataLabelPosition,
12910
- Labelcolor: d.properties.labelColor,
12911
- Axis: d.properties.axis
12912
- });
12937
+ if (d.data[i])
12938
+ labelData.push({
12939
+ Dimension: d.data[i].dimension,
12940
+ Measure: d.data[i].value,
12941
+ Legend: d.data[i].legend,
12942
+ LabelPosition: d.properties.annotationPosition,
12943
+ Labelcolor: d.properties.labelColor,
12944
+ Axis: d.properties.axis
12945
+ });
12913
12946
  }
12914
12947
  break;
12915
12948
  case "2":
12916
12949
  labelData;
12917
12950
  break;
12918
12951
  case "3":
12919
- labelData.push({
12920
- Dimension: d.data[0].dimension,
12921
- Measure: d.data[0].value,
12922
- Legend: d.data[0].legend,
12923
- LabelPosition: d.properties.dataLabelPosition,
12924
- Labelcolor: d.properties.labelColor,
12925
- Axis: d.properties.axis
12926
- });
12952
+ if (d.data[0])
12953
+ labelData.push({
12954
+ Dimension: d.data[0].dimension,
12955
+ Measure: d.data[0].value,
12956
+ Legend: d.data[0].legend,
12957
+ LabelPosition: d.properties.annotationPosition,
12958
+ Labelcolor: d.properties.labelColor,
12959
+ Axis: d.properties.axis
12960
+ });
12927
12961
  break;
12928
12962
  case "4":
12929
- labelData.push({
12930
- Dimension: d.data[d.data.length - 1].dimension,
12931
- Measure: d.data[d.data.length - 1].value,
12932
- Legend: d.data[d.data.length - 1].legend,
12933
- LabelPosition: d.properties.dataLabelPosition,
12934
- Labelcolor: d.properties.labelColor,
12935
- Axis: d.properties.axis
12936
- });
12963
+ if (d.data[d.data.length - 1])
12964
+ labelData.push({
12965
+ Dimension: d.data[d.data.length - 1].dimension,
12966
+ Measure: d.data[d.data.length - 1].value,
12967
+ Legend: d.data[d.data.length - 1].legend,
12968
+ LabelPosition: d.properties.annotationPosition,
12969
+ Labelcolor: d.properties.labelColor,
12970
+ Axis: d.properties.axis
12971
+ });
12937
12972
  break;
12938
12973
  case "5":
12939
- labelData.push({
12940
- Dimension: d.data[0].dimension,
12941
- Measure: d.data[0].value,
12942
- Legend: d.data[0].legend,
12943
- LabelPosition: d.properties.dataLabelPosition,
12944
- Labelcolor: d.properties.labelColor,
12945
- Axis: d.properties.axis
12946
- });
12947
- labelData.push({
12948
- Dimension: d.data[d.data.length - 1].dimension,
12949
- Measure: d.data[d.data.length - 1].value,
12950
- Legend: d.data[d.data.length - 1].legend,
12951
- LabelPosition: d.properties.dataLabelPosition,
12952
- Labelcolor: d.properties.labelColor,
12953
- Axis: d.properties.axis
12954
- });
12974
+ if (d.data[0])
12975
+ labelData.push({
12976
+ Dimension: d.data[0].dimension,
12977
+ Measure: d.data[0].value,
12978
+ Legend: d.data[0].legend,
12979
+ LabelPosition: d.properties.annotationPosition,
12980
+ Labelcolor: d.properties.labelColor,
12981
+ Axis: d.properties.axis
12982
+ });
12983
+ if (d.data[d.data.length - 1])
12984
+ labelData.push({
12985
+ Dimension: d.data[d.data.length - 1].dimension,
12986
+ Measure: d.data[d.data.length - 1].value,
12987
+ Legend: d.data[d.data.length - 1].legend,
12988
+ LabelPosition: d.properties.annotationPosition,
12989
+ Labelcolor: d.properties.labelColor,
12990
+ Axis: d.properties.axis
12991
+ });
12955
12992
  break;
12956
12993
  }
12957
12994
  });
@@ -12979,13 +13016,14 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12979
13016
  y: d.Dimension,
12980
13017
  x: { measure: d.Measure, axis: d.Axis },
12981
13018
  position: parseInt(d.LabelPosition),
12982
- currentLegend: d.Legend.replaceAll(" ", "-"),
13019
+ currentLegend: d.Legend,
13020
+ //d.Legend.replaceAll(" ", "-"), need to check for this case by space replaced with -
12983
13021
  isVisible: true
12984
13022
  } : {
12985
13023
  x: d.Dimension,
12986
13024
  y: { measure: d.Measure, axis: d.Axis },
12987
13025
  position: parseInt(d.LabelPosition),
12988
- currentLegend: d.Legend.replaceAll(" ", "-"),
13026
+ currentLegend: d.Legend,
12989
13027
  isVisible: true
12990
13028
  },
12991
13029
  dx: 0,
@@ -13005,10 +13043,10 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13005
13043
  width
13006
13044
  };
13007
13045
  if (barChart) {
13008
- let requiredXScale = d.Axis === "Primary" ? yScaleLeft : yScaleRight;
13046
+ let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13009
13047
  responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13010
13048
  } else {
13011
- responsiveXaxisLabel(dimensionList, innerWidth2).includes(d.Dimension) && !labelExcludeList.includes(d.Legend) && (d.Axis == "Primary" ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
13049
+ 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;
13012
13050
  }
13013
13051
  });
13014
13052
  annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
@@ -13037,17 +13075,19 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13037
13075
  makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13038
13076
  x: function(d) {
13039
13077
  if (barChart) {
13040
- let requiredXScale = d.x.axis === "Primary" ? yScaleLeft : yScaleRight;
13078
+ let requiredXScale = d.x.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13041
13079
  let axis2 = d.x.axis;
13042
13080
  return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
13043
13081
  } else if (chartType === chartTypes.ColumnChart) {
13044
- return xScaleForLegends(d.currentLegend) ? xScale(d.x) + xScaleForLegends(d.currentLegend) - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
13082
+ const legend = xScaleForLegends(d.currentLegend);
13083
+ const x2 = legend != null ? xScale(d.x) + legend - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
13084
+ return x2;
13045
13085
  } else {
13046
13086
  return xScale(d.x);
13047
13087
  }
13048
13088
  },
13049
13089
  y: function(d) {
13050
- if (d.y.axis == "Primary") {
13090
+ if (d.y.axis == axisTypes.primary) {
13051
13091
  return dataLabelsPosition(
13052
13092
  d.y.measure,
13053
13093
  parseFloat(d.position),
@@ -13316,11 +13356,11 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13316
13356
  d["legend"] && d.dimension ? (
13317
13357
  // ? finalLegendseries.includes(d.Legend.includes("~$~") ? d.Legend.split("~$~")[1] : d.Legend) &&
13318
13358
  // filteredDimensionList.includes(d.Dimension) &&
13319
- !labelExcludeList.includes(d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend) && (d.Axis == "Primary" ? yScaleLeft(d.value) <= innerHeight2 && yScaleLeft(d.value) >= 0 : yScaleRight(d.value) <= innerHeight2 && yScaleRight(d.value) >= 0) ? annotationsList.push(singleAnnotation) : null
13359
+ !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
13320
13360
  ) : (
13321
13361
  // finalLegendseries.includes(d["key"].includes("~$~") ? d["key"].split("~$~")[1] : d["key"]) &&
13322
13362
  // this.filteredDimensionList.includes(d.data["Dimension"]) &&
13323
- !labelExcludeList.includes(d["key"]) && (d.data.axis == "Primary" ? yScaleLeft(d[1]) <= innerHeight2 && yScaleLeft(d[1]) >= 0 : yScaleRight(d[1]) <= innerHeight2 && yScaleRight(d[1]) >= 0) ? annotationsList.push(singleAnnotation) : null
13363
+ !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
13324
13364
  );
13325
13365
  });
13326
13366
  oldAnnotationList = oldAnnotationList.length == 0 ? annotationsList : oldAnnotationList;
@@ -13364,7 +13404,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13364
13404
  }
13365
13405
  },
13366
13406
  y: function(d) {
13367
- if (d.x.axis == "Primary") {
13407
+ if (d.x.axis == axisTypes.primary) {
13368
13408
  return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, d.type);
13369
13409
  } else {
13370
13410
  return dataLabelsPosition(d.y, parseFloat(d.position), yScaleRight, minValue, d.prevValue, d.type);
@@ -13405,7 +13445,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13405
13445
  }
13406
13446
  }).accessorsInverse({
13407
13447
  x: (d) => xScale.invert(d.x),
13408
- y: (d) => d.x.axis == "Primary" ? yScaleLeft.invert(d.y) : yScaleRight.invert(d.y)
13448
+ y: (d) => d.x.axis == axisTypes.primary ? yScaleLeft.invert(d.y) : yScaleRight.invert(d.y)
13409
13449
  }).notePadding(0).annotations(finalAnnotationList);
13410
13450
  if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
13411
13451
  let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType);
@@ -14315,7 +14355,7 @@ function prepareDataForSeriesLabel(innerWidth2, yScaleLeft, formatOptions, filte
14315
14355
  let seriesObject = {};
14316
14356
  let measureObject = seriesPosition == "Right" ? lineData.data[lineData.data.length - 1] : lineData.data[0];
14317
14357
  let yPositionMeasure = isStackedChart ? measureObject.value > 0 ? measureObject[1] : measureObject[0] : measureObject.value;
14318
- if (lineData.properties.axis == "Primary" || !yScaleRight) {
14358
+ if (lineData.properties.axis == axisTypes.primary || !yScaleRight) {
14319
14359
  seriesObject["yPosition"] = yScaleLeft(yPositionMeasure) - hwObject[1] / 2;
14320
14360
  } else if (isSecondaryAxisDrawn && yScaleRight) {
14321
14361
  seriesObject["yPosition"] = yScaleRight(yPositionMeasure) - hwObject[1] / 2;
@@ -14408,7 +14448,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14408
14448
  break;
14409
14449
  case "6":
14410
14450
  chartData.forEach((d) => {
14411
- let annotationVisibility = d.individualAnnotationVisibility;
14451
+ let annotationVisibility = d[0].properties.annotation.toString();
14412
14452
  switch (annotationVisibility) {
14413
14453
  case "1":
14414
14454
  for (let i = 0; i < chartData[0].length; i++) {
@@ -14479,7 +14519,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14479
14519
  height: 15,
14480
14520
  width: 15
14481
14521
  },
14482
- color: labelType !== "6" ? d.data.labelColor : d.properties.labelColor,
14522
+ color: d.properties.labelColor,
14483
14523
  type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
14484
14524
  height,
14485
14525
  width
@@ -14913,11 +14953,132 @@ const horizontalScrollBar = (seriesData, height, width, svg, margin, innerWidth2
14913
14953
  true
14914
14954
  );
14915
14955
  };
14956
+ function addTotalValue(totalValueMap, xScale, yScale, margin, d3Annotation2, oldAnnotationList, formatOptions, chartType, height, width, svg, isReportEditable, isBarChart) {
14957
+ try {
14958
+ if (formatOptions.total.totalVisibility) {
14959
+ const dataLabelHeight = formatOptions.annotation.annotationVisibility != "5" ? 10 : 0;
14960
+ let annotationType = formatOptions.total.annotationType ?? "1";
14961
+ let Disable = [annotationType == "1" ? "connector" : ""];
14962
+ let makeAnnotations = d3Annotation2.annotation();
14963
+ let connector = formatOptions.total.connectorType;
14964
+ let fontStyle = formatOptions.total.totalFontStyle;
14965
+ let connectorType = formatOptions.total.connectorType ? formatOptions.total.connectorType.toLowerCase() : "None";
14966
+ oldAnnotationList = [];
14967
+ let annotationsList = [];
14968
+ let totalValuesArray = Array.from(totalValueMap, ([Dimension, Measure]) => ({ Dimension, Measure }));
14969
+ if (formatOptions.total.totalHideZeroValues) {
14970
+ totalValuesArray = totalValuesArray.filter((d) => d.Measure !== 0);
14971
+ }
14972
+ totalValuesArray.forEach((d, i) => {
14973
+ let singleAnnotation = {
14974
+ note: {
14975
+ label: d.Measure >= 1e9 && formatOptions.total.totalNumberFormat === ".2s" ? Math.round(d.Measure / 1e9) + "B" : getNumberWithFormat(
14976
+ d.Measure,
14977
+ formatOptions.total.totalDisplayUnits || formatOptions.plotArea.plotAreaDisplayUnits,
14978
+ formatOptions.total.totalNumberFormat,
14979
+ formatOptions.total.totalDecimalPrecision
14980
+ )
14981
+ },
14982
+ data: {
14983
+ y: d.Measure,
14984
+ x: d.Dimension
14985
+ },
14986
+ dx: 0,
14987
+ dy: 0,
14988
+ connector: {
14989
+ end: connectorType,
14990
+ curve: connecterCurve[formatOptions.total.connectorCurve]
14991
+ },
14992
+ disable: Disable,
14993
+ subject: {
14994
+ height: 15,
14995
+ width: 15
14996
+ },
14997
+ color: formatOptions.total.totalColor,
14998
+ type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
14999
+ height,
15000
+ width
15001
+ };
15002
+ annotationsList.push(singleAnnotation);
15003
+ });
15004
+ makeAnnotations.editMode(formatOptions.total.annotationDraggable && isReportEditable).accessors({
15005
+ x: function(d) {
15006
+ return isBarChart ? yScale(d.y) + 25 : xScale(d.x);
15007
+ },
15008
+ y: function(d) {
15009
+ return isBarChart ? xScale(d.x) - 5 : yScale(d.y) - dataLabelHeight - 15;
15010
+ }
15011
+ }).on("dragend", function(annotation2) {
15012
+ annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
15013
+ "stroke-dasharray",
15014
+ connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]
15015
+ );
15016
+ annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.total.connectorColor || "#ccc").style(
15017
+ "stroke",
15018
+ formatOptions.total.connectorColor || "#ccc"
15019
+ );
15020
+ annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.total.connectorColor || "#ccc").attr(
15021
+ "stroke-dasharray",
15022
+ connectedStyle[formatOptions.total.connectorStyle.toLowerCase()]
15023
+ ).filter((d) => d._dx == 0 && d._dy == 0).remove();
15024
+ }).accessorsInverse({
15025
+ x: (d) => xScale.invert(d.x),
15026
+ y: (d) => yScale.invert(d.y)
15027
+ }).notePadding(0).annotations(annotationsList);
15028
+ let annotations = appendTotalAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType);
15029
+ }
15030
+ } catch (error) {
15031
+ throw error;
15032
+ }
15033
+ }
15034
+ const appendTotalAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotations, ConnectorType) => {
15035
+ svg.selectAll(".annotation-group").remove();
15036
+ let annotations = svg.append("g").attr("id", "annotationGroup").attr("class", "annotation-group").attr("transform", `translate(${margin.left},${margin.top})`).style("fill", formatOptions.total.totalColor).style("font-family", formatOptions.total.totalFontFamily).style("font-size", formatOptions.total.totalFontSize).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
15037
+ "text-decoration",
15038
+ fontStyle.includes("Underline") ? "Underline" : ""
15039
+ ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").call(makeAnnotations);
15040
+ annotations.selectAll("rect").style("visibility", "hidden");
15041
+ annotations.selectAll(".annotation-subject").remove();
15042
+ annotations.selectAll(".connector").style("stroke", formatOptions.total.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.total.connectorStyle]);
15043
+ annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.total.connectorColor || "#ccc").style("stroke", formatOptions.total.connectorColor || "#ccc");
15044
+ 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();
15045
+ annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
15046
+ formatOptions.total.annotationType == "1" && annotations.selectAll(".annotation-note-content").attr("transform", function() {
15047
+ const transform = select$2(this).attr("transform");
15048
+ const translateValues = transform.match(/translate\(([^,]+),([^,]+)\)/);
15049
+ if (translateValues) {
15050
+ const currentX = parseFloat(translateValues[1]);
15051
+ return `translate(${currentX}, 0)`;
15052
+ }
15053
+ });
15054
+ annotations.selectAll("text").append("text").style("fill", formatOptions.total.totalColor !== "#ffffff" ? formatOptions.total.totalColor : "none");
15055
+ return annotations;
15056
+ };
15057
+ function createTotalMeasureValueMap(data, totalValueMap, filteredDimension) {
15058
+ totalValueMap.clear();
15059
+ if (filteredDimension && filteredDimension.length > 0) {
15060
+ filteredDimension.forEach((dimension) => {
15061
+ let totalMeasureValue = 0;
15062
+ totalValueMap.set(dimension, totalMeasureValue);
15063
+ });
15064
+ }
15065
+ if (data.ChartData && data.ChartData.length > 0) {
15066
+ data.ChartData.forEach((series) => {
15067
+ series.data.forEach((dataPoint, index2) => {
15068
+ if (totalValueMap.has(dataPoint.dimension)) {
15069
+ let existingTotal = totalValueMap.get(dataPoint.dimension) || 0;
15070
+ existingTotal += dataPoint.value || 0;
15071
+ totalValueMap.set(dataPoint.dimension, existingTotal);
15072
+ }
15073
+ });
15074
+ });
15075
+ }
15076
+ }
14916
15077
  const chartProperties = {
14917
15078
  color: "defaultColor",
14918
15079
  name: "",
14919
15080
  type: "Line",
14920
- axis: "Primary",
15081
+ axis: axisTypes.primary,
14921
15082
  alias: "",
14922
15083
  fontSize: 11,
14923
15084
  fontStyle: [],
@@ -15003,9 +15164,8 @@ const fileName$b = "CommonFunctions.ts";
15003
15164
  chartTypes.Speedometer,
15004
15165
  chartTypes.RadialBarChart
15005
15166
  ];
15006
- function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, inputSeries, chartId, legendShape, chartType) {
15167
+ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, seriesData, chartId, legendShape, chartType) {
15007
15168
  try {
15008
- let seriesData = chartType !== chartTypes.TornadoChart ? [...inputSeries].reverse() : [...inputSeries];
15009
15169
  let position = formatOptions.legends.legendPosition;
15010
15170
  let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
15011
15171
  let verticalLegendAlignment = formatOptions.legends.legendAlignment;
@@ -15108,21 +15268,13 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15108
15268
  chartData.forEach(
15109
15269
  (d) => d.data.forEach(
15110
15270
  (j) => {
15111
- j["markerShape"] = type === "CombiLine" && !formatOptions.plotArea.plotAreaHideLineAndMarkers ? "None" : d.properties.markerShape ? d.properties.markerShape : "Circle";
15271
+ j["markerShape"] = [chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) && !formatOptions.plotArea.plotAreaHideLineAndMarkers ? "None" : d.properties.markerShape ? d.properties.markerShape : "Circle";
15112
15272
  j["currentMeasure"] = d.properties.currentMeasure;
15273
+ j["markerColor"] = d.properties.markerColor ? d.properties.markerColor : "Blue";
15274
+ 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;
15113
15275
  }
15114
15276
  )
15115
15277
  );
15116
- chartData.forEach(
15117
- (d) => d.data.forEach(
15118
- (j) => j["markerColor"] = d.properties.markerColor ? d.properties.markerColor : "Blue"
15119
- )
15120
- );
15121
- chartData.forEach(
15122
- (d) => d.data.forEach(
15123
- (j) => j["markerSize"] = d.properties.markerShape != "None" && d.properties.markerSize && d.properties.markerShape != "None" ? type === "Area" ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? d.properties.markerSize : 0 : d.properties.markerSize : 0
15124
- )
15125
- );
15126
15278
  let markerGroups = lines.selectAll(".lineGroup").data(chartData, (d) => d.legend);
15127
15279
  let markerGroupsEnter = markerGroups.enter().append("g").attr("class", "parentGroup").attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-"));
15128
15280
  let mergedMarkerGroups = markerGroupsEnter.merge(markerGroups);
@@ -15134,12 +15286,12 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15134
15286
  return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
15135
15287
  }).attr("visibility", (d) => {
15136
15288
  const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
15137
- const visible = formatOptions.marker.markerVisibility ? checkVisibleConditions(chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) ? "hidden" : [chartTypes.NormalizedStackLineChart, "CombiLine"].includes(type) ? "visible" : [chartTypes.StackAreaChart, chartTypes.AreaChart, "CombiArea", "CombiStackArea"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "visible" : type === "CombiLine" ? "visible" : ["Area", "CombiArea"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "hidden";
15289
+ const visible = formatOptions.marker.markerVisibility ? checkVisibleConditions(chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) ? "hidden" : [chartTypes.NormalizedStackLineChart, chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) ? "visible" : [chartTypes.StackAreaChart, chartTypes.AreaChart, chartTypes.CombinationStackArea].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "visible" : [chartTypes.CombinationLine, chartTypes.CombinationArea].includes(type) ? "visible" : ["Area"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "hidden";
15138
15290
  return hideByX ? "hidden" : visible;
15139
15291
  }).attr("transform", (d) => {
15140
- let requiredYScale = d.axis == "Primary" ? yScale : yScaleRight;
15292
+ let requiredYScale = d.axis == axisTypes.primary ? yScale : yScaleRight;
15141
15293
  const x2 = xScale(d.dimension);
15142
- const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, "CombiStackArea"].includes(type) ? d[1] > 0 ? requiredYScale(d[1]) : requiredYScale(d[0]) : requiredYScale(d.value);
15294
+ const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? d[1] > 0 ? requiredYScale(d[1]) : requiredYScale(d[0]) : requiredYScale(d.value);
15143
15295
  return `translate(${x2},${y2})`;
15144
15296
  }).on("mousemove", function(event2, d) {
15145
15297
  const dataPoint = d;
@@ -15177,13 +15329,13 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15177
15329
  );
15178
15330
  parentG.selectAll(".halo").remove();
15179
15331
  parentG.insert("circle", ":first-child").attr("class", "halo").attr("cx", xScale(dataPoint.dimension)).attr("cy", () => {
15180
- const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15181
- return [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15332
+ const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
15333
+ return [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15182
15334
  }).attr("fill", legendEntry.markerColor).attr("opacity", 0.5).attr("r", legendEntry.markerSize * 10);
15183
15335
  select$2(this).transition().duration(100).attr("transform", () => {
15184
- const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15336
+ const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
15185
15337
  const x2 = xScale(dataPoint.dimension);
15186
- const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15338
+ const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15187
15339
  return `translate(${x2},${y2}) scale(1.3)`;
15188
15340
  });
15189
15341
  }).on("mouseout", function(event2, d) {
@@ -15192,9 +15344,9 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15192
15344
  hideTooltipOnMouseOut();
15193
15345
  parentG.selectAll(".halo").remove();
15194
15346
  select$2(this).transition().duration(100).attr("transform", () => {
15195
- const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15347
+ const requiredYScale = dataPoint.axis === axisTypes.primary ? yScale : yScaleRight;
15196
15348
  const x2 = xScale(dataPoint.dimension);
15197
- const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15349
+ const y2 = [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, chartTypes.CombinationStackArea].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15198
15350
  return `translate(${x2},${y2}) scale(1)`;
15199
15351
  });
15200
15352
  });
@@ -15206,10 +15358,10 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15206
15358
  const checkVisibleConditions = (chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) => {
15207
15359
  try {
15208
15360
  if (chartData[0].properties.axis && chartData[0].properties.axis === "Secondary") {
15209
- return hideZeroValues && d.Measure == 0 || d.Measure > secondaryCustomYaxisMaxValue || d.Measure < secondaryCustomYaxisMinValue;
15361
+ return hideZeroValues && d.value == 0 || d.value > secondaryCustomYaxisMaxValue || d.value < secondaryCustomYaxisMinValue;
15210
15362
  } else if (type.includes("Stack")) {
15211
- return d.Measure > 0 ? hideZeroValues && d[1] == 0 || d[1] < customYaxisMinValue || d[1] > customYaxisMaxValue : hideZeroValues && d[0] == 0 || d[0] < customYaxisMinValue || d[0] > customYaxisMaxValue;
15212
- } else return hideZeroValues && d.Measure == 0 || d.Measure < customYaxisMinValue || d.Measure > customYaxisMaxValue;
15363
+ return d.value > 0 ? hideZeroValues && d[1] == 0 || d[1] < customYaxisMinValue || d[1] > customYaxisMaxValue : hideZeroValues && d[0] == 0 || d[0] < customYaxisMinValue || d[0] > customYaxisMaxValue;
15364
+ } else return hideZeroValues && d.value == 0 || d.value < customYaxisMinValue || d.value > customYaxisMaxValue;
15213
15365
  } catch (error) {
15214
15366
  logError$2(fileName$b, "checkVisibleConditions", error);
15215
15367
  }
@@ -15419,7 +15571,7 @@ function getAutoNumberWithFormat(value2) {
15419
15571
  }
15420
15572
  function showTooltipOnMouseMove(elements, chartFormatOptions, event2, prop) {
15421
15573
  try {
15422
- const markerColor = prop?.markerColor ?? "blue";
15574
+ const markerColor = prop.color ?? prop?.markerColor ?? "blue";
15423
15575
  const markerShape = prop?.markerShape.toLowerCase() ?? "circle";
15424
15576
  const isLightTheme = chartFormatOptions.toolTip.toolTipTheme === "Light";
15425
15577
  const bgColor = isLightTheme ? "rgba(255, 255, 255)" : "#272729ff";
@@ -16007,7 +16159,7 @@ function generalizedChartData(chartData, dimensionList) {
16007
16159
  return {
16008
16160
  ...item,
16009
16161
  properties,
16010
- data: item.data
16162
+ data: normalizedData
16011
16163
  };
16012
16164
  });
16013
16165
  } catch (error) {
@@ -16471,7 +16623,9 @@ const ColumnChart = ({
16471
16623
  )
16472
16624
  ).tickSize(
16473
16625
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
16474
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
16626
+ ).tickValues(
16627
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
16628
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
16475
16629
  }
16476
16630
  if (isSecondaryAxisDrawn) {
16477
16631
  yAxisRight = axisRight(yScaleRight).tickFormat(
@@ -16520,7 +16674,13 @@ const ColumnChart = ({
16520
16674
  let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
16521
16675
  column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
16522
16676
  let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
16523
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr("hoverId", (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")).attr(
16677
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
16678
+ "hoverId",
16679
+ (data2.properties.alias || data2.properties.name || "Legend").replace(
16680
+ /\s+/g,
16681
+ "-"
16682
+ )
16683
+ ).attr(
16524
16684
  "transform",
16525
16685
  (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
16526
16686
  );
@@ -16533,9 +16693,12 @@ const ColumnChart = ({
16533
16693
  (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
16534
16694
  );
16535
16695
  const bars = columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legend)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
16536
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
16696
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
16537
16697
  return yScale(0);
16538
- }).attr("height", 0).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => d.stackBorderStyle === 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
16698
+ }).attr("height", 0).attr("fill", data2.properties.color).attr(
16699
+ "stroke-dasharray",
16700
+ (d) => d.stackBorderStyle === 2 ? "5,3" : "0"
16701
+ ).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
16539
16702
  "stroke",
16540
16703
  (d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
16541
16704
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
@@ -16544,10 +16707,10 @@ const ColumnChart = ({
16544
16707
  );
16545
16708
  const finalBars = bars;
16546
16709
  finalBars.attr("y", (d) => {
16547
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
16710
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
16548
16711
  return d.value > 0 ? yScale(d.value) : yScale(0);
16549
16712
  }).attr("height", (d) => {
16550
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
16713
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
16551
16714
  return Math.abs(yScale(d.value) - yScale(0));
16552
16715
  });
16553
16716
  columnGroupsEnter.merge(columnGroups).on("mousemove", (event2, d) => {
@@ -16743,10 +16906,6 @@ const CustomColumnChart = ({
16743
16906
  let xScale;
16744
16907
  let xScaleForLegends;
16745
16908
  let calculatedRange;
16746
- let stackAreaChartDataForPrimaryAxis = [];
16747
- let stackAreaChartDataForSecondaryAxis = [];
16748
- let stackColumnChartDataForPrimaryAxis = [];
16749
- let stackColumnChartDataForSecondaryAxis = [];
16750
16909
  let primaryStackAxisData = [];
16751
16910
  let secondaryStackAxisData = [];
16752
16911
  let primaryStackAreaAxisData = [];
@@ -16962,7 +17121,7 @@ const CustomColumnChart = ({
16962
17121
  secondaryStackAreaAxisData.push(series);
16963
17122
  }
16964
17123
  }
16965
- if (series.properties.axis === "Primary") {
17124
+ if (series.properties.axis === axisTypes.primary) {
16966
17125
  primaryStackAxisData.push(series);
16967
17126
  if (series.properties.type == chartTypes.StackColumnChart) {
16968
17127
  primaryStackColumnAxisData.push(series);
@@ -17018,7 +17177,8 @@ const CustomColumnChart = ({
17018
17177
  primaryStackAreaAxisData,
17019
17178
  primaryStackColumnAxisData,
17020
17179
  secondaryStackAreaAxisData,
17021
- secondaryStackColumnAxisData
17180
+ secondaryStackColumnAxisData,
17181
+ seriesData
17022
17182
  );
17023
17183
  if (primaryStackAxisData.length > 0) {
17024
17184
  let valueArray = [];
@@ -17059,91 +17219,85 @@ const CustomColumnChart = ({
17059
17219
  );
17060
17220
  }
17061
17221
  };
17062
- const checkAndupdateInputData = (primaryStackAreaAxisData2, primaryStackColumnAxisData2, secondaryStackAreaAxisData2, secondaryStackColumnAxisData2) => {
17063
- let tempStackAreaChartDataForPrimaryAxis = getStackedData(
17222
+ const checkAndupdateInputData = (primaryStackAreaAxisData2, primaryStackColumnAxisData2, secondaryStackAreaAxisData2, secondaryStackColumnAxisData2, ChartData) => {
17223
+ const tempStackAreaChartDataForPrimaryAxis = getStackedData(
17064
17224
  filteredDimension,
17065
17225
  primaryStackAreaAxisData2,
17066
17226
  false
17067
17227
  );
17068
- let tempStackAreaChartDataForSecondaryAxis = getStackedData(
17228
+ const tempStackAreaChartDataForSecondaryAxis = getStackedData(
17069
17229
  filteredDimension,
17070
17230
  secondaryStackAreaAxisData2,
17071
17231
  false
17072
17232
  );
17073
- let tempStackColumnChartDataForPrimaryAxis = getStackedData(
17233
+ const tempStackColumnChartDataForPrimaryAxis = getStackedData(
17074
17234
  filteredDimension,
17075
17235
  primaryStackColumnAxisData2,
17076
17236
  false
17077
17237
  );
17078
- let tempStackColumnChartDataForSecondaryAxis = getStackedData(
17238
+ const tempStackColumnChartDataForSecondaryAxis = getStackedData(
17079
17239
  filteredDimension,
17080
17240
  secondaryStackColumnAxisData2,
17081
17241
  false
17082
17242
  );
17083
17243
  requiredData = [];
17084
- stackAreaChartDataForPrimaryAxis = [];
17085
- stackAreaChartDataForSecondaryAxis = [];
17086
- stackColumnChartDataForPrimaryAxis = [];
17087
- stackColumnChartDataForSecondaryAxis = [];
17088
- if (primaryStackAreaAxisData2.length) {
17089
- primaryStackAreaAxisData2.forEach((d) => {
17090
- stackAreaChartDataForPrimaryAxis.push({
17091
- properties: {
17092
- axis: d.properties.axis,
17093
- type: d.properties.type,
17094
- legend: d.properties.legend
17095
- },
17096
- stackData: tempStackAreaChartDataForPrimaryAxis,
17097
- data: primaryStackAreaAxisData2
17098
- });
17244
+ const allGeneratedData = [];
17245
+ primaryStackAreaAxisData2.forEach((d) => {
17246
+ allGeneratedData.push({
17247
+ properties: {
17248
+ axis: d.properties.axis,
17249
+ type: d.properties.type,
17250
+ legend: d.properties.legend
17251
+ },
17252
+ stackData: tempStackAreaChartDataForPrimaryAxis,
17253
+ data: primaryStackAreaAxisData2
17099
17254
  });
17100
- }
17101
- if (secondaryStackAreaAxisData2.length) {
17102
- secondaryStackAreaAxisData2.forEach((d) => {
17103
- stackAreaChartDataForSecondaryAxis.push({
17104
- properties: {
17105
- axis: d.properties.axis,
17106
- type: d.properties.type,
17107
- legend: d.properties.legend
17108
- },
17109
- stackData: tempStackAreaChartDataForSecondaryAxis,
17110
- data: secondaryStackAreaAxisData2
17111
- });
17255
+ });
17256
+ secondaryStackAreaAxisData2.forEach((d) => {
17257
+ allGeneratedData.push({
17258
+ properties: {
17259
+ axis: d.properties.axis,
17260
+ type: d.properties.type,
17261
+ legend: d.properties.legend
17262
+ },
17263
+ stackData: tempStackAreaChartDataForSecondaryAxis,
17264
+ data: secondaryStackAreaAxisData2
17112
17265
  });
17113
- }
17114
- if (primaryStackColumnAxisData2.length) {
17115
- primaryStackColumnAxisData2.forEach((d) => {
17116
- stackAreaChartDataForSecondaryAxis.push({
17117
- properties: {
17118
- axis: d.properties.axis,
17119
- type: d.properties.type,
17120
- legend: d.properties.legend
17121
- },
17122
- stackData: tempStackColumnChartDataForPrimaryAxis,
17123
- data: primaryStackColumnAxisData2
17124
- });
17266
+ });
17267
+ primaryStackColumnAxisData2.forEach((d) => {
17268
+ allGeneratedData.push({
17269
+ properties: {
17270
+ axis: d.properties.axis,
17271
+ type: d.properties.type,
17272
+ legend: d.properties.legend
17273
+ },
17274
+ stackData: tempStackColumnChartDataForPrimaryAxis,
17275
+ data: primaryStackColumnAxisData2
17125
17276
  });
17126
- }
17127
- if (secondaryStackColumnAxisData2.length) {
17128
- secondaryStackColumnAxisData2.forEach((d) => {
17129
- stackColumnChartDataForSecondaryAxis.push({
17130
- properties: {
17131
- axis: d.properties.axis,
17132
- type: d.properties.type,
17133
- legend: d.properties.legend
17134
- },
17135
- stackData: tempStackColumnChartDataForSecondaryAxis,
17136
- data: secondaryStackColumnAxisData2
17137
- });
17277
+ });
17278
+ secondaryStackColumnAxisData2.forEach((d) => {
17279
+ allGeneratedData.push({
17280
+ properties: {
17281
+ axis: d.properties.axis,
17282
+ type: d.properties.type,
17283
+ legend: d.properties.legend
17284
+ },
17285
+ stackData: tempStackColumnChartDataForSecondaryAxis,
17286
+ data: secondaryStackColumnAxisData2
17138
17287
  });
17288
+ });
17289
+ allGeneratedData.push(...chartJSON.chartData);
17290
+ if (ChartData.length) {
17291
+ const ordered = [];
17292
+ ChartData.forEach((data2) => {
17293
+ ordered.push(
17294
+ ...allGeneratedData.filter((d) => d.properties?.type === data2.properties.type && d.properties.legend === data2.legend)
17295
+ );
17296
+ });
17297
+ requiredData.push(...ordered);
17298
+ } else {
17299
+ requiredData.push(...allGeneratedData);
17139
17300
  }
17140
- requiredData.push(
17141
- ...chartJSON.chartData,
17142
- ...stackAreaChartDataForPrimaryAxis,
17143
- ...stackAreaChartDataForSecondaryAxis,
17144
- ...stackColumnChartDataForPrimaryAxis,
17145
- ...stackColumnChartDataForSecondaryAxis
17146
- );
17147
17301
  };
17148
17302
  const initScale = () => {
17149
17303
  let yAxisLabelArray = responsiveYaxisLabel$1(
@@ -17186,7 +17340,7 @@ const CustomColumnChart = ({
17186
17340
  calculatedRange = [0, innerWidth2];
17187
17341
  };
17188
17342
  const getXScale = () => {
17189
- xScaleForLegends = band().domain(chartJSON.legendList).range([0, columnWidth]).paddingInner(
17343
+ xScaleForLegends = band().domain(chartJSON.legendList.reverse()).range([0, columnWidth]).paddingInner(
17190
17344
  chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
17191
17345
  );
17192
17346
  xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
@@ -17216,6 +17370,15 @@ const CustomColumnChart = ({
17216
17370
  ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
17217
17371
  }
17218
17372
  if (isSecondaryAxisDrawn) {
17373
+ let responsiveLablesObj = responsiveYaxisLabel$1(
17374
+ customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxRight,
17375
+ chartJSON.yMinRight,
17376
+ innerHeight2,
17377
+ formatOptions,
17378
+ chartJSON,
17379
+ customYaxisMinValue,
17380
+ customYaxisMaxValue
17381
+ );
17219
17382
  yAxisRight = axisRight(yScaleRight).tickFormat(
17220
17383
  (d) => getNumberWithFormat(
17221
17384
  d,
@@ -17224,20 +17387,8 @@ const CustomColumnChart = ({
17224
17387
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
17225
17388
  )
17226
17389
  ).tickValues(
17227
- responsiveSecondaryYaxisLabel(
17228
- secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
17229
- chartJSON.yMinRight,
17230
- formatOptions,
17231
- chartJSON
17232
- ).secondaryYAxisLabelArray
17233
- ).ticks(
17234
- responsiveSecondaryYaxisLabel(
17235
- secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
17236
- chartJSON.yMinRight,
17237
- formatOptions,
17238
- chartJSON
17239
- ).secondaryCustomTickValue ?? innerHeight2 / 30
17240
- ).tickSize(
17390
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
17391
+ ).ticks(responsiveLablesObj.customTickValue).tickSize(
17241
17392
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
17242
17393
  ).tickPadding(8).tickSizeOuter(0);
17243
17394
  }
@@ -17254,10 +17405,8 @@ const CustomColumnChart = ({
17254
17405
  drawColumnChart(data2);
17255
17406
  break;
17256
17407
  case chartTypes.LineChart:
17257
- drawLineChart([data2]);
17258
17408
  break;
17259
17409
  case chartTypes.AreaChart:
17260
- drawAreaChart([data2]);
17261
17410
  break;
17262
17411
  case chartTypes.StackColumnChart:
17263
17412
  stackColumnData = createStackData(data2);
@@ -17269,6 +17418,14 @@ const CustomColumnChart = ({
17269
17418
  break;
17270
17419
  }
17271
17420
  });
17421
+ const lineSeries = filteredData.filter((d) => d.properties.type === chartTypes.LineChart);
17422
+ if (lineSeries.length) {
17423
+ drawLineChart(lineSeries);
17424
+ }
17425
+ const AreaSeries = filteredData.filter((d) => d.properties.type === chartTypes.AreaChart);
17426
+ if (AreaSeries.length) {
17427
+ drawAreaChart(AreaSeries);
17428
+ }
17272
17429
  gTag.selectAll(".parentGroup").raise();
17273
17430
  };
17274
17431
  const drawColumnChart = (data2) => {
@@ -17279,19 +17436,15 @@ const CustomColumnChart = ({
17279
17436
  "hoverId",
17280
17437
  (d) => d.legend.includes("-") ? d.legend.replace("-", "`").split("`")[1].replace(/ /g, "-") : d.legend.replace(/ /g, "-")
17281
17438
  ).attr("transform", (d) => `translate(${xScale(d.dimension)}, 0)`);
17282
- columnGroups.attr(
17283
- "transform",
17284
- (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
17285
- );
17286
17439
  columnGroupsEnter.merge(columnGroups).attr(
17287
17440
  "transform",
17288
17441
  (d) => `translate(${xScale(d.dimension) - columnWidth / 2}, 0)`
17289
17442
  );
17290
17443
  columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.legend)).attr("width", xScaleForLegends.bandwidth()).attr("y", (d) => {
17291
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
17444
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
17292
17445
  return d.value > 0 ? yScale(d.value) : yScale(0);
17293
17446
  }).attr("height", (d) => {
17294
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
17447
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
17295
17448
  return Math.abs(yScale(d.value) - yScale(0));
17296
17449
  }).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => d.stackBorderStyle === 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
17297
17450
  "stroke",
@@ -17327,7 +17480,8 @@ const CustomColumnChart = ({
17327
17480
  }
17328
17481
  ],
17329
17482
  formatOptions,
17330
- event2
17483
+ event2,
17484
+ seriesData.filter((e) => e.legend === d.legend)[0].properties
17331
17485
  );
17332
17486
  }).on("mouseout", hideTooltipOnMouseOut);
17333
17487
  columnGroups.exit().remove();
@@ -17342,13 +17496,13 @@ const CustomColumnChart = ({
17342
17496
  const lineGenerator = line$1().x(
17343
17497
  (d) => xScale(d.dimension) ? xScale(d.dimension) : null
17344
17498
  ).y(
17345
- (d) => d.axis == "Primary" ? yScaleLeft(d.value) : yScaleRight(d.value)
17499
+ (d) => d.axis == axisTypes.primary ? yScaleLeft(d.value) : yScaleRight(d.value)
17346
17500
  ).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
17347
- let lines = gTag.selectAll(".parentGroup").data([lineData]);
17501
+ let lines = gTag.selectAll(".lines.parentGroup").data([1]);
17348
17502
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
17349
- let lineGroups = lines.selectAll(".line-group").data((d) => d);
17503
+ let lineGroups = lines.selectAll(".line-group").data(lineData, (d) => d.legend);
17350
17504
  let lineGroupsEnter = lineGroups.enter().append("g").attr("class", "line-group");
17351
- lineGroupsEnter.attr("hoverId", (d) => d.legend.replace(/ /g, "-")).append("path").attr("class", "line").attr("fill", "none");
17505
+ lineGroupsEnter.attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "line").attr("fill", "none");
17352
17506
  lineGroupsEnter.merge(lineGroups).select("path").attr("d", (d) => lineGenerator(d.data)).attr(
17353
17507
  "stroke",
17354
17508
  (d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
@@ -17357,13 +17511,13 @@ const CustomColumnChart = ({
17357
17511
  case staticLineStyle.dotted:
17358
17512
  return "0,3";
17359
17513
  case staticLineStyle.dashed:
17360
- return "20,10,5,5,5,10";
17514
+ return strokeDashValues;
17361
17515
  default:
17362
17516
  return "";
17363
17517
  }
17364
17518
  }).attr(
17365
17519
  "stroke-linecap",
17366
- (d) => d.properties.lineStyle === staticLineStyle.dotted ? "round" : ""
17520
+ (d) => d.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
17367
17521
  ).attr(
17368
17522
  "stroke-width",
17369
17523
  (d) => d.properties.lineStyle !== "None" ? d.properties.lineWidth : "0"
@@ -17372,7 +17526,7 @@ const CustomColumnChart = ({
17372
17526
  lineMarkers(
17373
17527
  lines,
17374
17528
  lineData,
17375
- "CombiLine",
17529
+ chartTypes.CombinationLine,
17376
17530
  xScale,
17377
17531
  yScaleLeft,
17378
17532
  yScaleRight,
@@ -17386,27 +17540,33 @@ const CustomColumnChart = ({
17386
17540
  );
17387
17541
  };
17388
17542
  const drawAreaChart = (lineData) => {
17543
+ lineData.forEach((lData) => {
17544
+ lData.data.forEach((cData) => {
17545
+ cData.hideZero = lData.properties.hideZeroValues;
17546
+ cData.axis = lData.properties.axis;
17547
+ });
17548
+ });
17389
17549
  const areaGenerator = area().x(
17390
17550
  (d) => xScale(d.dimension) ? xScale(d.dimension) : null
17391
17551
  ).y0(
17392
17552
  (d) => (
17393
- // d.axis == "Primary" ?
17553
+ // d.axis == axisTypes.primary ?
17394
17554
  yScaleLeft(0)
17395
17555
  )
17396
17556
  // : yScaleRight(0)
17397
17557
  ).y1(
17398
17558
  (d) => (
17399
- // d.axis == "Primary" ?
17559
+ // d.axis == axisTypes.primary ?
17400
17560
  yScaleLeft(d.value)
17401
17561
  )
17402
17562
  // : yScaleRight((d as TDataPoint).value)
17403
17563
  ).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
17404
- let areas = gTag.selectAll(".parentGroup").data([lineData]);
17564
+ let areas = gTag.selectAll(".areas.parentGroup").data([1]);
17405
17565
  let focus = gTag.append("g").attr("class", "focusClass");
17406
17566
  areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
17407
- let areaGroups = areas.selectAll(".area-group").data((d) => d);
17567
+ let areaGroups = areas.selectAll(".area-group").data(lineData, (d) => d.legend);
17408
17568
  let areaGroupsEnter = areaGroups.enter().append("g").attr("class", "area-group");
17409
- areaGroupsEnter.attr("hoverId", (d) => d.legend.replace(/ /g, "-")).append("path").attr("class", "area").attr(
17569
+ areaGroupsEnter.attr("hoverId", (d) => (d.properties.alias || d.properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "area").attr(
17410
17570
  "fill",
17411
17571
  (d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
17412
17572
  ).style("fill-opacity", formatOptions.plotArea.fillOpacity);
@@ -17418,13 +17578,13 @@ const CustomColumnChart = ({
17418
17578
  case "dotted":
17419
17579
  return "0,3";
17420
17580
  case "dashed":
17421
- return "20,10,5,5,5,10";
17581
+ return strokeDashValues;
17422
17582
  default:
17423
17583
  return "";
17424
17584
  }
17425
17585
  }).attr(
17426
17586
  "stroke-linecap",
17427
- (d) => d.properties.lineStyle === "dotted" ? "round" : ""
17587
+ (d) => d.properties.lineStyle === "dotted" ? strokeLineCap.round : ""
17428
17588
  ).attr(
17429
17589
  "stroke-width",
17430
17590
  (d) => d.properties.lineStyle !== "None" && formatOptions.plotArea.plotAreaHideLineAndMarkers ? d.properties.lineWidth : "0"
@@ -17440,30 +17600,48 @@ const CustomColumnChart = ({
17440
17600
  chartType
17441
17601
  );
17442
17602
  areaGroups.exit().remove();
17603
+ lineMarkers(
17604
+ areas,
17605
+ lineData,
17606
+ chartTypes.CombinationArea,
17607
+ xScale,
17608
+ yScaleLeft,
17609
+ yScaleRight,
17610
+ null,
17611
+ formatOptions,
17612
+ chartJSON,
17613
+ secondaryCustomYaxisMaxValue,
17614
+ secondaryCustomYaxisMinValue,
17615
+ customYaxisMinValue,
17616
+ customYaxisMaxValue
17617
+ );
17443
17618
  };
17444
17619
  const drawStackAreaChart = (data2) => {
17620
+ data2.data.forEach((lData) => {
17621
+ lData.data.forEach((cData) => {
17622
+ cData.hideZero = lData.properties.hideZeroValues;
17623
+ cData.axis = lData.properties.axis;
17624
+ });
17625
+ });
17445
17626
  const areaGenerator = area().x(
17446
17627
  (d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
17447
17628
  ).y0(
17448
- (d) => d.data.axis == "Primary" ? yScaleLeft(0) : yScaleRight(0)
17629
+ (d) => d.data.axis == axisTypes.primary ? yScaleLeft(0) : yScaleRight(0)
17449
17630
  ).y1(
17450
- (d) => d.data.axis == "Primary" ? d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0]) : d[1] > 0 ? yScaleRight(d[1]) : yScaleRight(d[0])
17631
+ (d) => d.data.axis == axisTypes.primary ? d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0]) : d[1] > 0 ? yScaleRight(d[1]) : yScaleRight(d[0])
17451
17632
  ).defined((d) => d.hideZero ? Boolean(d.key) : true).curve(getCurveType(formatOptions));
17452
17633
  let areas = gTag.selectAll(".parentGroup").data([stackAreaData]);
17453
17634
  gTag.append("g").attr("class", "focusClass");
17454
17635
  areas = areas.enter().append("g").attr("class", "areas parentGroup").merge(areas);
17455
17636
  let areaGroups = areas.selectAll(".area-group").data((d) => d);
17456
17637
  let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
17457
- areaGroupsEnter.attr(
17458
- "hoverId",
17459
- (d) => d.key.includes("~$~") ? d.key.split("~$~")[1].replace(/ /g, "-") : d.key.replace(/ /g, "-")
17460
- ).append("path").attr("class", "area").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none");
17638
+ areaGroupsEnter.attr("hoverId", (d) => (data2.data.filter((e) => e.legend === d.key)[0].properties.alias || data2.data.filter((e) => e.legend === d.key)[0].properties.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "area").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none");
17461
17639
  areaGroupsEnter.merge(areaGroups).select("path").attr("d", (d, i) => areaGenerator(d)).style("opacity", formatOptions.plotArea.fillOpacity).attr("stroke", (d) => d.color !== "#ffffff" ? d.color : "none").attr(
17462
17640
  "stroke-dasharray",
17463
- (d, i) => seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ? "20,10,5,5,5,10" : ""
17641
+ (d, i) => seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ? strokeDashValues : ""
17464
17642
  ).attr(
17465
17643
  "stroke-linecap",
17466
- (d, i) => seriesData[i].properties.lineStyle === "dotted" ? "round" : ""
17644
+ (d, i) => seriesData[i].properties.lineStyle === "dotted" ? strokeLineCap.round : ""
17467
17645
  ).attr(
17468
17646
  "stroke-width",
17469
17647
  (d, i) => seriesData[i].properties.lineStyle !== "None" ? seriesData[i].properties.lineWidth : "0"
@@ -17472,7 +17650,7 @@ const CustomColumnChart = ({
17472
17650
  lineMarkers(
17473
17651
  areas,
17474
17652
  data2.data,
17475
- "CombiStackArea",
17653
+ chartTypes.CombinationStackArea,
17476
17654
  xScale,
17477
17655
  yScaleLeft,
17478
17656
  yScaleRight,
@@ -17494,16 +17672,16 @@ const CustomColumnChart = ({
17494
17672
  let rects = stackColumnGroups.selectAll("rect").data((d) => d);
17495
17673
  rects.enter().append("rect").attr(
17496
17674
  "transform",
17497
- (d) => `translate(${xScale(d.data.dimension) - columnWidth / 2},0)`
17675
+ (d) => `translate(${xScale(d.data.dimension) - columnWidth},0)`
17498
17676
  ).merge(rects).attr(
17499
17677
  "hoverId",
17500
17678
  (d) => d.key.includes("~$~") ? d.key.split("~$~")[1].replace(/ /g, "-") : d.key.replace(/ /g, "-")
17501
17679
  ).attr("x", (d) => xScaleForLegends("stackLegend")).attr(
17502
17680
  "y",
17503
- (d) => d.data.axis === "Primary" ? yScaleLeft(d[1]) : yScaleRight(d[1])
17681
+ (d) => d.data.axis === axisTypes.primary ? yScaleLeft(d[1]) : yScaleRight(d[1])
17504
17682
  ).attr(
17505
17683
  "height",
17506
- (d) => d.data.axis === "Primary" ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
17684
+ (d) => d.data.axis === axisTypes.primary ? customYaxisMaxValue && d[1] > customYaxisMaxValue ? yScaleLeft(d[0]) - yScaleLeft(customYaxisMaxValue) : yScaleLeft(d[0]) - yScaleLeft(d[1]) : secondaryCustomYaxisMaxValue && d[1] > secondaryCustomYaxisMaxValue ? yScaleRight(d[0]) - yScaleRight(secondaryCustomYaxisMaxValue) : yScaleRight(d[0]) - yScaleRight(d[1])
17507
17685
  ).attr("width", xScaleForLegends.bandwidth()).attr("fill", (d, i, nodes) => {
17508
17686
  const seriesIndex = Array.from(seriesData).findIndex(
17509
17687
  (sdata) => sdata.legend === d.key
@@ -17547,7 +17725,8 @@ const CustomColumnChart = ({
17547
17725
  }
17548
17726
  ],
17549
17727
  formatOptions,
17550
- event2
17728
+ event2,
17729
+ seriesData.filter((e) => e.legend === d.key)[0].properties
17551
17730
  );
17552
17731
  }).on("mouseout", hideTooltipOnMouseOut);
17553
17732
  stackColumnGroups.exit().remove();
@@ -17564,7 +17743,8 @@ const CustomColumnChart = ({
17564
17743
  primaryStackAreaAxisData,
17565
17744
  primaryStackColumnAxisData,
17566
17745
  secondaryStackAreaAxisData,
17567
- secondaryStackColumnAxisData
17746
+ secondaryStackColumnAxisData,
17747
+ fData
17568
17748
  );
17569
17749
  filteredData = JSON.parse(JSON.stringify(requiredData));
17570
17750
  filteredData.forEach((data2, i) => {
@@ -18011,7 +18191,9 @@ const LayeredColumnChart = ({
18011
18191
  )
18012
18192
  ).tickSize(
18013
18193
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
18014
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
18194
+ ).tickValues(
18195
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
18196
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
18015
18197
  }
18016
18198
  };
18017
18199
  const getXAxis = () => {
@@ -18031,7 +18213,13 @@ const LayeredColumnChart = ({
18031
18213
  let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
18032
18214
  column = column.enter().append("g").attr("class", `column parentGroup`).merge(column);
18033
18215
  let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
18034
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr("hoverId", (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")).attr(
18216
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
18217
+ "hoverId",
18218
+ (data2.properties.alias || data2.properties.name || "Legend").replace(
18219
+ /\s+/g,
18220
+ "-"
18221
+ )
18222
+ ).attr(
18035
18223
  "transform",
18036
18224
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
18037
18225
  );
@@ -18044,10 +18232,10 @@ const LayeredColumnChart = ({
18044
18232
  (d) => index2 === 0 ? `translate(${xScale(d.dimension) - columnWidth / 2}, 0)` : `translate(${xScale(d.dimension) - columnWidth / (2 + index2 * 2)}, 0)`
18045
18233
  );
18046
18234
  columnGroupsEnter.append("rect").attr("x", (d) => xScaleForLegends(d.dimension)).attr("width", index2 === 0 ? columnWidth : columnWidth / 2 + index2 * 2).attr("y", (d) => {
18047
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
18235
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18048
18236
  return d.value > 0 ? yScale(d.value) : yScale(0);
18049
18237
  }).attr("height", (d) => {
18050
- const yScale = data2.properties.axis === "Primary" ? yScaleLeft : yScaleRight;
18238
+ const yScale = data2.properties.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
18051
18239
  return Math.abs(yScale(d.value) - yScale(0));
18052
18240
  }).attr("fill", data2.properties.color).attr(
18053
18241
  "stroke-dasharray",
@@ -18208,11 +18396,8 @@ const StackColumnChart = ({
18208
18396
  let scrollbarVisible = false;
18209
18397
  const chartType = chartTypes.StackColumnChart;
18210
18398
  const svgRef = useRef();
18211
- const seriesData = generalizedChartData(
18212
- data.ChartData,
18213
- data.DimensionList
18214
- )?.reverse();
18215
18399
  const dimensionList = data.DimensionList;
18400
+ const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
18216
18401
  const barChart = false;
18217
18402
  const isSecondaryAxisDrawn = false;
18218
18403
  let customYaxisMinValue = parseFloat(formatOptions.yAxisLabel.yAxisMinText);
@@ -18254,6 +18439,7 @@ const StackColumnChart = ({
18254
18439
  let scrollPosition = 0;
18255
18440
  let visibleBars;
18256
18441
  let stackChartData = [];
18442
+ let totalValueMap = /* @__PURE__ */ new Map();
18257
18443
  const isNormalizedChart = false;
18258
18444
  let chartJSON = {
18259
18445
  dimensionList,
@@ -18408,7 +18594,7 @@ const StackColumnChart = ({
18408
18594
  width,
18409
18595
  legendMargin,
18410
18596
  formatOptions,
18411
- seriesData,
18597
+ [...seriesData].reverse(),
18412
18598
  chartId,
18413
18599
  staticLegendShape.rectangle
18414
18600
  );
@@ -18509,7 +18695,9 @@ const StackColumnChart = ({
18509
18695
  )
18510
18696
  ).tickSize(
18511
18697
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + 0 : 0 : 0
18512
- ).tickValues(respParams.autoLabelFlag ? void 0 : respParams.yAxisLabelArray).ticks(respParams.customTickValue).tickPadding(8).tickSizeOuter(0);
18698
+ ).tickValues(
18699
+ respParams.autoLabelFlag ? void 0 : respParams.yAxisLabelArray
18700
+ ).ticks(respParams.customTickValue).tickPadding(8).tickSizeOuter(0);
18513
18701
  }
18514
18702
  };
18515
18703
  const getXAxis = () => {
@@ -18608,6 +18796,7 @@ const StackColumnChart = ({
18608
18796
  filteredData = fData;
18609
18797
  filteredDimension = fDimension;
18610
18798
  visibleBars = fVisibleBars;
18799
+ createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
18611
18800
  drawLineChart();
18612
18801
  };
18613
18802
  const drawLineChart = () => {
@@ -18657,6 +18846,20 @@ const StackColumnChart = ({
18657
18846
  dataTableHeight,
18658
18847
  isReportEditable
18659
18848
  );
18849
+ addTotalValue(
18850
+ totalValueMap,
18851
+ xScale,
18852
+ yScaleLeft,
18853
+ margin,
18854
+ d3Annotation,
18855
+ [],
18856
+ formatOptions,
18857
+ chartType,
18858
+ height,
18859
+ width,
18860
+ svg,
18861
+ isReportEditable
18862
+ );
18660
18863
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
18661
18864
  if (formatOptions.xAxisLabel.xAxisPosition != "1") {
18662
18865
  formatOptions.xAxisLabel.xAxisLabelVisibility = false;
@@ -19128,7 +19331,7 @@ const NormalizedStackColumnChart = ({
19128
19331
  width,
19129
19332
  legendMargin,
19130
19333
  formatOptions,
19131
- seriesData,
19334
+ [...seriesData].reverse(),
19132
19335
  chartId,
19133
19336
  staticLegendShape.rectangle
19134
19337
  );
@@ -19261,7 +19464,10 @@ const NormalizedStackColumnChart = ({
19261
19464
  let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
19262
19465
  columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
19263
19466
  let columnGroups = columns.selectAll(".column-group").data((d) => d);
19264
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr("hoverId", (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-"));
19467
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
19468
+ "hoverId",
19469
+ (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
19470
+ );
19265
19471
  columnGroups = columnGroupsEnter.merge(columnGroups);
19266
19472
  let rects = columnGroups.selectAll("rect").data((d) => d);
19267
19473
  const getPropsForRect = (nodes, i) => {
@@ -20688,6 +20894,9 @@ const LineChart = ({
20688
20894
  let yMinLeft = Infinity;
20689
20895
  let yMaxRight = -Infinity;
20690
20896
  let yMinRight = Infinity;
20897
+ if (formatOptions.plotArea.hideZeroValues) {
20898
+ chartJSON.hideZeroValues = true;
20899
+ }
20691
20900
  seriesData.forEach((series) => {
20692
20901
  legendList.push(
20693
20902
  series.properties.alias ? series.properties.alias : series.legend
@@ -20726,9 +20935,6 @@ const LineChart = ({
20726
20935
  } else {
20727
20936
  filteredDimension = chartJSON.dimensionList;
20728
20937
  }
20729
- if (formatOptions.plotArea.hideZeroValues) {
20730
- chartJSON.hideZeroValues = true;
20731
- }
20732
20938
  };
20733
20939
  const initScale = () => {
20734
20940
  let yAxisLabelArray = responsiveYaxisLabel$1(
@@ -20804,7 +21010,9 @@ const LineChart = ({
20804
21010
  )
20805
21011
  ).tickSize(
20806
21012
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
20807
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
21013
+ ).tickValues(
21014
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
21015
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
20808
21016
  }
20809
21017
  if (isSecondaryAxisDrawn) {
20810
21018
  let responsiveSecondaryLablesObj = responsiveSecondaryYaxisLabel(
@@ -20820,7 +21028,9 @@ const LineChart = ({
20820
21028
  formatOptions.secondaryYAxisLabel.secondaryYAxisNumberFormat,
20821
21029
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
20822
21030
  )
20823
- ).tickValues(responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
21031
+ ).tickValues(
21032
+ responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray
21033
+ ).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
20824
21034
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
20825
21035
  ).tickPadding(8).tickSizeOuter(0);
20826
21036
  }
@@ -20841,8 +21051,10 @@ const LineChart = ({
20841
21051
  const val = xScale(d.dimension);
20842
21052
  return val != null ? val : 0;
20843
21053
  }).y(
20844
- (d) => d.axis === "Primary" ? yScaleLeft(d.value) : yScaleRight(d.value)
20845
- ).defined((d) => d.hideZero ? Boolean(d.value) : true).curve(getCurveType(formatOptions));
21054
+ (d) => d.axis === axisTypes.primary ? yScaleLeft(d.value) : yScaleRight(d.value)
21055
+ ).defined(
21056
+ (d) => d.hideZero || chartJSON.hideZeroValues ? Boolean(d.value) : true
21057
+ ).curve(getCurveType(formatOptions));
20846
21058
  let lines = gTag.selectAll(".parentGroup").data([lineData]);
20847
21059
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
20848
21060
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
@@ -20854,32 +21066,25 @@ const LineChart = ({
20854
21066
  "stroke",
20855
21067
  (d2) => d2.properties.color !== "#ffffff" ? d2.properties.color : "none"
20856
21068
  ).attr("stroke-dasharray", (d2) => {
21069
+ const lineWidth = parseInt(d2.properties.lineWidth);
20857
21070
  switch (d2.properties.lineStyle) {
20858
21071
  case staticLineStyle.dotted:
20859
- return "0,3";
21072
+ return `0,${lineWidth + 2}`;
20860
21073
  case staticLineStyle.dashed:
20861
- return "20,10,5,5,5,10";
21074
+ return strokeDashValues;
20862
21075
  default:
20863
21076
  return "";
20864
21077
  }
20865
21078
  }).attr(
20866
21079
  "stroke-linecap",
20867
- (d2) => d2.properties.lineStyle === staticLineStyle.dotted ? "round" : ""
21080
+ (d2) => d2.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
20868
21081
  ).attr(
20869
21082
  "stroke-width",
20870
- (d2) => d2.properties.lineStyle !== "None" ? 2.5 : 0
20871
- ).attr("hoverId", (d.properties.alias || lineGroups.properties.name || "Legend").replace(/\s+/g, "-")).attr("d", (d2) => lineGenerator(d2.data));
20872
- g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => lineGenerator(d2.data)).attr("stroke", "transparent").attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function(event2, d2) {
20873
- svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
20874
- svg.selectAll(
20875
- '[hoverId="' + getJQuerySelector(d2.properties.alias || d2.properties.name || "Legend").replace(/\s+/g, "-") + '"]'
20876
- ).classed("highlight", true).classed("unhighlight", false);
20877
- }).on("mouseleave", function(event2, d2) {
20878
- svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
20879
- svg.selectAll(
20880
- '[hoverId="' + getJQuerySelector(d2.properties?.alias || d2.properties?.name || "Legend").replace(/\s+/g, "-") + '"]'
20881
- ).classed("highlight", false).classed("unhighlight", false);
20882
- });
21083
+ (d2) => d2.properties.lineStyle !== "None" ? d2.properties.lineWidth : 0
21084
+ ).attr(
21085
+ "hoverId",
21086
+ (d.properties.alias || lineGroups.properties.name || "Legend").replace(/\s+/g, "-")
21087
+ ).attr("d", (d2) => lineGenerator(d2.data));
20883
21088
  });
20884
21089
  lineGroups.exit().remove();
20885
21090
  lineMarkers(
@@ -21006,12 +21211,10 @@ const StackLineChart = ({
21006
21211
  const barWidth = 0;
21007
21212
  const chartType = chartTypes.StackLineChart;
21008
21213
  const svgRef = useRef();
21009
- const seriesData = generalizedChartData(
21010
- data.ChartData,
21011
- data.DimensionList
21012
- )?.reverse() || [];
21013
21214
  const dimensionList = data.DimensionList;
21215
+ const seriesData = (generalizedChartData(data.ChartData, data.DimensionList) || []).reverse();
21014
21216
  const barChart = false;
21217
+ const totalValueMap = /* @__PURE__ */ new Map();
21015
21218
  const isSecondaryAxisDrawn = false;
21016
21219
  let customYaxisMinValue = parseFloat(formatOptions.yAxisLabel.yAxisMinText);
21017
21220
  let customYaxisMaxValue = parseFloat(formatOptions.yAxisLabel.yAxisMaxText);
@@ -21200,7 +21403,7 @@ const StackLineChart = ({
21200
21403
  width,
21201
21404
  legendMargin,
21202
21405
  formatOptions,
21203
- seriesData,
21406
+ [...seriesData].reverse(),
21204
21407
  chartId,
21205
21408
  staticLegendShape.line
21206
21409
  );
@@ -21218,10 +21421,27 @@ const StackLineChart = ({
21218
21421
  false,
21219
21422
  setAndUpdateChartData
21220
21423
  );
21424
+ addTotalValue(
21425
+ totalValueMap,
21426
+ xScale,
21427
+ yScaleLeft,
21428
+ margin,
21429
+ d3Annotation,
21430
+ [],
21431
+ formatOptions,
21432
+ chartType,
21433
+ height,
21434
+ width,
21435
+ svg,
21436
+ isReportEditable
21437
+ );
21221
21438
  };
21222
21439
  const preProcessChartData = () => {
21223
21440
  const allChartData = [];
21224
21441
  const legendList = [];
21442
+ if (formatOptions.plotArea.hideZeroValues) {
21443
+ chartJSON.hideZeroValues = true;
21444
+ }
21225
21445
  seriesData.forEach((series, index2) => {
21226
21446
  const prefixedLegend = `${index2}~$~${series.properties.alias ? series.properties.alias : series.legend}`;
21227
21447
  series.properties.legend = prefixedLegend;
@@ -21270,9 +21490,6 @@ const StackLineChart = ({
21270
21490
  chartJSON.dimensionList.forEach((d, i) => {
21271
21491
  chartJSON.formattedDimensionListMap.set(d, formatedDimensionList[i]);
21272
21492
  });
21273
- if (formatOptions.plotArea.hideZeroValues) {
21274
- chartJSON.hideZeroValues = true;
21275
- }
21276
21493
  };
21277
21494
  const initScale = () => {
21278
21495
  let yAxisLabelArray = responsiveYaxisLabel$1(
@@ -21336,7 +21553,9 @@ const StackLineChart = ({
21336
21553
  )
21337
21554
  ).tickSize(
21338
21555
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
21339
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
21556
+ ).tickValues(
21557
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
21558
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
21340
21559
  }
21341
21560
  };
21342
21561
  const getXAxis = () => {
@@ -21353,7 +21572,10 @@ const StackLineChart = ({
21353
21572
  });
21354
21573
  const lineGenerator = line$1().x(
21355
21574
  (d) => xScale(d.data.dimension) ? xScale(d.data.dimension) : null
21356
- ).y((d) => d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0])).curve(getCurveType(formatOptions));
21575
+ ).y((d) => d[1] > 0 ? yScaleLeft(d[1]) : yScaleLeft(d[0])).defined((d) => {
21576
+ const a2 = d;
21577
+ return a2.hideZero || chartJSON.hideZeroValues ? a2.data[a2.key] : true;
21578
+ }).curve(getCurveType(formatOptions));
21357
21579
  let lines = gTag.selectAll(".parentGroup").data([stackChartData]);
21358
21580
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
21359
21581
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
@@ -21361,15 +21583,27 @@ const StackLineChart = ({
21361
21583
  lineGroupsEnter.append("path").attr("class", "line").attr("fill", "none");
21362
21584
  lineGroupsEnter.merge(lineGroups).each(function(d, i) {
21363
21585
  const g = select$2(this);
21364
- const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("hoverId", (d2) => (seriesData[i]?.properties?.alias || seriesData[i]?.properties?.name || "Legend").replace(/\s+/g, "-")).attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr(
21365
- "stroke-dasharray",
21366
- seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ? "20,10,5,5,5,10" : ""
21367
- ).attr(
21586
+ const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr(
21587
+ "hoverId",
21588
+ (d2) => (seriesData[i]?.properties?.alias || seriesData[i]?.properties?.name || "Legend").replace(/\s+/g, "-")
21589
+ ).attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr("stroke-dasharray", (d2) => {
21590
+ const lineWidth = parseInt(
21591
+ seriesData[i].properties.lineWidth.toString()
21592
+ );
21593
+ switch (seriesData[i].properties.lineStyle) {
21594
+ case staticLineStyle.dotted:
21595
+ return `0,${lineWidth + 2}`;
21596
+ case staticLineStyle.dashed:
21597
+ return strokeDashValues;
21598
+ default:
21599
+ return "";
21600
+ }
21601
+ }).attr(
21368
21602
  "stroke-linecap",
21369
- seriesData[i].properties.lineStyle === "dotted" ? "round" : ""
21603
+ seriesData[i].properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
21370
21604
  ).attr(
21371
21605
  "stroke-width",
21372
- seriesData[i].properties.lineStyle !== "None" ? 2.5 : 0
21606
+ seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
21373
21607
  ).attr("fill", "none");
21374
21608
  const totalLength = pathSel.node().getTotalLength();
21375
21609
  {
@@ -21378,7 +21612,9 @@ const StackLineChart = ({
21378
21612
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", "transparent").attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function() {
21379
21613
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
21380
21614
  svg.selectAll(
21381
- '[hoverId="' + getJQuerySelector(seriesData[i].properties.alias || seriesData[i].properties.name || "Legend").replace(/\s+/g, "-") + '"]'
21615
+ '[hoverId="' + getJQuerySelector(
21616
+ seriesData[i].properties.alias || seriesData[i].properties.name || "Legend"
21617
+ ).replace(/\s+/g, "-") + '"]'
21382
21618
  ).classed("highlight", true).classed("unhighlight", false);
21383
21619
  }).on("mouseleave", function() {
21384
21620
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
@@ -21509,7 +21745,11 @@ const StackLineChart = ({
21509
21745
  (K2, j) => K2.forEach((d) => {
21510
21746
  d["key"] = K2.key;
21511
21747
  K2["color"] = JSON.parse(JSON.stringify(seriesData[j].properties.color));
21512
- K2["individualAnnotationVisibility"] = JSON.parse(JSON.stringify(seriesData[j].properties.individualAnnotationVisibility));
21748
+ K2["individualAnnotationVisibility"] = JSON.parse(
21749
+ JSON.stringify(
21750
+ seriesData[j].properties.individualAnnotationVisibility
21751
+ )
21752
+ );
21513
21753
  d.data.labelPosition = seriesData[j].properties.dataLabelPosition;
21514
21754
  d.data["labelColor"] = seriesColor == "2" ? JSON.parse(JSON.stringify(seriesData[j].properties.color)) : seriesData[j].properties.labelColor;
21515
21755
  d["hideZero"] = JSON.parse(
@@ -21522,6 +21762,7 @@ const StackLineChart = ({
21522
21762
  filteredData = fData;
21523
21763
  filteredDimension = fDimension;
21524
21764
  visibleBars = fVisibleBars;
21765
+ createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
21525
21766
  drawLineChart();
21526
21767
  };
21527
21768
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -21544,10 +21785,7 @@ const NormalisedStackLineChart = ({
21544
21785
  const barWidth = 0;
21545
21786
  const chartType = chartTypes.NormalizedStackLineChart;
21546
21787
  const svgRef = useRef();
21547
- const seriesData = generalizedChartData(
21548
- data.ChartData,
21549
- data.DimensionList
21550
- )?.reverse() || [];
21788
+ const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
21551
21789
  const dimensionList = data.DimensionList;
21552
21790
  const barChart = false;
21553
21791
  const isSecondaryAxisDrawn = false;
@@ -21730,7 +21968,7 @@ const NormalisedStackLineChart = ({
21730
21968
  width,
21731
21969
  legendMargin,
21732
21970
  formatOptions,
21733
- seriesData,
21971
+ [...seriesData].reverse(),
21734
21972
  chartId,
21735
21973
  staticLegendShape.line
21736
21974
  );
@@ -21752,6 +21990,12 @@ const NormalisedStackLineChart = ({
21752
21990
  const preProcessChartData = () => {
21753
21991
  const allChartData = [];
21754
21992
  const legendList = [];
21993
+ if (formatOptions.plotArea.hideZeroValues) {
21994
+ chartJSON.hideZeroValues = true;
21995
+ seriesData.forEach((series) => {
21996
+ series.data = series.data.filter((d) => d.value !== 0);
21997
+ });
21998
+ }
21755
21999
  seriesData.forEach((series, index2) => {
21756
22000
  const prefixedLegend = `${index2}~$~${series.properties.legend}`;
21757
22001
  series.properties.legend = prefixedLegend;
@@ -21764,9 +22008,6 @@ const NormalisedStackLineChart = ({
21764
22008
  chartJSON.legendList = legendList;
21765
22009
  filteredData = JSON.parse(JSON.stringify(seriesData));
21766
22010
  filteredDimension = chartJSON.dimensionList;
21767
- if (formatOptions.plotArea.hideZeroValues) {
21768
- chartJSON.hideZeroValues = true;
21769
- }
21770
22011
  const tempStackLineData = getStackedData(
21771
22012
  chartJSON.dimensionList,
21772
22013
  seriesData,
@@ -21853,18 +22094,30 @@ const NormalisedStackLineChart = ({
21853
22094
  lines = lines.enter().append("g").attr("class", "lines parentGroup").merge(lines);
21854
22095
  let lineGroups = lines.selectAll(".line-group").data((d) => d);
21855
22096
  let lineGroupsEnter = lineGroups.enter().append("g").attr("class", (d) => "line-group " + d.key.replace(/ /g, "-"));
21856
- lineGroupsEnter.attr("hoverId", (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")).append("path").attr("class", "line").attr("fill", "none");
22097
+ lineGroupsEnter.attr(
22098
+ "hoverId",
22099
+ (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
22100
+ ).append("path").attr("class", "line").attr("fill", "none");
21857
22101
  lineGroupsEnter.merge(lineGroups).each(function(d, i) {
21858
22102
  const g = select$2(this);
21859
- const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr(
21860
- "stroke-dasharray",
21861
- seriesData[i].properties.lineStyle === "dotted" ? "0,3" : seriesData[i].properties.lineStyle === "dashed" ? "20,10,5,5,5,10" : ""
21862
- ).attr(
22103
+ const pathSel = g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine").attr("d", lineGenerator(d)).attr("stroke", d.color !== "#ffffff" ? d.color : "none").attr("stroke-dasharray", (d2) => {
22104
+ const lineWidth = parseInt(
22105
+ seriesData[i].properties.lineWidth.toString()
22106
+ );
22107
+ switch (seriesData[i].properties.lineStyle) {
22108
+ case staticLineStyle.dotted:
22109
+ return `0,${lineWidth + 2}`;
22110
+ case staticLineStyle.dashed:
22111
+ return strokeDashValues;
22112
+ default:
22113
+ return "";
22114
+ }
22115
+ }).attr(
21863
22116
  "stroke-linecap",
21864
- seriesData[i].properties.lineStyle === "dotted" ? "round" : ""
22117
+ seriesData[i].properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : ""
21865
22118
  ).attr(
21866
22119
  "stroke-width",
21867
- seriesData[i].properties.lineStyle !== "None" ? 2.5 : 0
22120
+ seriesData[i].properties.lineStyle !== staticLineStyle.none ? seriesData[i].properties.lineWidth : 0
21868
22121
  ).attr("fill", "none");
21869
22122
  const totalLength = pathSel.node().getTotalLength();
21870
22123
  {
@@ -21872,10 +22125,18 @@ const NormalisedStackLineChart = ({
21872
22125
  }
21873
22126
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", lineGenerator(d)).attr("stroke", "transparent").attr("stroke-width", 20).attr("fill", "none").style("pointer-events", "stroke").on("mouseenter", function(event2, d2) {
21874
22127
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
21875
- svg.selectAll('[hoverId="' + getJQuerySelector(lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend").replace(/\s+/g, "-") + '"]').classed("highlight", true).classed("unhighlight", false);
22128
+ svg.selectAll(
22129
+ '[hoverId="' + getJQuerySelector(
22130
+ lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend"
22131
+ ).replace(/\s+/g, "-") + '"]'
22132
+ ).classed("highlight", true).classed("unhighlight", false);
21876
22133
  }).on("mouseleave", function(event2, d2) {
21877
22134
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
21878
- svg.selectAll('[hoverId="' + getJQuerySelector(lineData[d2.index]?.properties?.alias || d2[d2.index]?.properties?.name || "Legend").replace(/\s+/g, "-") + '"]').classed("highlight", false).classed("unhighlight", false);
22135
+ svg.selectAll(
22136
+ '[hoverId="' + getJQuerySelector(
22137
+ lineData[d2.index]?.properties?.alias || d2[d2.index]?.properties?.name || "Legend"
22138
+ ).replace(/\s+/g, "-") + '"]'
22139
+ ).classed("highlight", false).classed("unhighlight", false);
21879
22140
  });
21880
22141
  });
21881
22142
  lineGroups.exit().remove();
@@ -22065,6 +22326,7 @@ const HorizontalBarChart = ({
22065
22326
  let secondaryYLabel;
22066
22327
  let maxNumberForPrimaryAxis;
22067
22328
  let maxNumberForSecondaryAxis;
22329
+ let totalValueMap = /* @__PURE__ */ new Map();
22068
22330
  let innerWidth2;
22069
22331
  let innerHeight2;
22070
22332
  let width;
@@ -22270,7 +22532,7 @@ const HorizontalBarChart = ({
22270
22532
  chartJSON.chartData = allChartData;
22271
22533
  chartJSON.legendList = legendList;
22272
22534
  chartJSON.yMaxLeft = yMaxLeft;
22273
- chartJSON.yMinLeft = yMinLeft > 0 ? 0 : yMinLeft;
22535
+ chartJSON.yMinLeft = yMinLeft;
22274
22536
  chartJSON.yMaxRight = yMaxRight;
22275
22537
  chartJSON.yMinRight = yMinRight;
22276
22538
  formatedDimensionList = isDateType ? setDateFormats(
@@ -22327,13 +22589,14 @@ const HorizontalBarChart = ({
22327
22589
  const initAxis = () => {
22328
22590
  {
22329
22591
  let responsiveLablesObj = responsiveYaxisLabel$1(
22330
- customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxLeft,
22592
+ customYaxisMaxValue ? customYaxisMaxValue : chartJSON.yMaxRight,
22331
22593
  chartJSON.yMinLeft,
22332
22594
  innerHeight2,
22333
22595
  formatOptions,
22334
22596
  chartJSON,
22335
22597
  customYaxisMinValue,
22336
- customYaxisMaxValue
22598
+ customYaxisMaxValue,
22599
+ barChart
22337
22600
  );
22338
22601
  xAxisBottom = axisBottom(xScaleBottom).tickFormat(
22339
22602
  (d) => getNumberWithFormat(
@@ -22344,7 +22607,9 @@ const HorizontalBarChart = ({
22344
22607
  )
22345
22608
  ).tickSize(
22346
22609
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -innerHeight2 : 0 : 0
22347
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
22610
+ ).tickValues(
22611
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
22612
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
22348
22613
  }
22349
22614
  if (isSecondaryAxisDrawn) {
22350
22615
  let responsiveSecondaryLablesObj = responsiveSecondaryYaxisLabel(
@@ -22360,7 +22625,9 @@ const HorizontalBarChart = ({
22360
22625
  formatOptions.secondaryYAxisLabel.secondaryYAxisNumberFormat,
22361
22626
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelDecimalPrecision
22362
22627
  )
22363
- ).tickValues(responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
22628
+ ).tickValues(
22629
+ responsiveSecondaryLablesObj.autoLabelFlag ? void 0 : responsiveSecondaryLablesObj.secondaryYAxisLabelArray
22630
+ ).ticks(responsiveSecondaryLablesObj.secondaryCustomTickValue).tickSize(
22364
22631
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 : 0 : 0
22365
22632
  ).tickPadding(8).tickSizeOuter(0);
22366
22633
  }
@@ -22384,13 +22651,31 @@ const HorizontalBarChart = ({
22384
22651
  let column = gTag.selectAll(".parentGroup").data([data2], (d) => d.legend);
22385
22652
  column = column.enter().append("g").attr("class", "column parentGroup").merge(column);
22386
22653
  let columnGroups = column.selectAll(".column-group").data(data2.data, (d) => d.legend + d.dimension);
22387
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr("hoverId", (data2.properties.alias || data2.properties.name || "Legend").replace(/\s+/g, "-")).attr("transform", (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`);
22388
- columnGroups.attr("transform", (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`);
22389
- columnGroupsEnter.merge(columnGroups).attr("transform", (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`);
22654
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", "column-group").attr(
22655
+ "hoverId",
22656
+ (data2.properties.alias || data2.properties.name || "Legend").replace(
22657
+ /\s+/g,
22658
+ "-"
22659
+ )
22660
+ ).attr(
22661
+ "transform",
22662
+ (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
22663
+ );
22664
+ columnGroups.attr(
22665
+ "transform",
22666
+ (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
22667
+ );
22668
+ columnGroupsEnter.merge(columnGroups).attr(
22669
+ "transform",
22670
+ (d) => `translate(0, ${yScale(d.dimension) - columnWidth / 2})`
22671
+ );
22390
22672
  const bars = columnGroupsEnter.append("rect").attr("y", (d) => yScaleLegends(d.legend)).attr("height", yScaleLegends.bandwidth()).attr("x", (d) => {
22391
- const xScaleUsed = data2.properties.axis === "Primary" ? xScaleBottom : xScaleTop;
22673
+ const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
22392
22674
  return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(0);
22393
- }).attr("width", 0).attr("fill", data2.properties.color).attr("stroke-dasharray", (d) => d.stackBorderStyle === 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
22675
+ }).attr("width", 0).attr("fill", data2.properties.color).attr(
22676
+ "stroke-dasharray",
22677
+ (d) => d.stackBorderStyle === 2 ? "5,3" : "0"
22678
+ ).attr("stroke-width", (d) => `${d.stackBorderWidth}px`).attr(
22394
22679
  "stroke",
22395
22680
  (d) => data2.properties.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? data2.properties.stackBorderStyle : "none"
22396
22681
  ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr(
@@ -22399,11 +22684,11 @@ const HorizontalBarChart = ({
22399
22684
  );
22400
22685
  const finalBars = bars;
22401
22686
  finalBars.attr("x", (d) => {
22402
- const xScaleUsed = data2.properties.axis === "Primary" ? xScaleBottom : xScaleTop;
22687
+ const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
22403
22688
  return d.value >= 0 ? xScaleUsed(0) : xScaleUsed(d.value);
22404
22689
  }).attr("width", (d) => {
22405
- const xScaleUsed = data2.properties.axis === "Primary" ? xScaleBottom : xScaleTop;
22406
- const maxValue = data2.properties.axis === "Primary" ? customYaxisMaxValue : secondaryCustomYaxisMaxValue;
22690
+ const xScaleUsed = data2.properties.axis === axisTypes.primary ? xScaleBottom : xScaleTop;
22691
+ const maxValue = data2.properties.axis === axisTypes.primary ? customYaxisMaxValue : secondaryCustomYaxisMaxValue;
22407
22692
  if (d.value >= 0) {
22408
22693
  return maxValue && d.value > maxValue ? xScaleUsed(maxValue) - xScaleUsed(0) : xScaleUsed(d.value) - xScaleUsed(0);
22409
22694
  } else {
@@ -22426,7 +22711,11 @@ const HorizontalBarChart = ({
22426
22711
  {
22427
22712
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
22428
22713
  value: getNumberWithFormat(
22429
- [chartTypes.NormalizedStackLineChart, chartTypes.NormalizedStackAreaChart, ""].includes(chartType) ? d[1] - d[0] : d.value,
22714
+ [
22715
+ chartTypes.NormalizedStackLineChart,
22716
+ chartTypes.NormalizedStackAreaChart,
22717
+ ""
22718
+ ].includes(chartType) ? d[1] - d[0] : d.value,
22430
22719
  formatOptions.toolTip.toolTipDisplayUnits,
22431
22720
  formatOptions.toolTip.toolTipNumberFormat,
22432
22721
  formatOptions.toolTip.toolTipDecimalPrecision
@@ -22460,6 +22749,7 @@ const HorizontalBarChart = ({
22460
22749
  filteredData = fData;
22461
22750
  filteredDimension = fDimension;
22462
22751
  visibleBars = fVisibleBars;
22752
+ createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
22463
22753
  drawColumnChart();
22464
22754
  };
22465
22755
  const drawColumnChart = () => {
@@ -22578,6 +22868,7 @@ const StackHorizontalChart = ({
22578
22868
  let scrollbarVisible = false;
22579
22869
  let stackChartData = [];
22580
22870
  const isNormalizedChart = false;
22871
+ let totalValueMap = /* @__PURE__ */ new Map();
22581
22872
  let chartJSON = {
22582
22873
  dimensionList,
22583
22874
  chartType,
@@ -22701,7 +22992,7 @@ const StackHorizontalChart = ({
22701
22992
  width,
22702
22993
  legendMargin,
22703
22994
  formatOptions,
22704
- seriesData,
22995
+ [...seriesData].reverse(),
22705
22996
  chartId,
22706
22997
  staticLegendShape.rectangle
22707
22998
  );
@@ -22823,7 +23114,9 @@ const StackHorizontalChart = ({
22823
23114
  )
22824
23115
  ).tickSize(
22825
23116
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? -innerHeight2 : 0 : 0
22826
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
23117
+ ).tickValues(
23118
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
23119
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
22827
23120
  }
22828
23121
  };
22829
23122
  const getYAxis = () => {
@@ -22844,14 +23137,22 @@ const StackHorizontalChart = ({
22844
23137
  let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
22845
23138
  columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
22846
23139
  let columnGroups = columns.selectAll(".column-group").data((d) => d);
22847
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr("hoverId", (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-"));
23140
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
23141
+ "hoverId",
23142
+ (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
23143
+ );
22848
23144
  columnGroups = columnGroupsEnter.merge(columnGroups);
22849
23145
  let rects = columnGroups.selectAll("rect").data((d) => d);
22850
23146
  const getPropsForRect = (nodes, i) => {
22851
- const groupIndex = Array.from(columnGroups.nodes()).indexOf(nodes[i].parentNode);
23147
+ const groupIndex = Array.from(columnGroups.nodes()).indexOf(
23148
+ nodes[i].parentNode
23149
+ );
22852
23150
  return { props: seriesData[groupIndex]?.properties, groupIndex };
22853
23151
  };
22854
- const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr("fill", (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray").attr("stroke", (d, i, nodes) => {
23152
+ const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - columnWidth / 2).attr("height", columnWidth).attr(
23153
+ "fill",
23154
+ (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
23155
+ ).attr("stroke", (d, i, nodes) => {
22855
23156
  const props = getPropsForRect(nodes, i).props;
22856
23157
  return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
22857
23158
  }).attr(
@@ -22915,6 +23216,7 @@ const StackHorizontalChart = ({
22915
23216
  filteredData = fData;
22916
23217
  filteredDimension = fDimension;
22917
23218
  visibleBars = fVisibleBars;
23219
+ createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
22918
23220
  createStackLineData();
22919
23221
  drawLineChart();
22920
23222
  };
@@ -22966,6 +23268,21 @@ const StackHorizontalChart = ({
22966
23268
  isReportEditable,
22967
23269
  barChart
22968
23270
  );
23271
+ addTotalValue(
23272
+ totalValueMap,
23273
+ yScale,
23274
+ xScaleBottom,
23275
+ margin,
23276
+ d3Annotation,
23277
+ [],
23278
+ formatOptions,
23279
+ chartType,
23280
+ height,
23281
+ width,
23282
+ svg,
23283
+ isReportEditable,
23284
+ barChart
23285
+ );
22969
23286
  getConnectors();
22970
23287
  gTag.selectAll(".connectors").raise();
22971
23288
  };
@@ -23223,7 +23540,10 @@ const NormalizedStackHorizontalBarChart = ({
23223
23540
  let columnWidth = 0;
23224
23541
  const chartType = chartTypes.NormalizedStackHorizontalBarChart;
23225
23542
  const svgRef = useRef();
23226
- const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse();
23543
+ const seriesData = generalizedChartData(
23544
+ data.ChartData,
23545
+ data.DimensionList
23546
+ )?.reverse();
23227
23547
  const dimensionList = data.DimensionList;
23228
23548
  const barChart = true;
23229
23549
  const isSecondaryAxisDrawn = false;
@@ -23388,7 +23708,7 @@ const NormalizedStackHorizontalBarChart = ({
23388
23708
  width,
23389
23709
  legendMargin,
23390
23710
  formatOptions,
23391
- seriesData,
23711
+ [...seriesData].reverse(),
23392
23712
  chartId,
23393
23713
  staticLegendShape.rectangle
23394
23714
  );
@@ -23518,20 +23838,31 @@ const NormalizedStackHorizontalBarChart = ({
23518
23838
  let columns = gTag.selectAll(".parentGroup").data([stackChartData]);
23519
23839
  columns = columns.enter().append("g").attr("class", "columns parentGroup").merge(columns);
23520
23840
  let columnGroups = columns.selectAll(".column-group").data((d) => d);
23521
- let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr("hoverId", (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-"));
23841
+ let columnGroupsEnter = columnGroups.enter().append("g").attr("class", (d) => "column-group " + d.key.replace(/ /g, "-")).attr(
23842
+ "hoverId",
23843
+ (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
23844
+ );
23522
23845
  columnGroups = columnGroupsEnter.merge(columnGroups);
23523
23846
  let rects = columnGroups.selectAll("rect").data((d) => d);
23524
23847
  const getPropsForRect = (nodes, i) => {
23525
- const groupIndex = Array.from(columnGroups.nodes()).indexOf(nodes[i].parentNode);
23848
+ const groupIndex = Array.from(columnGroups.nodes()).indexOf(
23849
+ nodes[i].parentNode
23850
+ );
23526
23851
  return { props: seriesData[groupIndex]?.properties, groupIndex };
23527
23852
  };
23528
- const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - yScale.bandwidth() / 2).attr("height", yScale.bandwidth()).attr("fill", (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray").attr("stroke", (d, i, nodes) => {
23853
+ const baseRects = rects.enter().append("rect").merge(rects).attr("y", (d) => yScale(d.data.dimension) - yScale.bandwidth() / 2).attr("height", yScale.bandwidth()).attr(
23854
+ "fill",
23855
+ (d, i, nodes) => getPropsForRect(nodes, i).props?.color || "gray"
23856
+ ).attr("stroke", (d, i, nodes) => {
23529
23857
  const props = getPropsForRect(nodes, i).props;
23530
23858
  return props?.stackBorderStyle === 0 ? "none" : formatOptions.column.stackBorderVisibility ? props.stackBorderColor : "none";
23531
23859
  }).attr(
23532
23860
  "stroke-dasharray",
23533
23861
  (d, i, nodes) => getPropsForRect(nodes, i).props?.stackBorderStyle === 2 ? "5,3" : "0"
23534
- ).attr("stroke-width", (d, i, nodes) => (getPropsForRect(nodes, i).props?.stackBorderWidth || 0) + "px").style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("x", (d) => xScaleBottom(0)).attr("width", 0).attr("visibility", (d, i, nodes) => {
23862
+ ).attr(
23863
+ "stroke-width",
23864
+ (d, i, nodes) => (getPropsForRect(nodes, i).props?.stackBorderWidth || 0) + "px"
23865
+ ).style("clip-path", "inset(0px) fill-box").style("shape-rendering", "crispEdges").attr("x", (d) => xScaleBottom(0)).attr("width", 0).attr("visibility", (d, i, nodes) => {
23535
23866
  const props = getPropsForRect(nodes, i).props;
23536
23867
  return d.data[d.key] === 0 && props?.hideZeroValues ? "hidden" : "visible";
23537
23868
  }).on("mousemove", (event2, d) => {
@@ -25052,6 +25383,12 @@ const AreaChart = ({
25052
25383
  let yMinLeft = Infinity;
25053
25384
  let yMaxRight = -Infinity;
25054
25385
  let yMinRight = Infinity;
25386
+ if (formatOptions.plotArea.hideZeroValues) {
25387
+ chartJSON.hideZeroValues = true;
25388
+ seriesData.forEach((series) => {
25389
+ series.data = series.data.filter((d) => d.value !== 0);
25390
+ });
25391
+ }
25055
25392
  seriesData.forEach((series) => {
25056
25393
  legendList.push(
25057
25394
  series.properties.alias ? series.properties.alias : series.legend
@@ -25086,9 +25423,6 @@ const AreaChart = ({
25086
25423
  } else {
25087
25424
  filteredDimension = chartJSON.dimensionList;
25088
25425
  }
25089
- if (formatOptions.plotArea.hideZeroValues) {
25090
- chartJSON.hideZeroValues = true;
25091
- }
25092
25426
  };
25093
25427
  const initScale = () => {
25094
25428
  let yAxisLabelArray = responsiveYaxisLabel$1(
@@ -25152,7 +25486,9 @@ const AreaChart = ({
25152
25486
  )
25153
25487
  ).tickSize(
25154
25488
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
25155
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
25489
+ ).tickValues(
25490
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
25491
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
25156
25492
  }
25157
25493
  };
25158
25494
  const getXAxis = () => {
@@ -25181,7 +25517,13 @@ const AreaChart = ({
25181
25517
  areaGroupsEnter.append("path").attr("class", "area parentGroup").attr(
25182
25518
  "fill",
25183
25519
  (d) => d.properties.color !== "#ffffff" ? d.properties.color : "none"
25184
- ).style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("hoverId", (d) => (d.properties?.alias || d.properties?.name || "Legend").replace(/\s+/g, "-")).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
25520
+ ).style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr(
25521
+ "hoverId",
25522
+ (d) => (d.properties?.alias || d.properties?.name || "Legend").replace(
25523
+ /\s+/g,
25524
+ "-"
25525
+ )
25526
+ ).attr("d", (d) => areaGeneratorStart(d.data)).each(function(d) {
25185
25527
  {
25186
25528
  select$2(this).attr("d", areaGenerator(d.data));
25187
25529
  }
@@ -25192,25 +25534,28 @@ const AreaChart = ({
25192
25534
  "stroke",
25193
25535
  (d2) => d2.properties.areaBorderColor !== "#ffffff" ? d2.properties.areaBorderColor : "none"
25194
25536
  ).attr("stroke-dasharray", (d2) => {
25537
+ const lineWidth = parseInt(d2.properties.lineWidth);
25195
25538
  switch (d2.properties.lineStyle) {
25196
- case "dotted":
25197
- return "0,3";
25198
- case "dashed":
25199
- return "20,10,5,5,5,10";
25539
+ case staticLineStyle.dotted:
25540
+ return `0,${lineWidth + 2}`;
25541
+ case staticLineStyle.dashed:
25542
+ return strokeDashValues;
25200
25543
  default:
25201
25544
  return "";
25202
25545
  }
25203
25546
  }).attr(
25204
25547
  "stroke-linecap",
25205
- (d2) => d2.properties.lineStyle === "dotted" ? "round" : "butt"
25548
+ (d2) => d2.properties.lineStyle === staticLineStyle.dotted ? strokeLineCap.round : strokeLineCap.butt
25206
25549
  ).attr(
25207
25550
  "stroke-width",
25208
- (d2) => d2.properties.lineStyle !== "None" && formatOptions.plotArea.plotAreaHideLineAndMarkers ? "2.5" : "0"
25551
+ (d2) => d2.properties.lineStyle !== staticLineStyle.none && formatOptions.plotArea.plotAreaHideLineAndMarkers ? d2.properties.lineWidth : "0"
25209
25552
  ).attr("fill", "none");
25210
25553
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => areaGenerator(d2.data)).attr("fill", "transparent").attr("stroke", "none").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
25211
25554
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true).attr("stroke-width", "2.5");
25212
25555
  svg.selectAll(
25213
- '[hoverId="' + getJQuerySelector(d2.properties?.alias || d2.properties?.name || "Legend").replace(/\s+/g, "-") + '"]'
25556
+ '[hoverId="' + getJQuerySelector(
25557
+ d2.properties?.alias || d2.properties?.name || "Legend"
25558
+ ).replace(/\s+/g, "-") + '"]'
25214
25559
  ).classed("highlight", true).classed("unhighlight", false).attr("stroke-width", "3.5");
25215
25560
  }).on("mouseleave", function(event2, d2) {
25216
25561
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false).attr("stroke-width", "2.5");
@@ -25358,10 +25703,7 @@ const StackAreaChart = ({
25358
25703
  const barWidth = 0;
25359
25704
  const chartType = chartTypes.StackAreaChart;
25360
25705
  const svgRef = useRef();
25361
- const seriesData = generalizedChartData(
25362
- data.ChartData,
25363
- data.DimensionList
25364
- )?.reverse() || [];
25706
+ const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
25365
25707
  const dimensionList = data.DimensionList;
25366
25708
  const barChart = false;
25367
25709
  const isSecondaryAxisDrawn = false;
@@ -25385,6 +25727,7 @@ const StackAreaChart = ({
25385
25727
  let secondaryYLabel;
25386
25728
  let maxNumberForPrimaryAxis;
25387
25729
  let maxNumberForSecondaryAxis;
25730
+ let totalValueMap = /* @__PURE__ */ new Map();
25388
25731
  let innerWidth2;
25389
25732
  let innerHeight2;
25390
25733
  let width;
@@ -25552,7 +25895,7 @@ const StackAreaChart = ({
25552
25895
  width,
25553
25896
  legendMargin,
25554
25897
  formatOptions,
25555
- seriesData,
25898
+ [...seriesData].reverse(),
25556
25899
  chartId,
25557
25900
  staticLegendShape.areaWithLine
25558
25901
  );
@@ -25575,6 +25918,12 @@ const StackAreaChart = ({
25575
25918
  const preProcessChartData = () => {
25576
25919
  const allChartData = [];
25577
25920
  const legendList = [];
25921
+ if (formatOptions.plotArea.hideZeroValues) {
25922
+ chartJSON.hideZeroValues = true;
25923
+ seriesData.forEach((series) => {
25924
+ series.data = series.data.filter((d) => d.value !== 0);
25925
+ });
25926
+ }
25578
25927
  seriesData.forEach((series, index2) => {
25579
25928
  const prefixedLegend = `${index2}~$~${series.properties.alias}`;
25580
25929
  series.properties.legend = prefixedLegend;
@@ -25623,9 +25972,6 @@ const StackAreaChart = ({
25623
25972
  chartJSON.dimensionList.forEach((d, i) => {
25624
25973
  chartJSON.formattedDimensionListMap.set(d, formatedDimensionList[i]);
25625
25974
  });
25626
- if (formatOptions.plotArea.hideZeroValues) {
25627
- chartJSON.hideZeroValues = true;
25628
- }
25629
25975
  };
25630
25976
  const initScale = () => {
25631
25977
  let yAxisLabelArray = responsiveYaxisLabel$1(
@@ -25689,7 +26035,9 @@ const StackAreaChart = ({
25689
26035
  )
25690
26036
  ).tickSize(
25691
26037
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
25692
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
26038
+ ).tickValues(
26039
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
26040
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
25693
26041
  }
25694
26042
  };
25695
26043
  const getXAxis = () => {
@@ -25719,29 +26067,34 @@ const StackAreaChart = ({
25719
26067
  areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
25720
26068
  let areaGroups = areas.selectAll(".area-group").data((d) => d);
25721
26069
  let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
25722
- areaGroupsEnter.append("path").attr("hoverId", (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).each(function(d) {
26070
+ areaGroupsEnter.append("path").attr(
26071
+ "hoverId",
26072
+ (d) => (lineData[d.index].properties.alias || lineData[d.index].properties.name || "Legend").replace(/\s+/g, "-")
26073
+ ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => areaGeneratorStart(d)).each(function(d) {
25723
26074
  {
25724
26075
  select$2(this).attr("d", areaGenerator(d));
25725
26076
  }
25726
26077
  });
25727
26078
  areaGroupsEnter.merge(areaGroups).each(function(d, i) {
25728
26079
  const g = select$2(this);
25729
- g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => areaGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", () => {
25730
- const style = seriesData[i]?.properties?.lineStyle;
25731
- switch (style) {
25732
- case "dotted":
25733
- return "0,3";
25734
- case "dashed":
25735
- return "20,10,5,5,5,10";
26080
+ g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => areaGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", (d2) => {
26081
+ const lineWidth = parseInt(
26082
+ seriesData[i].properties.lineWidth.toString()
26083
+ );
26084
+ switch (seriesData[i].properties.lineStyle) {
26085
+ case staticLineStyle.dotted:
26086
+ return `0,${lineWidth + 2}`;
26087
+ case staticLineStyle.dashed:
26088
+ return strokeDashValues;
25736
26089
  default:
25737
26090
  return "";
25738
26091
  }
25739
26092
  }).attr(
25740
26093
  "stroke-linecap",
25741
- () => seriesData[i]?.properties?.lineStyle === "dotted" ? "round" : ""
26094
+ () => seriesData[i]?.properties?.lineStyle.toLowerCase() === staticLineStyle.dotted ? strokeLineCap.round : ""
25742
26095
  ).attr(
25743
26096
  "stroke-width",
25744
- (d2, i2) => seriesData[i2].properties.lineStyle !== "None" ? seriesData[i2].properties.lineWidth : "0"
26097
+ (d2, i2) => seriesData[i2].properties.lineStyle !== staticLineStyle.none ? seriesData[i2].properties.lineWidth : "0"
25745
26098
  ).attr("fill", "none").style("pointer-events", "none");
25746
26099
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => areaGenerator(d2)).attr("fill", "transparent").attr("stroke", "none").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
25747
26100
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
@@ -25792,6 +26145,7 @@ const StackAreaChart = ({
25792
26145
  filteredData = fData;
25793
26146
  filteredDimension = fDimension;
25794
26147
  visibleBars = fVisibleBars;
26148
+ createTotalMeasureValueMap(data, totalValueMap, filteredDimension);
25795
26149
  createStackLineData();
25796
26150
  drawLineChart();
25797
26151
  };
@@ -25851,6 +26205,20 @@ const StackAreaChart = ({
25851
26205
  true
25852
26206
  ).labelArray;
25853
26207
  drawSeriesLabels(formatOptions, gTag, newSeriesLabelArray);
26208
+ addTotalValue(
26209
+ totalValueMap,
26210
+ xScale,
26211
+ yScaleLeft,
26212
+ margin,
26213
+ d3Annotation,
26214
+ [],
26215
+ formatOptions,
26216
+ chartType,
26217
+ height,
26218
+ width,
26219
+ svg,
26220
+ isReportEditable
26221
+ );
25854
26222
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
25855
26223
  if (formatOptions.xAxisLabel.xAxisPosition != "1")
25856
26224
  formatOptions.xAxisLabel.xAxisLabelVisibility = false;
@@ -25903,6 +26271,7 @@ const StackAreaChart = ({
25903
26271
  d["hideZero"] = JSON.parse(
25904
26272
  JSON.stringify(seriesData[j].properties.hideZeroValues)
25905
26273
  );
26274
+ d["properties"] = seriesData[j].properties;
25906
26275
  })
25907
26276
  );
25908
26277
  };
@@ -25926,10 +26295,7 @@ const NormalizedStackAreaChart = ({
25926
26295
  const barWidth = 0;
25927
26296
  const chartType = chartTypes.NormalizedStackAreaChart;
25928
26297
  const svgRef = useRef();
25929
- const seriesData = generalizedChartData(
25930
- data.ChartData,
25931
- data.DimensionList
25932
- )?.reverse() || [];
26298
+ const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse() || [];
25933
26299
  const dimensionList = data.DimensionList;
25934
26300
  const barChart = false;
25935
26301
  const isSecondaryAxisDrawn = false;
@@ -26112,7 +26478,7 @@ const NormalizedStackAreaChart = ({
26112
26478
  width,
26113
26479
  legendMargin,
26114
26480
  formatOptions,
26115
- seriesData,
26481
+ [...seriesData].reverse(),
26116
26482
  chartId,
26117
26483
  staticLegendShape.areaWithLine
26118
26484
  );
@@ -26134,6 +26500,12 @@ const NormalizedStackAreaChart = ({
26134
26500
  const preProcessChartData = () => {
26135
26501
  const allChartData = [];
26136
26502
  const legendList = [];
26503
+ if (formatOptions.plotArea.hideZeroValues) {
26504
+ chartJSON.hideZeroValues = true;
26505
+ seriesData.forEach((series) => {
26506
+ series.data = series.data.filter((d) => d.value !== 0);
26507
+ });
26508
+ }
26137
26509
  seriesData.forEach((series, index2) => {
26138
26510
  const prefixedLegend = `${index2}~$~${series.properties.alias}`;
26139
26511
  series.properties.legend = prefixedLegend;
@@ -26158,9 +26530,6 @@ const NormalizedStackAreaChart = ({
26158
26530
  } else {
26159
26531
  filteredDimension = chartJSON.dimensionList;
26160
26532
  }
26161
- if (formatOptions.plotArea.hideZeroValues) {
26162
- chartJSON.hideZeroValues = true;
26163
- }
26164
26533
  const tempStackLineData = getStackedData(
26165
26534
  chartJSON.dimensionList,
26166
26535
  seriesData,
@@ -26231,8 +26600,10 @@ const NormalizedStackAreaChart = ({
26231
26600
  stackChartData.forEach(
26232
26601
  (data2, i) => data2.forEach((item, position) => {
26233
26602
  const total = item.data.total;
26234
- lineData[i].data[position][0] = item[0] = total === 0 ? 0 : item[0] / total;
26235
- lineData[i].data[position][1] = item[1] = total === 0 ? 0 : item[1] / total;
26603
+ if (lineData[i].data[position]) {
26604
+ lineData[i].data[position][0] = item[0] = total === 0 ? 0 : item[0] / total;
26605
+ lineData[i].data[position][1] = item[1] = total === 0 ? 0 : item[1] / total;
26606
+ }
26236
26607
  })
26237
26608
  );
26238
26609
  lineData.forEach((lData) => {
@@ -26254,7 +26625,10 @@ const NormalizedStackAreaChart = ({
26254
26625
  areas = areas.enter().append("g").attr("class", "areas lineGroup").merge(areas);
26255
26626
  let areaGroups = areas.selectAll(".area-group").data((d) => d);
26256
26627
  let areaGroupsEnter = areaGroups.enter().append("g").attr("class", (d) => "area-group " + d.key.replace(/ /g, "-"));
26257
- areaGroupsEnter.append("path").attr("hoverId", (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).each(function(d) {
26628
+ areaGroupsEnter.append("path").attr(
26629
+ "hoverId",
26630
+ (d) => (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/\s+/g, "-")
26631
+ ).attr("class", "area parentGroup").attr("fill", (d) => d.color !== "#ffffff" ? d.color : "none").style("fill-opacity", formatOptions.plotArea.fillOpacity).style("pointer-events", "none").attr("d", (d) => columnGeneratorStart(d)).each(function(d) {
26258
26632
  const path2 = select$2(this);
26259
26633
  {
26260
26634
  path2.attr("d", columnGenerator(d));
@@ -26262,33 +26636,39 @@ const NormalizedStackAreaChart = ({
26262
26636
  });
26263
26637
  areaGroupsEnter.merge(areaGroups).each(function(d, i) {
26264
26638
  const g = select$2(this);
26265
- g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => columnGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", () => {
26266
- const style = seriesData[i]?.properties?.lineStyle;
26267
- switch (style) {
26268
- case "dotted":
26269
- return "0,3";
26270
- case "dashed":
26271
- return "20,10,5,5,5,10";
26639
+ g.selectAll("path.visibleLine").data([d]).join("path").attr("class", "visibleLine parentGroup").attr("d", (d2) => columnGenerator(d2)).attr("stroke", (d2) => d2.color !== "#ffffff" ? d2.color : "none").attr("stroke-dasharray", (d2) => {
26640
+ const lineWidth = parseInt(
26641
+ seriesData[i].properties.lineWidth.toString()
26642
+ );
26643
+ switch (seriesData[i].properties.lineStyle) {
26644
+ case staticLineStyle.dotted:
26645
+ return `0,${lineWidth + 2}`;
26646
+ case staticLineStyle.dashed:
26647
+ return strokeDashValues;
26272
26648
  default:
26273
26649
  return "";
26274
26650
  }
26275
26651
  }).attr(
26276
26652
  "stroke-linecap",
26277
- () => seriesData[i]?.properties?.lineStyle === "dotted" ? "round" : ""
26653
+ () => seriesData[i]?.properties?.lineStyle.toLowerCase() === staticLineStyle.dotted ? strokeLineCap.round : ""
26278
26654
  ).attr(
26279
26655
  "stroke-width",
26280
- (d2, i2) => seriesData[i2].properties.lineStyle !== "None" ? seriesData[i2].properties.lineWidth : "0"
26656
+ (d2, i2) => seriesData[i2].properties.lineStyle !== staticLineStyle.none ? seriesData[i2].properties.lineWidth : "0"
26281
26657
  ).attr("fill", "none").style("pointer-events", "none");
26282
26658
  g.selectAll("path.hoverLine").data([d]).join("path").attr("class", "hoverLine").attr("d", (d2) => columnGenerator(d2)).attr("fill", "transparent").style("pointer-events", "all").raise().on("mouseenter", function(event2, d2) {
26283
26659
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", true);
26284
26660
  svg.selectAll(
26285
- '[hoverId="' + getJQuerySelector((lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend").replace(/ /g, "-")) + '"]'
26661
+ '[hoverId="' + getJQuerySelector(
26662
+ (lineData[d2.index]?.properties?.alias || lineData[d2.index]?.properties?.name || "Legend").replace(/ /g, "-")
26663
+ ) + '"]'
26286
26664
  ).classed("highlight", true).classed("unhighlight", false);
26287
26665
  }).on("mouseleave", function() {
26288
26666
  svg.selectAll(".parentGroup").classed("highlight", false).classed("unhighlight", false);
26289
26667
  });
26290
26668
  svg.selectAll(
26291
- '[hoverId="' + getJQuerySelector((lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/ /g, "-")) + '"]'
26669
+ '[hoverId="' + getJQuerySelector(
26670
+ (lineData[d.index]?.properties?.alias || lineData[d.index]?.properties?.name || "Legend").replace(/ /g, "-")
26671
+ ) + '"]'
26292
26672
  ).classed("highlight", false).classed("unhighlight", false);
26293
26673
  });
26294
26674
  areaGroups.exit().remove();
@@ -26425,8 +26805,10 @@ const NormalizedStackAreaChart = ({
26425
26805
  stackChartData = stack().keys(chartJSON.legendList).offset(none$3)(stackLineData2);
26426
26806
  filteredData.forEach(
26427
26807
  (data2, index2) => data2.data.forEach((axisData, position) => {
26428
- axisData["0"] = stackChartData[index2][position][0];
26429
- axisData["1"] = stackChartData[index2][position][1];
26808
+ if (stackChartData[index2][position]) {
26809
+ axisData["0"] = stackChartData[index2][position][0];
26810
+ axisData["1"] = stackChartData[index2][position][1];
26811
+ }
26430
26812
  })
26431
26813
  );
26432
26814
  let seriesColor = formatOptions.annotation.annotationSetLabelColor;
@@ -27493,29 +27875,33 @@ const Treemap = ({ data, formatOptions, chartId }) => {
27493
27875
  );
27494
27876
  }).on("mouseout", () => hideTooltipOnMouseOut());
27495
27877
  leaf.append("clipPath").attr("id", (d, i) => `clip-${i}-${chartId}`).append("rect").attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
27496
- leaf.append("text").style("fill", (d) => d.data.properties.labelFontColor).style("font-family", (d) => d.data.properties.fontFamily).style("font-size", (d) => d.data.properties.fontSize).style(
27497
- "font-style",
27498
- (d) => d.data.properties.fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
27499
- ).style(
27500
- "text-decoration",
27501
- (d) => d.data.properties.fontStyle.includes(fontStyleOptions.underline) ? fontStyleOptions.underline : ""
27502
- ).style(
27503
- "font-weight",
27504
- (d) => d.data.properties.fontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""
27505
- ).attr("clip-path", (d, i) => `url(#clip-${i}-${chartId})`);
27506
- if (chartFormatOptions.plotArea.dataLabelName) {
27507
- leaf.selectAll("text").append("tspan").attr("x", 5).attr("y", "1.1em").text((d) => d.data.legend);
27878
+ if (chartFormatOptions.plotArea.dataLabels) {
27879
+ leaf.append("text").style("fill", (d) => d.data.properties.labelFontColor).style("font-family", (d) => d.data.properties.fontFamily).style("font-size", (d) => d.data.properties.fontSize).style(
27880
+ "font-style",
27881
+ (d) => d.data.properties.fontStyle.includes(fontStyleOptions.italic) ? fontStyleOptions.italic : ""
27882
+ ).style(
27883
+ "text-decoration",
27884
+ (d) => d.data.properties.fontStyle.includes(fontStyleOptions.underline) ? fontStyleOptions.underline : ""
27885
+ ).style(
27886
+ "font-weight",
27887
+ (d) => d.data.properties.fontStyle.includes(fontStyleOptions.bold) ? fontStyleOptions.bold : ""
27888
+ ).attr("clip-path", (d, i) => `url(#clip-${i}-${chartId})`);
27889
+ if (chartFormatOptions.plotArea.dataLabelName) {
27890
+ leaf.selectAll("text").append("tspan").attr("x", 5).attr("y", "1.1em").text((d) => d.data.legend);
27891
+ }
27892
+ if (chartFormatOptions.plotArea.dataLabelValue) {
27893
+ leaf.selectAll("text").append("tspan").attr("x", 5).attr(
27894
+ "y",
27895
+ chartFormatOptions.plotArea.dataLabelName ? "2.1em" : "1.1em"
27896
+ ).text(
27897
+ (d) => getNumberWithFormatFunction(
27898
+ chartFormatOptions.plotArea.plotAreaDisplayUnits,
27899
+ chartFormatOptions.plotArea.dataLabelNumberFormat,
27900
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
27901
+ )(d.data.data[0].value)
27902
+ );
27903
+ }
27508
27904
  }
27509
- leaf.selectAll("text").append("tspan").attr("x", 5).attr(
27510
- "y",
27511
- chartFormatOptions.plotArea.dataLabelName ? "2.1em" : "1.1em"
27512
- ).text(
27513
- (d) => getNumberWithFormatFunction(
27514
- chartFormatOptions.plotArea.plotAreaDisplayUnits,
27515
- chartFormatOptions.plotArea.dataLabelNumberFormat,
27516
- chartFormatOptions.plotArea.dataLabelDecimalPrecision
27517
- )(d.data.data[0].value)
27518
- );
27519
27905
  } catch (error) {
27520
27906
  logError$2(fileName$6, "initChartRect", error);
27521
27907
  }
@@ -27934,18 +28320,6 @@ const PieofPie = ({
27934
28320
  data: []
27935
28321
  };
27936
28322
  });
27937
- initLegendListWithTotalValueAllowance(
27938
- chartFormatOptions,
27939
- svg,
27940
- seriesData,
27941
- width,
27942
- height,
27943
- legendListWidth,
27944
- chartTitleHeight,
27945
- chartId,
27946
- margins,
27947
- staticLegendShape.circle
27948
- );
27949
28323
  } catch (error) {
27950
28324
  logError$2(fileName$5, "initLegendList", error);
27951
28325
  }
@@ -28536,9 +28910,9 @@ const ProgressChart = ({
28536
28910
  chartFormatOptions.plotArea.dataLabelValueFontFamily
28537
28911
  ).attr("font-size", chartFormatOptions.plotArea.dataLabelValueFontSize).text(() => {
28538
28912
  return chartFormatOptions.plotArea.dataLabelNumberFormatProgress == ",.0%" ? Math.round(progressValue / maxValue * 100) + "%" : getNumberWithFormatFunction(
28539
- chartFormatOptions.plotArea.dataLabelDecimalPrecision,
28913
+ chartFormatOptions.plotArea.plotAreaDisplayUnits,
28540
28914
  chartFormatOptions.plotArea.dataLabelNumberFormatProgress,
28541
- chartFormatOptions.plotArea.plotAreaDisplayUnits
28915
+ chartFormatOptions.plotArea.dataLabelDecimalPrecision
28542
28916
  )(progressValue);
28543
28917
  });
28544
28918
  } catch (error) {
@@ -28622,10 +28996,9 @@ const Speedometer = ({
28622
28996
  positionDominatorName = "height";
28623
28997
  }
28624
28998
  positionTransformString = centerTranslation(positionDominatorName);
28625
- innerRadius = Math.min(
28626
- convertStringToNumber(chartFormatOptions.plotArea.innerRadius) / 100 * radius,
28627
- radius
28628
- );
28999
+ innerRadius = convertStringToNumber(
29000
+ chartFormatOptions.plotArea.innerRadiusForSpeedometer
29001
+ ) / 100 * radius;
28629
29002
  } catch (error) {
28630
29003
  logError$2(fileName2, "initChartRadius", error);
28631
29004
  }
@@ -28682,9 +29055,12 @@ const Speedometer = ({
28682
29055
  }
28683
29056
  }
28684
29057
  } else {
28685
- if ([colorThemeTypes.none, colorThemeTypes.discrete].includes(
28686
- chartFormatOptions.colorScale.showColor
28687
- )) {
29058
+ if (chartFormatOptions.colorScale.showColor == colorThemeTypes.none) {
29059
+ const color2 = ChartData[0].properties?.color ?? "#bac8de";
29060
+ for (let index2 = 1; index2 <= customTicksCount; index2++) {
29061
+ colorThemeArray.push(color2);
29062
+ }
29063
+ } else if (chartFormatOptions.colorScale.showColor == colorThemeTypes.discrete) {
28688
29064
  for (let index2 = 1; index2 <= customTicksCount; index2++) {
28689
29065
  colorThemeArray.push(
28690
29066
  chartFormatOptions.colorScale["division" + index2]
@@ -53546,7 +53922,9 @@ const WaterfallChart = ({
53546
53922
  if (formatOptions.xAxisLabel.hideZeroValues) {
53547
53923
  if (tempDimensionList.length > 0) {
53548
53924
  tempDimensionList.forEach((dimension) => {
53549
- chartJSON.legendList = chartJSON.legendList.filter((dim) => dim !== dimension);
53925
+ chartJSON.legendList = chartJSON.legendList.filter(
53926
+ (dim) => dim !== dimension
53927
+ );
53550
53928
  });
53551
53929
  }
53552
53930
  chartJSON.dimensionList = chartJSON.legendList;
@@ -53565,7 +53943,11 @@ const WaterfallChart = ({
53565
53943
  tempWaterfallChartData && tempWaterfallChartData.forEach((d, i) => {
53566
53944
  if (d.dimension) {
53567
53945
  tempDimensionList.push(d.dimension);
53568
- tempDimensionListWithIndex.push({ dimension: d.dimension, chartDataIndex: i, selfIndex: tempDimensionListWithIndex.length });
53946
+ tempDimensionListWithIndex.push({
53947
+ dimension: d.dimension,
53948
+ chartDataIndex: i,
53949
+ selfIndex: tempDimensionListWithIndex.length
53950
+ });
53569
53951
  }
53570
53952
  });
53571
53953
  if (isDateType) {
@@ -53576,7 +53958,9 @@ const WaterfallChart = ({
53576
53958
  } else {
53577
53959
  tempformatedDimensionList = tempDimensionList;
53578
53960
  }
53579
- let formatedDimensionList = JSON.parse(JSON.stringify(chartJSON.legendList));
53961
+ let formatedDimensionList = JSON.parse(
53962
+ JSON.stringify(chartJSON.legendList)
53963
+ );
53580
53964
  tempDimensionListWithIndex.forEach((listItem, i) => {
53581
53965
  formatedDimensionList[listItem.chartDataIndex] = tempformatedDimensionList[listItem.selfIndex];
53582
53966
  });
@@ -53649,7 +54033,9 @@ const WaterfallChart = ({
53649
54033
  )
53650
54034
  ).tickSize(
53651
54035
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -innerWidth2 + (seriesLabelWidth ? seriesLabelWidth : 0) : 0 : 0
53652
- ).tickValues(responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
54036
+ ).tickValues(
54037
+ responsiveLablesObj.autoLabelFlag ? void 0 : responsiveLablesObj.yAxisLabelArray
54038
+ ).ticks(responsiveLablesObj.customTickValue).tickPadding(8).tickSizeOuter(0);
53653
54039
  }
53654
54040
  colorScale = ordinal().domain(["base", "dimensionTotal", "up", "down"]).range([
53655
54041
  formatOptions.plotArea.totalColor,
@@ -53665,9 +54051,7 @@ const WaterfallChart = ({
53665
54051
  };
53666
54052
  const getChartType = (lineData) => {
53667
54053
  let totalStackData;
53668
- waterFallData.forEach(
53669
- (K2, j) => K2.forEach((d) => d["key"] = K2.key)
53670
- );
54054
+ waterFallData.forEach((K2, j) => K2.forEach((d) => d["key"] = K2.key));
53671
54055
  if (stackTotalData) {
53672
54056
  let stackDataLegendList = filteredData.map((name) => name.legend);
53673
54057
  totalStackData = stack().keys(stackDataLegendList)(stackTotalData);
@@ -53686,10 +54070,30 @@ const WaterfallChart = ({
53686
54070
  let parentGroup = gTag.selectAll(`.parentGroup-${k2}`).data([null]);
53687
54071
  parentGroup = parentGroup.enter().append("g").attr("class", `parentGroup parentGroup-${k2}`).merge(parentGroup);
53688
54072
  let barGroups = parentGroup.selectAll(`.bar-group-${k2}`).data(waterFallData);
53689
- const barGroupsEnter = barGroups.enter().append("g").attr("class", `bar-group-${k2}`).attr("fill", (d) => d.color ? d.color : colorScale(d.key) !== "#ffffff" ? colorScale(d.key) : "none").attr("opacity", (d) => d.opacity);
54073
+ const barGroupsEnter = barGroups.enter().append("g").attr("class", `bar-group-${k2}`).attr(
54074
+ "fill",
54075
+ (d) => d.color ? d.color : colorScale(d.key) !== "#ffffff" ? colorScale(d.key) : "none"
54076
+ ).attr("opacity", (d) => d.opacity);
53690
54077
  barGroups = barGroupsEnter.merge(barGroups);
53691
- let rects = barGroups.selectAll("rect").data((d) => d, (d) => d.key || d.Key);
53692
- const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr("class", (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")).attr("x", (d) => xScale(!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey)).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr("height", (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0).attr("width", xScale.bandwidth()).attr("visibility", (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible").style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
54078
+ let rects = barGroups.selectAll("rect").data(
54079
+ (d) => d,
54080
+ (d) => d.key || d.Key
54081
+ );
54082
+ const rectsEnter = rects.enter().append("rect").attr("class", "rect").attr(
54083
+ "class",
54084
+ (d) => d.key ? d.key.replace(/ /g, "-") : d.Key.replace(/ /g, "-")
54085
+ ).attr(
54086
+ "x",
54087
+ (d) => xScale(
54088
+ !isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
54089
+ )
54090
+ ).attr("y", (d) => d[1] ? yScaleLeft(d[1]) : 0).attr(
54091
+ "height",
54092
+ (d) => d[1] ? yScaleLeft(d[0]) - yScaleLeft(d[1]) : 0
54093
+ ).attr("width", xScale.bandwidth()).attr(
54094
+ "visibility",
54095
+ (d) => k2 === 0 && d.data.dimension && stackTotalData ? "hidden" : "visible"
54096
+ ).style("shape-rendering", "crispEdges").on("mousemove", (event2, d) => {
53693
54097
  const markerInfo = {
53694
54098
  markerShape: "square",
53695
54099
  markerColor: d.key === "dimensionTotal" ? formatOptions.plotArea.totalColor : d.key === "down" ? formatOptions.plotArea.negativeColor : formatOptions.plotArea.positiveColor
@@ -53728,7 +54132,15 @@ const WaterfallChart = ({
53728
54132
  formatOptions.plotArea.dataLabelNumberFormat,
53729
54133
  formatOptions.plotArea.dataLabelDecimalPrecision
53730
54134
  )
53731
- ).attr("x", (d) => xScale(!isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey) + columnWidth / 2).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr("visibility", (d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden");
54135
+ ).attr(
54136
+ "x",
54137
+ (d) => xScale(
54138
+ !isAdvancedWaterfall ? d.data.dimension || d.data.legend : d.data.xKey
54139
+ ) + xScale.bandwidth() / 2
54140
+ ).attr("y", (d) => d[1] ? yScaleLeft(d[1]) - 15 : 0).style("font-size", "11px").attr("text-anchor", "middle").attr(
54141
+ "visibility",
54142
+ (d) => d[1] - d[0] !== 0 && yScaleLeft(d[1]) ? "visible" : "hidden"
54143
+ );
53732
54144
  textGroups.exit().remove();
53733
54145
  }
53734
54146
  }
@@ -53891,7 +54303,11 @@ const WaterfallChart = ({
53891
54303
  tempWaterFallData.push(waterFallArr2);
53892
54304
  if (dataRequiredForStackTotal.length > 0) {
53893
54305
  filteredData = dataRequiredForStackTotal;
53894
- stackTotalData = getStackedData(filteredDimension, dataRequiredForStackTotal, false);
54306
+ stackTotalData = getStackedData(
54307
+ filteredDimension,
54308
+ dataRequiredForStackTotal,
54309
+ false
54310
+ );
53895
54311
  }
53896
54312
  return tempWaterFallData;
53897
54313
  } catch (error) {
@@ -53899,14 +54315,8 @@ const WaterfallChart = ({
53899
54315
  }
53900
54316
  };
53901
54317
  const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
53902
- const isNonZero = (v) => !Number.isNaN(toNumber(v)) && toNumber(v) !== 0;
53903
54318
  const mapAdvancedWaterfallData = (rawData) => {
53904
- return rawData.filter((d) => d.Column1 && d.Column1 !== "*").filter((d) => {
53905
- const base = toNumber(d.Column3);
53906
- const up = toNumber(d.Column4);
53907
- const down = toNumber(d.Column5);
53908
- return isNonZero(base) || isNonZero(up) || isNonZero(down);
53909
- }).map((d) => ({
54319
+ return rawData.filter((d) => d.Column1 && d.Column1 !== "*").map((d) => ({
53910
54320
  xKey: d.Column1,
53911
54321
  base: toNumber(d.Column3),
53912
54322
  up: toNumber(d.Column4),
@@ -53934,7 +54344,7 @@ const TornadoChart = ({
53934
54344
  const chartId = crypto.randomUUID();
53935
54345
  let columnWidth = 0;
53936
54346
  const chartType = chartTypes.TornadoChart;
53937
- const IsadvanceanalyticsChart = data.IsadvanceanalyticsChart;
54347
+ const isAdvanceAnalyticsChart = data.IsadvanceanalyticsChart ?? false;
53938
54348
  const svgRef = useRef();
53939
54349
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53940
54350
  const dimensionList = data.DimensionList;
@@ -54006,6 +54416,7 @@ const TornadoChart = ({
54006
54416
  svgRef,
54007
54417
  formatOptions
54008
54418
  ));
54419
+ formatOptions.xAxisLabel.labelTextWrap = false;
54009
54420
  preProcessChartData();
54010
54421
  ({ maxNumberForPrimaryAxis, maxNumberForSecondaryAxis } = customYscaleLabelFormatting$1(
54011
54422
  // for calculating primary/secondary axis max number so that we can calculate margin accordinglt
@@ -54034,7 +54445,7 @@ const TornadoChart = ({
54034
54445
  maxNumberForSecondaryAxis,
54035
54446
  chartJSON.yMaxLeft,
54036
54447
  formatOptions,
54037
- !IsadvanceanalyticsChart ? chartJSON.legendList.map((d) => d["alias"]) : chartJSON.legendList.map((d) => d["alias"].split(" - ")[0]),
54448
+ !isAdvanceAnalyticsChart ? chartJSON.legendList.map((d) => d["alias"]) : chartJSON.legendList.map((d) => d["alias"].split(" - ")[0]),
54038
54449
  chartJSON.dimensionList,
54039
54450
  chartJSON.yMaxRight,
54040
54451
  isSecondaryAxisDrawn,
@@ -54162,24 +54573,23 @@ const TornadoChart = ({
54162
54573
  mapSeriesDataWithLegendList(
54163
54574
  seriesData,
54164
54575
  chartJSON.legendList,
54165
- IsadvanceanalyticsChart,
54576
+ isAdvanceAnalyticsChart,
54166
54577
  formatOptions
54167
54578
  ),
54168
54579
  chartId,
54169
- staticLegendShape.rectangle,
54170
- chartType
54580
+ staticLegendShape.rectangle
54171
54581
  );
54172
54582
  };
54173
- const mapSeriesDataWithLegendList = (seriesData2, legendList, IsadvanceanalyticsChart2, formatOptions2) => {
54583
+ const mapSeriesDataWithLegendList = (seriesData2, legendList, isAdvanceAnalyticsChart2, formatOptions2) => {
54174
54584
  return seriesData2.map((series, index2) => {
54175
54585
  const legend = legendList[index2];
54176
54586
  if (!legend) return { ...series, properties: {} };
54177
54587
  let updatedAlias = legend.alias;
54178
- if (IsadvanceanalyticsChart2 && legend.alias) {
54588
+ if (isAdvanceAnalyticsChart2 && legend.alias) {
54179
54589
  updatedAlias = legend.alias.split(" - ")[0].trim();
54180
54590
  }
54181
54591
  let updatedColor = legend.color;
54182
- if (IsadvanceanalyticsChart2 && updatedAlias) {
54592
+ if (isAdvanceAnalyticsChart2 && updatedAlias) {
54183
54593
  if (updatedAlias.includes("+ve")) {
54184
54594
  updatedColor = formatOptions2.plotArea.plotAreaCalculatedHigh;
54185
54595
  } else if (updatedAlias.includes("-ve")) {
@@ -54200,7 +54610,7 @@ const TornadoChart = ({
54200
54610
  };
54201
54611
  const preProcessChartData = () => {
54202
54612
  let processedSeriesData;
54203
- if (!IsadvanceanalyticsChart) {
54613
+ if (!isAdvanceAnalyticsChart) {
54204
54614
  const firstMeasure = seriesData[0]?.properties.currentMeasure;
54205
54615
  let yMaxLeft = 0;
54206
54616
  let yMaxRight = -Infinity;
@@ -54234,12 +54644,13 @@ const TornadoChart = ({
54234
54644
  chartJSON.dimensionList
54235
54645
  ) : chartJSON.dimensionList;
54236
54646
  chartJSON.dimensionList.forEach((dim, i) => {
54237
- chartJSON.formattedDimensionListMap.set(
54238
- dim,
54239
- formatedDimensionList[i]
54240
- );
54647
+ chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
54241
54648
  });
54242
- filteredData = JSON.parse(JSON.stringify(!IsadvanceanalyticsChart ? processedSeriesData : seriesData));
54649
+ filteredData = JSON.parse(
54650
+ JSON.stringify(
54651
+ !isAdvanceAnalyticsChart ? processedSeriesData : seriesData
54652
+ )
54653
+ );
54243
54654
  filteredDimension = !formatOptions.plotArea.fitChart ? chartJSON.dimensionList.slice(
54244
54655
  scrollPosition,
54245
54656
  scrollPosition + visibleBars
@@ -54263,7 +54674,10 @@ const TornadoChart = ({
54263
54674
  let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
54264
54675
  let scaleFactor = formatOptions.annotation.annotationVisibility != "5" ? chartJSON.yMaxLeft / maxValue !== 1 ? Math.abs(chartJSON.yMaxLeft / maxValue) * 100 < 10 ? 3 : 0 : Math.abs(chartJSON.yMaxRight / maxValue) * 100 < 10 ? 3 : 0 : 0;
54265
54676
  chartJSON.yMaxLeft = chartJSON.yMaxLeft;
54266
- xScaleForLegends = linear$1().domain([chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)), chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
54677
+ xScaleForLegends = linear$1().domain([
54678
+ chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)),
54679
+ chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))
54680
+ ]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
54267
54681
  xScale = xScaleForLegends;
54268
54682
  calculatedRange = [0, innerWidth2];
54269
54683
  getXScale();
@@ -54326,16 +54740,16 @@ const TornadoChart = ({
54326
54740
  filteredData.flatMap(
54327
54741
  (d) => d.data.map((child) => ({
54328
54742
  ...child,
54329
- legendText: !IsadvanceanalyticsChart ? d.legend.replace("-", "~$~").split("~$~")[1].trim() : d.legend.split("ve) - ")[1],
54743
+ legendText: !isAdvanceAnalyticsChart ? chartJSON.dimensionList[0] == chartTypes.TornadoDefaultEntry ? "defaultEntry" : d.legend.split("-")[1]?.trim() ?? d.legend : d.legend.split("ve) - ")[1]?.trim() ?? d.legend,
54330
54744
  properties: d.properties
54331
54745
  }))
54332
54746
  )
54333
- ).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft("defaultEntry")).attr("height", yScaleLeft.bandwidth()).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr("stroke-dasharray", (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr("hoverId", (d) => ((IsadvanceanalyticsChart ? d.legend.split(" - ")[0] : d["dimension"]) || "Legend").replace(/\s+/g, "-")).attr(
54747
+ ).enter().append("rect").attr("class", "rect").attr("y", (d) => d.legendText ? yScaleLeft(d.legendText) : yScaleLeft(chartTypes.TornadoDefaultEntry)).attr("height", yScaleLeft.bandwidth()).attr("x", (d) => d.value >= 0 ? xScale(0) : xScale(d.value)).attr("width", (d) => Math.abs(xScale(d.value) - xScale(0))).style("shape-rendering", "crispEdges").attr("stroke-dasharray", (d) => d.properties.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => `${d.properties.stackBorderWidth}px`).attr("hoverId", (d) => ((isAdvanceAnalyticsChart ? d.legend.split(" - ")[0] : d["dimension"]) || "Legend").replace(/\s+/g, "-")).attr(
54334
54748
  "stroke",
54335
54749
  (d) => d.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.properties.stackBorderColor : "none"
54336
54750
  ).style(
54337
54751
  "fill",
54338
- (d) => IsadvanceanalyticsChart ? d.value > 0 ? positiveBarColor !== "#ffffff" ? positiveBarColor : "none" : negativeBarColor !== "#ffffff" ? negativeBarColor : "none" : d.properties.color
54752
+ (d) => isAdvanceAnalyticsChart ? d.value > 0 ? positiveBarColor !== "#ffffff" ? positiveBarColor : "none" : negativeBarColor !== "#ffffff" ? negativeBarColor : "none" : d.properties.color
54339
54753
  ).on("mousemove", (event2, d) => {
54340
54754
  showTooltipOnMouseMove(
54341
54755
  [
@@ -54427,14 +54841,7 @@ const TornadoChart = ({
54427
54841
  };
54428
54842
  const drawColumnChart = () => {
54429
54843
  getChartType();
54430
- initXaxisBar(
54431
- formatOptions,
54432
- gTag,
54433
- xLabel,
54434
- innerHeight2,
54435
- innerWidth2,
54436
- xAxis
54437
- );
54844
+ initXaxisBar(formatOptions, gTag, xLabel, innerHeight2, innerWidth2, xAxis);
54438
54845
  commonAnnotations(
54439
54846
  filteredData,
54440
54847
  yScaleLeft,
@@ -54460,7 +54867,7 @@ const TornadoChart = ({
54460
54867
  svg,
54461
54868
  yScaleLeft,
54462
54869
  columnWidth,
54463
- IsadvanceanalyticsChart,
54870
+ isAdvanceAnalyticsChart,
54464
54871
  isReportEditable,
54465
54872
  barChart
54466
54873
  );