pace-chart-lib 1.0.32 → 1.0.34

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.
@@ -11792,7 +11792,7 @@ function calculateVerticalMargins(windowWidth, windowHeight, maxNumberForPrimary
11792
11792
  bottom2 = xAxisRelatedMargin + 5 + scrollHeightConstant;
11793
11793
  break;
11794
11794
  case staticLegendPosition.top:
11795
- top2 = 40 + metrics.chartTitleHeight + (isNormalizedChart ? 12 : 0);
11795
+ top2 = 35 + metrics.chartTitleHeight + (isNormalizedChart ? 12 : 0);
11796
11796
  bottom2 = xAxisRelatedMargin + scrollHeightConstant;
11797
11797
  break;
11798
11798
  case staticLegendPosition.right:
@@ -12563,10 +12563,7 @@ function responsiveXaxisLabel(dimensionList, innerWidth2) {
12563
12563
  }
12564
12564
  function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yScaleLeft, xAxis, dimensionHeightWidthArray, height, barWidth, isDateType, innerWidth2, innerHeight2, filteredDimensionList, xScale) {
12565
12565
  try {
12566
- let responsiveDimList = chartJSON.chartType !== chartTypes.ColumnHistogramChart ? responsiveXaxisLabel(
12567
- filteredDimensionList,
12568
- innerWidth2
12569
- ) : [];
12566
+ let responsiveDimList = chartJSON.chartType !== chartTypes.ColumnHistogramChart ? responsiveXaxisLabel(filteredDimensionList, innerWidth2) : [];
12570
12567
  let formatedResponsiveDimList = [];
12571
12568
  let maxDimensionWidth = dimensionHeightWidthArray[3] + 10;
12572
12569
  if (chartJSON.chartType != chartTypes.ColumnHistogramChart) {
@@ -12617,12 +12614,13 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12617
12614
  const dimHeight = xScale.step();
12618
12615
  const lineHeight = parseInt(formatOptions.xAxisLabel.xAxisLabelFontSize) * 1.2;
12619
12616
  const maxLines = Math.floor(dimHeight / lineHeight);
12617
+ const isRotationZero = formatOptions.xAxisLabel.xAxisLabelRotation == 0;
12620
12618
  let foreignObject = XaxisG.selectAll("g").append("foreignObject").attr("class", "testingoverflowing").style("width", Math.round(dimensionWidthUpdated)).style("height", dimHeight + "px").attr(
12621
12619
  "transform",
12622
12620
  (d, i) => `rotate(${xaxisLabelPosition === "1" ? -formatOptions.xAxisLabel.xAxisLabelRotation : formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? 180 - formatOptions.xAxisLabel.xAxisLabelRotation : 0}) translate (${formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? dx + `, -${i == 0 && isAreaTypeChartAndNotFitChart ? 15 : dimHeight / 2}` : -dimensionWidthUpdated / 2 + " , " + (xaxisLabelPosition === "1" ? "-15" : "8")})`
12623
12621
  );
12624
- if (formatOptions.xAxisLabel.xAxisLabelRotation != 0) {
12625
- foreignObject.style("align-content", "center");
12622
+ if (!isRotationZero) {
12623
+ foreignObject.style("overflow", "visible");
12626
12624
  }
12627
12625
  if (detectBrowserName() === "safari") {
12628
12626
  foreignObject.attr(
@@ -12630,7 +12628,8 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12630
12628
  formatOptions.xAxisLabel.labelTextWrap ? maxDimensionWidth < height * 0.125 ? maxDimensionWidth : height * 0.125 : xLabel
12631
12629
  ).attr("height", "20px");
12632
12630
  }
12633
- let xLabelsObj = foreignObject.append("xhtml:h3").style(
12631
+ let innerDiv = foreignObject.append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").style("justify-content", isRotationZero ? "center" : "end").style("align-items", isRotationZero ? "start" : "center").style("overflow", "visible").style("text-align", "center");
12632
+ let xLabelsObj = innerDiv.append("xhtml:div").style(
12634
12633
  "transform",
12635
12634
  detectBrowserName() === "safari" ? "" : xaxisLabelPosition === "1" ? "" : formatOptions.xAxisLabel.xAxisLabelRotation != 0 ? "rotate(180deg)" : "0"
12636
12635
  );
@@ -12651,7 +12650,24 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12651
12650
  formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
12652
12651
  );
12653
12652
  if (chartJSON.chartType === chartTypes.ColumnHistogramChart) {
12654
- xLabelsObj.attr("title", (d, i) => getNumberWithFormat(d, formatOptions.xAxisLabel.xAxisDisplayUnits, formatOptions.xAxisLabel.xAxisNumberFormat, formatOptions.xAxisLabel.xAxisLabelDecimalPrecision, false)).html((d, i) => getNumberWithFormat(d, formatOptions.xAxisLabel.xAxisDisplayUnits, formatOptions.xAxisLabel.xAxisNumberFormat, formatOptions.xAxisLabel.xAxisLabelDecimalPrecision, false));
12653
+ xLabelsObj.attr(
12654
+ "title",
12655
+ (d, i) => getNumberWithFormat(
12656
+ d,
12657
+ formatOptions.xAxisLabel.xAxisDisplayUnits,
12658
+ formatOptions.xAxisLabel.xAxisNumberFormat,
12659
+ formatOptions.xAxisLabel.xAxisLabelDecimalPrecision,
12660
+ false
12661
+ )
12662
+ ).html(
12663
+ (d, i) => getNumberWithFormat(
12664
+ d,
12665
+ formatOptions.xAxisLabel.xAxisDisplayUnits,
12666
+ formatOptions.xAxisLabel.xAxisNumberFormat,
12667
+ formatOptions.xAxisLabel.xAxisLabelDecimalPrecision,
12668
+ false
12669
+ )
12670
+ );
12655
12671
  } else {
12656
12672
  xLabelsObj.attr("title", (d, i) => ("" + formatedResponsiveDimList[i]).trim()).html((d, i) => ("" + formatedResponsiveDimList[i]).trim());
12657
12673
  }
@@ -12706,8 +12722,34 @@ function detectBrowserName() {
12706
12722
  }
12707
12723
  }
12708
12724
  const MONTH_NAMES = {
12709
- short: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
12710
- long: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
12725
+ short: [
12726
+ "Jan",
12727
+ "Feb",
12728
+ "Mar",
12729
+ "Apr",
12730
+ "May",
12731
+ "Jun",
12732
+ "Jul",
12733
+ "Aug",
12734
+ "Sep",
12735
+ "Oct",
12736
+ "Nov",
12737
+ "Dec"
12738
+ ],
12739
+ long: [
12740
+ "January",
12741
+ "February",
12742
+ "March",
12743
+ "April",
12744
+ "May",
12745
+ "June",
12746
+ "July",
12747
+ "August",
12748
+ "September",
12749
+ "October",
12750
+ "November",
12751
+ "December"
12752
+ ]
12711
12753
  };
12712
12754
  const getDateFromDimension = (dimension) => {
12713
12755
  const utc_days = Math.floor(Number(dimension) - 25569);
@@ -12806,7 +12848,14 @@ function setXaxistitle$1(formatOptions, barChart, svg, margin, xLabel, height, x
12806
12848
  formatOptions.xAxisTitle.xAxisTitleVisibility ? "visible" : "hidden"
12807
12849
  ).attr(
12808
12850
  "transform",
12809
- getTransformStringForXaxisLabelPosition(barChart, margin, formatOptions, innerHeight2, xLabel, yLabel)
12851
+ getTransformStringForXaxisLabelPosition(
12852
+ barChart,
12853
+ margin,
12854
+ formatOptions,
12855
+ innerHeight2,
12856
+ xLabel,
12857
+ yLabel
12858
+ )
12810
12859
  ).attr("class", "xAxisTitle").attr("width", barChart ? innerHeight2 : innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12811
12860
  if (formatOptions.xAxisTitle.xAxisDynamicTitleText.length !== 0) {
12812
12861
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.xAxisTitle.xAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
@@ -12830,7 +12879,10 @@ function yAxistitle$1(innerHeight2, formatOptions, dataTableHeight, barChart, sv
12830
12879
  let object2 = svg.append("foreignObject").attr(
12831
12880
  "visibility",
12832
12881
  formatOptions.yAxisTitle.yAxisTitleVisibility ? "visible" : "hidden"
12833
- ).attr("x", barChart ? margin.left : `-${margin.top + currentInnerHeight}`).attr("y", barChart ? margin.top + currentInnerHeight + yLabel : margin.left - yTitle - yLabel).attr("class", "yAxisTitle").attr("transform", barChart ? "" : "rotate(-90)").attr("width", barChart ? width : currentInnerHeight).attr("height", yTitle + "px");
12882
+ ).attr("x", barChart ? margin.left : `-${margin.top + currentInnerHeight}`).attr(
12883
+ "y",
12884
+ barChart ? margin.top + currentInnerHeight + yLabel : margin.left - yTitle - yLabel
12885
+ ).attr("class", "yAxisTitle").attr("transform", barChart ? "" : "rotate(-90)").attr("width", barChart ? width : currentInnerHeight).attr("height", yTitle + "px");
12834
12886
  if (formatOptions.yAxisTitle.yAxisDynamicTitleText.length !== 0) {
12835
12887
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.yAxisTitle.yAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
12836
12888
  formatOptions.yAxisTitle.yAxisTitleHTML ? formatOptions.yAxisTitle.yAxisTitleHTML : formatOptions.yAxisTitle.yAxisTitleText
@@ -12847,12 +12899,17 @@ function yAxistitleRight(svg, isSecondaryAxisDrawn, margin, formatOptions, dataT
12847
12899
  let object2 = svg.append("foreignObject").attr(
12848
12900
  "visibility",
12849
12901
  isSecondaryAxisDrawn && formatOptions.secondaryYAxisTitle.secondaryYAxisTitleVisibility ? "visible" : "hidden"
12850
- ).attr("x", `-${margin.top + (dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2)}`).attr(
12851
- "y",
12852
- `${margin.left + innerWidth2 + secondaryYLabel - 2}`
12853
- ).attr("class", "yAxisTitleSecondary").attr("transform", "rotate(-90)").attr("width", dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2).attr("height", secondaryAxisTitleWidth + "px");
12902
+ ).attr(
12903
+ "x",
12904
+ `-${margin.top + (dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2)}`
12905
+ ).attr("y", `${margin.left + innerWidth2 + secondaryYLabel - 2}`).attr("class", "yAxisTitleSecondary").attr("transform", "rotate(-90)").attr(
12906
+ "width",
12907
+ dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2
12908
+ ).attr("height", secondaryAxisTitleWidth + "px");
12854
12909
  if (formatOptions.secondaryYAxisTitle.secondaryYAxisDynamicTitleText.length !== 0) {
12855
- object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText).html(formatOptions.secondaryYAxisTitle.secondaryYAxisTitleHTML ? formatOptions.secondaryYAxisTitle.secondaryYAxisTitleHTML : formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText);
12910
+ object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText).html(
12911
+ formatOptions.secondaryYAxisTitle.secondaryYAxisTitleHTML ? formatOptions.secondaryYAxisTitle.secondaryYAxisTitleHTML : formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText
12912
+ );
12856
12913
  } else {
12857
12914
  object2.append("xhtml:h3").style("white-space", "pre").style("text-overflow", "ellipsis").style("user-select", "none").style("margin", 0).style("padding", 0).style("text-align", "center").style("overflow", "hidden").attr("class", "xAxisTitle").style("padding-top", "3px").style("text-anchor", "middle").style("color", "rgba(119,119,119)").style(
12858
12915
  "font-size",
@@ -12863,10 +12920,7 @@ function yAxistitleRight(svg, isSecondaryAxisDrawn, margin, formatOptions, dataT
12863
12920
  ).style(
12864
12921
  "font-style",
12865
12922
  formatOptions.secondaryYAxisTitle.secondaryYAxisTitleFontStyle
12866
- ).attr(
12867
- "title",
12868
- formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText
12869
- ).html(formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText);
12923
+ ).attr("title", formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText).html(formatOptions.secondaryYAxisTitle.secondaryYAxisTitleText);
12870
12924
  }
12871
12925
  }
12872
12926
  function setChartTitle(svg, formatOptions, width, chartTitleHeight) {
@@ -12895,7 +12949,9 @@ function getCurveType(formatOptions) {
12895
12949
  } else if (formatOptions.line.interpolationType == "2" && formatOptions.line.smoothType == "1") {
12896
12950
  return monotoneX;
12897
12951
  } else if (formatOptions.line.interpolationType == "2" && formatOptions.line.smoothType == "2") {
12898
- return cardinal.tension(parseFloat(formatOptions.line.cardinalTension));
12952
+ return cardinal.tension(
12953
+ parseFloat(formatOptions.line.cardinalTension)
12954
+ );
12899
12955
  } else if (formatOptions.line.interpolationType == "3" && formatOptions.line.stepPosition == "1") {
12900
12956
  return stepBefore;
12901
12957
  } else if (formatOptions.line.interpolationType == "3" && formatOptions.line.stepPosition == "2") {
@@ -12941,84 +12997,74 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12941
12997
  }
12942
12998
  switch (labelType) {
12943
12999
  case "2":
12944
- chartData.forEach(
12945
- (d) => {
12946
- if (d.data[0])
12947
- labelData.push({
12948
- Dimension: d.data[0].dimension,
12949
- Measure: d.data[0].value,
12950
- Legend: d.data[0].legend,
12951
- LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12952
- Labelcolor: d.properties[dataLabelColor],
12953
- hoverText: getHoverText(d, isAATornado),
12954
- Axis: d.properties.axis
12955
- });
12956
- }
12957
- );
13000
+ chartData.forEach((d) => {
13001
+ if (d.data[0])
13002
+ labelData.push({
13003
+ Dimension: d.data[0].dimension,
13004
+ Measure: d.data[0].value,
13005
+ Legend: d.data[0].legend,
13006
+ LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13007
+ Labelcolor: d.properties[dataLabelColor],
13008
+ hoverText: getHoverText(d, isAATornado),
13009
+ Axis: d.properties.axis
13010
+ });
13011
+ });
12958
13012
  break;
12959
13013
  case "3":
12960
- chartData.forEach(
12961
- (d) => {
12962
- if (d.data[d.data.length - 1]) {
12963
- labelData.push({
12964
- Dimension: d.data[d.data.length - 1].dimension,
12965
- Measure: d.data[d.data.length - 1].value,
12966
- Legend: d.data[d.data.length - 1].legend,
12967
- LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12968
- Labelcolor: d.properties[dataLabelColor],
12969
- hoverText: getHoverText(d, isAATornado),
12970
- Axis: d.properties.axis
12971
- });
12972
- }
13014
+ chartData.forEach((d) => {
13015
+ if (d.data[d.data.length - 1]) {
13016
+ labelData.push({
13017
+ Dimension: d.data[d.data.length - 1].dimension,
13018
+ Measure: d.data[d.data.length - 1].value,
13019
+ Legend: d.data[d.data.length - 1].legend,
13020
+ LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13021
+ Labelcolor: d.properties[dataLabelColor],
13022
+ hoverText: getHoverText(d, isAATornado),
13023
+ Axis: d.properties.axis
13024
+ });
12973
13025
  }
12974
- );
13026
+ });
12975
13027
  break;
12976
13028
  case "4":
12977
- chartData.forEach(
12978
- (d) => {
12979
- if (d.data[0])
12980
- labelData.push({
12981
- Dimension: d.data[0].dimension,
12982
- Measure: d.data[0].value,
12983
- Legend: d.data[0].legend,
12984
- LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12985
- Labelcolor: d.properties[dataLabelColor],
12986
- hoverText: getHoverText(d, isAATornado),
12987
- Axis: d.properties.axis
12988
- });
12989
- }
12990
- );
12991
- chartData.forEach(
12992
- (d) => {
12993
- if (d.data[d.data.length - 1])
13029
+ chartData.forEach((d) => {
13030
+ if (d.data[0])
13031
+ labelData.push({
13032
+ Dimension: d.data[0].dimension,
13033
+ Measure: d.data[0].value,
13034
+ Legend: d.data[0].legend,
13035
+ LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13036
+ Labelcolor: d.properties[dataLabelColor],
13037
+ hoverText: getHoverText(d, isAATornado),
13038
+ Axis: d.properties.axis
13039
+ });
13040
+ });
13041
+ chartData.forEach((d) => {
13042
+ if (d.data[d.data.length - 1])
13043
+ labelData.push({
13044
+ Dimension: d.data[d.data.length - 1].dimension,
13045
+ Measure: d.data[d.data.length - 1].value,
13046
+ Legend: d.data[d.data.length - 1].legend,
13047
+ LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13048
+ Labelcolor: d.properties[dataLabelColor],
13049
+ hoverText: getHoverText(d, isAATornado),
13050
+ Axis: d.properties.axis
13051
+ });
13052
+ });
13053
+ break;
13054
+ case "1":
13055
+ for (let i = 0; i < chartData[0].data.length; i++) {
13056
+ chartData.forEach((d) => {
13057
+ if (d.data[i])
12994
13058
  labelData.push({
12995
- Dimension: d.data[d.data.length - 1].dimension,
12996
- Measure: d.data[d.data.length - 1].value,
12997
- Legend: d.data[d.data.length - 1].legend,
13059
+ Dimension: d.data[i].dimension,
13060
+ Measure: d.data[i].value,
13061
+ Legend: d.data[i].legend,
12998
13062
  LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
12999
13063
  Labelcolor: d.properties[dataLabelColor],
13000
13064
  hoverText: getHoverText(d, isAATornado),
13001
13065
  Axis: d.properties.axis
13002
13066
  });
13003
- }
13004
- );
13005
- break;
13006
- case "1":
13007
- for (let i = 0; i < chartData[0].data.length; i++) {
13008
- chartData.forEach(
13009
- (d) => {
13010
- if (d.data[i])
13011
- labelData.push({
13012
- Dimension: d.data[i].dimension,
13013
- Measure: d.data[i].value,
13014
- Legend: d.data[i].legend,
13015
- LabelPosition: annotationPosition ? annotationPosition : d.properties.annotationPosition,
13016
- Labelcolor: d.properties[dataLabelColor],
13017
- hoverText: getHoverText(d, isAATornado),
13018
- Axis: d.properties.axis
13019
- });
13020
- }
13021
- );
13067
+ });
13022
13068
  }
13023
13069
  break;
13024
13070
  case "5":
@@ -13140,15 +13186,22 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13140
13186
  width: 15
13141
13187
  },
13142
13188
  color: d.Labelcolor,
13143
- type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
13189
+ type: annotationTypeforCharts(
13190
+ d3Annotation2,
13191
+ parseFloat(annotationType)
13192
+ ),
13144
13193
  height,
13145
13194
  width
13146
13195
  };
13147
13196
  if (barChart) {
13148
13197
  let requiredXScale = d.Axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13149
- (responsiveXaxisLabel(dimensionList, innerHeight2).includes(d.Dimension) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13198
+ (responsiveXaxisLabel(dimensionList, innerHeight2).includes(
13199
+ d.Dimension
13200
+ ) || chartType === chartTypes.TornadoChart) && !labelExcludeList.includes(d.Legend) && requiredXScale(d.Measure) <= innerWidth2 && requiredXScale(d.Measure) >= 0 ? annotationsList.push(singleAnnotation) : null;
13150
13201
  } else {
13151
- 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;
13202
+ responsiveXaxisLabel(dimensionList, innerWidth2).includes(
13203
+ d.Dimension
13204
+ ) && !labelExcludeList.includes(d.Legend) && (d.Axis == axisTypes.primary ? yScaleLeft(d.Measure) <= innerHeight2 && yScaleLeft(d.Measure) >= 0 : yScaleRight(d.Measure) <= innerHeight2 && yScaleRight(d.Measure) >= 0) ? annotationsList.push(singleAnnotation) : null;
13152
13205
  }
13153
13206
  });
13154
13207
  annotationsList = annotationsList.filter((d) => d.data.y.measure != 0);
@@ -13174,12 +13227,24 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13174
13227
  }
13175
13228
  finalAnnotationList.push(newAnnotation);
13176
13229
  });
13177
- makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13230
+ makeAnnotations.editMode(
13231
+ formatOptions.annotation.annotationDraggable && isReportEditable
13232
+ ).accessors({
13178
13233
  x: function(d) {
13179
13234
  if (barChart) {
13180
13235
  let requiredXScale = d.x.axis === axisTypes.primary ? yScaleLeft : yScaleRight;
13181
13236
  let axis2 = d.x.axis;
13182
- return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
13237
+ return dataLabelsPositionForBarChartFamily(
13238
+ formatOptions,
13239
+ d.x.measure ? d.x.measure : 0,
13240
+ d.position,
13241
+ requiredXScale,
13242
+ minValue,
13243
+ void 0,
13244
+ chartType,
13245
+ isSensitivityChart,
13246
+ axis2
13247
+ );
13183
13248
  } else if (chartType === chartTypes.ColumnChart) {
13184
13249
  const legend = xScaleForLegends(d.currentLegend);
13185
13250
  const x2 = legend != null ? xScale(d.x) + legend - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
@@ -13235,10 +13300,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13235
13300
  "stroke-dasharray",
13236
13301
  connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]
13237
13302
  );
13238
- annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style(
13239
- "stroke",
13240
- formatOptions.annotation.connectorColor || "#ccc"
13241
- );
13303
+ annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
13242
13304
  annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
13243
13305
  "stroke-dasharray",
13244
13306
  connectedStyle[formatOptions.annotation.connectorStyle.toLowerCase()]
@@ -13261,8 +13323,17 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13261
13323
  x: (d) => xScale.invert(d.x),
13262
13324
  y: (d) => yScaleLeft.invert(d.y)
13263
13325
  }).notePadding(0).annotations(finalAnnotationList);
13264
- if (formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
13265
- let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, barChart);
13326
+ if (formatOptions.plotArea.fitChart)
13327
+ svg.selectAll(".annotation-group").remove();
13328
+ let annotations = appendAnnotations(
13329
+ svg,
13330
+ formatOptions,
13331
+ margin,
13332
+ fontStyle,
13333
+ makeAnnotations,
13334
+ connectorType,
13335
+ barChart
13336
+ );
13266
13337
  }
13267
13338
  } catch (error) {
13268
13339
  throw error;
@@ -13281,7 +13352,11 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13281
13352
  let stackData = [];
13282
13353
  let getChartType = [];
13283
13354
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
13284
- oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
13355
+ oldAnnotationList = conditionallyResetOldAnnotations(
13356
+ oldAnnotationList,
13357
+ formatOptions,
13358
+ chartTypes.CustomColumnChart
13359
+ );
13285
13360
  let annotationsList = [];
13286
13361
  let finalAnnotationList = [];
13287
13362
  if (oldAnnotationList.length != 0) {
@@ -13358,9 +13433,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13358
13433
  case chartTypes.ColumnChart:
13359
13434
  case chartTypes.LineChart:
13360
13435
  case chartTypes.AreaChart:
13361
- labelData.push(
13362
- d.data[d.data.length - 1]
13363
- );
13436
+ labelData.push(d.data[d.data.length - 1]);
13364
13437
  break;
13365
13438
  case chartTypes.StackColumnChart:
13366
13439
  stackColumnData.forEach(
@@ -13384,15 +13457,23 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13384
13457
  d.data.forEach((j) => labelData.push(j));
13385
13458
  break;
13386
13459
  case chartTypes.StackColumnChart:
13387
- let stackColumnIndex = stackColumnData.findIndex((id2) => id2.key === d.properties.legend);
13460
+ let stackColumnIndex = stackColumnData.findIndex(
13461
+ (id2) => id2.key === d.properties.legend
13462
+ );
13388
13463
  if (stackColumnIndex !== -1) {
13389
- stackColumnData[stackColumnIndex].forEach((dta) => labelData.push(dta));
13464
+ stackColumnData[stackColumnIndex].forEach(
13465
+ (dta) => labelData.push(dta)
13466
+ );
13390
13467
  }
13391
13468
  break;
13392
13469
  case chartTypes.StackAreaChart:
13393
- let stackAreaIndex = stackAreaData.findIndex((id2) => id2.key === d.properties.legend);
13470
+ let stackAreaIndex = stackAreaData.findIndex(
13471
+ (id2) => id2.key === d.properties.legend
13472
+ );
13394
13473
  if (stackAreaIndex !== -1) {
13395
- stackAreaData[stackAreaIndex].forEach((dta) => labelData.push(dta));
13474
+ stackAreaData[stackAreaIndex].forEach(
13475
+ (dta) => labelData.push(dta)
13476
+ );
13396
13477
  }
13397
13478
  break;
13398
13479
  }
@@ -13432,78 +13513,72 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13432
13513
  switch (annotationVisibility) {
13433
13514
  case "1":
13434
13515
  for (let i = 0; i < chartData[k2].data.length; i++) {
13435
- labelData.push(
13436
- {
13437
- dimension: d.data[i].dimension,
13438
- value: d.data[i].value,
13439
- legend: d.data[i].legend,
13440
- labelPosition: d.data[i].labelPosition,
13441
- labelColor: d.data[i].labelColor,
13442
- axis: d.data[i].axis,
13443
- type: chartTypes.LineChart
13444
- }
13445
- );
13516
+ labelData.push({
13517
+ dimension: d.data[i].dimension,
13518
+ value: d.data[i].value,
13519
+ legend: d.data[i].legend,
13520
+ labelPosition: d.data[i].labelPosition,
13521
+ labelColor: d.data[i].labelColor,
13522
+ axis: d.data[i].axis,
13523
+ type: chartTypes.LineChart
13524
+ });
13446
13525
  }
13447
13526
  break;
13448
13527
  case "2":
13449
13528
  labelData;
13450
13529
  break;
13451
13530
  case "3":
13452
- labelData.push(
13453
- {
13454
- dimension: d.data[0].dimension,
13455
- value: d.data[0].value,
13456
- legend: d.data[0].legend,
13457
- labelPosition: d.data[0].labelPosition,
13458
- labelcolor: d.data[0].labelColor,
13459
- axis: d.data[0].axis,
13460
- type: chartTypes.LineChart
13461
- }
13462
- );
13531
+ labelData.push({
13532
+ dimension: d.data[0].dimension,
13533
+ value: d.data[0].value,
13534
+ legend: d.data[0].legend,
13535
+ labelPosition: d.data[0].labelPosition,
13536
+ labelcolor: d.data[0].labelColor,
13537
+ axis: d.data[0].axis,
13538
+ type: chartTypes.LineChart
13539
+ });
13463
13540
  break;
13464
13541
  case "4":
13465
- labelData.push(
13466
- {
13467
- dimension: d.data[d.data.length - 1].dimension,
13468
- value: d.data[d.data.length - 1].value,
13469
- legend: d.data[d.data.length - 1].legend,
13470
- labelPosition: d.data[d.data.length - 1].labelPosition,
13471
- labelcolor: d.data[d.data.length - 1].labelColor,
13472
- axis: d.data[d.data.length - 1].axis,
13473
- type: chartTypes.LineChart
13474
- }
13475
- );
13542
+ labelData.push({
13543
+ dimension: d.data[d.data.length - 1].dimension,
13544
+ value: d.data[d.data.length - 1].value,
13545
+ legend: d.data[d.data.length - 1].legend,
13546
+ labelPosition: d.data[d.data.length - 1].labelPosition,
13547
+ labelcolor: d.data[d.data.length - 1].labelColor,
13548
+ axis: d.data[d.data.length - 1].axis,
13549
+ type: chartTypes.LineChart
13550
+ });
13476
13551
  break;
13477
13552
  case "5":
13478
- labelData.push(
13479
- {
13480
- dimension: d.data[0].dimension,
13481
- value: d.data[0].value,
13482
- legend: d.data[0].legend,
13483
- labelPosition: d.data[0].labelPosition,
13484
- labelcolor: d.data[0].labelColor,
13485
- axis: d.data[0].axis,
13486
- type: chartTypes.LineChart
13487
- }
13488
- );
13489
- labelData.push(
13490
- {
13491
- dimension: d.data[d.data.length - 1].dimension,
13492
- value: d.data[d.data.length - 1].value,
13493
- legend: d.data[d.data.length - 1].legend,
13494
- labelPosition: d.data[d.data.length - 1].labelPosition,
13495
- labelcolor: d.data[d.data.length - 1].labelColor,
13496
- axis: d.data[d.data.length - 1].axis,
13497
- type: chartTypes.LineChart
13498
- }
13499
- );
13553
+ labelData.push({
13554
+ dimension: d.data[0].dimension,
13555
+ value: d.data[0].value,
13556
+ legend: d.data[0].legend,
13557
+ labelPosition: d.data[0].labelPosition,
13558
+ labelcolor: d.data[0].labelColor,
13559
+ axis: d.data[0].axis,
13560
+ type: chartTypes.LineChart
13561
+ });
13562
+ labelData.push({
13563
+ dimension: d.data[d.data.length - 1].dimension,
13564
+ value: d.data[d.data.length - 1].value,
13565
+ legend: d.data[d.data.length - 1].legend,
13566
+ labelPosition: d.data[d.data.length - 1].labelPosition,
13567
+ labelcolor: d.data[d.data.length - 1].labelColor,
13568
+ axis: d.data[d.data.length - 1].axis,
13569
+ type: chartTypes.LineChart
13570
+ });
13500
13571
  break;
13501
13572
  }
13502
13573
  break;
13503
13574
  case chartTypes.StackColumnChart:
13504
- const stackColumnIndex = stackColumnData.findIndex((id2) => id2.key === d.properties.legend);
13575
+ const stackColumnIndex = stackColumnData.findIndex(
13576
+ (id2) => id2.key === d.properties.legend
13577
+ );
13505
13578
  stackColumnIndex !== -1 && stackColumnData[stackColumnIndex].forEach((dta, j) => {
13506
- switch (String(stackColumnData[stackColumnIndex].individualAnnotationVisibility)) {
13579
+ switch (String(
13580
+ stackColumnData[stackColumnIndex].individualAnnotationVisibility
13581
+ )) {
13507
13582
  case "1":
13508
13583
  labelData.push(stackColumnData[stackColumnIndex][j]);
13509
13584
  break;
@@ -13523,18 +13598,26 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13523
13598
  case "5":
13524
13599
  let label5 = stackColumnData[stackColumnIndex][0];
13525
13600
  let label6 = stackColumnData[stackColumnIndex][stackColumnData[0].length - 1];
13526
- if (!labelData.find((data) => data.key == label5.key || data.key == label6.key)) {
13601
+ if (!labelData.find(
13602
+ (data) => data.key == label5.key || data.key == label6.key
13603
+ )) {
13527
13604
  labelData.push(stackColumnData[stackColumnIndex][0]);
13528
- labelData.push(stackColumnData[stackColumnIndex][stackColumnData[0].length - 1]);
13605
+ labelData.push(
13606
+ stackColumnData[stackColumnIndex][stackColumnData[0].length - 1]
13607
+ );
13529
13608
  break;
13530
13609
  }
13531
13610
  }
13532
13611
  });
13533
13612
  break;
13534
13613
  case chartTypes.StackAreaChart:
13535
- const stackIndex = stackAreaData.findIndex((id2) => id2.key === d.properties.legend);
13614
+ const stackIndex = stackAreaData.findIndex(
13615
+ (id2) => id2.key === d.properties.legend
13616
+ );
13536
13617
  stackIndex != -1 && stackAreaData[stackIndex].forEach((dta, j) => {
13537
- switch (String(stackAreaData[stackIndex].individualAnnotationVisibility)) {
13618
+ switch (String(
13619
+ stackAreaData[stackIndex].individualAnnotationVisibility
13620
+ )) {
13538
13621
  case "1":
13539
13622
  labelData.push(stackAreaData[stackIndex][j]);
13540
13623
  break;
@@ -13554,7 +13637,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13554
13637
  case "5":
13555
13638
  let label5 = stackAreaData[stackIndex][0];
13556
13639
  let label6 = stackAreaData[stackIndex][stackAreaData[0].length - 1];
13557
- if (!labelData.find((data) => data.key == label5.key || data.key == label6.key)) {
13640
+ if (!labelData.find(
13641
+ (data) => data.key == label5.key || data.key == label6.key
13642
+ )) {
13558
13643
  labelData.push(label5);
13559
13644
  labelData.push(label6);
13560
13645
  break;
@@ -13571,7 +13656,6 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13571
13656
  if (maxValue < d.value) {
13572
13657
  maxValue = d.value;
13573
13658
  }
13574
- ;
13575
13659
  });
13576
13660
  let minValue = maxValue * 0.1;
13577
13661
  labelData.forEach((d, i) => {
@@ -13592,7 +13676,18 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13592
13676
  align: "middle"
13593
13677
  },
13594
13678
  data: {
13595
- x: d.dimension && d.legend ? { dimension: d.dimension, legend: d.legend, type: d.type, axis: d.axis || d.data.axis } : { dimension: d.data.dimension, legend: d.key, type: d.data.type, stacklegend: d.data.legend, axis: d.data.axis },
13679
+ x: d.dimension && d.legend ? {
13680
+ dimension: d.dimension,
13681
+ legend: d.legend,
13682
+ type: d.type,
13683
+ axis: d.axis || d.data.axis
13684
+ } : {
13685
+ dimension: d.data.dimension,
13686
+ legend: d.key,
13687
+ type: d.data.type,
13688
+ stacklegend: d.data.legend,
13689
+ axis: d.data.axis
13690
+ },
13596
13691
  y: d.value || d.value == 0 ? d.value : d.data.type != chartTypes.StackColumnChart ? d[1] ? d[1] : 0 : d[1] > 0 ? d[1] : d[0],
13597
13692
  prevValue: d[0] >= 0 ? d[0] : d[1],
13598
13693
  position: parseInt(d.labelPosition) ? parseInt(d.labelPosition) : parseInt(d.data.labelPosition),
@@ -13612,14 +13707,19 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13612
13707
  width: 15
13613
13708
  },
13614
13709
  color: d.labelColor || d.data.labelColor,
13615
- type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
13710
+ type: annotationTypeforCharts(
13711
+ d3Annotation2,
13712
+ parseFloat(annotationType)
13713
+ ),
13616
13714
  height,
13617
13715
  width
13618
13716
  };
13619
13717
  d["legend"] && d.dimension ? (
13620
13718
  // ? finalLegendseries.includes(d.Legend.includes("~$~") ? d.Legend.split("~$~")[1] : d.Legend) &&
13621
13719
  // filteredDimensionList.includes(d.Dimension) &&
13622
- !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
13720
+ !labelExcludeList.includes(
13721
+ d.legend.includes("~$~") ? d.legend.split("~$~")[1] : d.legend
13722
+ ) && (d.axis == axisTypes.primary ? yScaleLeft(d.value) <= innerHeight2 && yScaleLeft(d.value) >= 0 : yScaleRight(d.value) <= innerHeight2 && yScaleRight(d.value) >= 0) ? annotationsList.push(singleAnnotation) : null
13623
13723
  ) : (
13624
13724
  // finalLegendseries.includes(d["key"].includes("~$~") ? d["key"].split("~$~")[1] : d["key"]) &&
13625
13725
  // this.filteredDimensionList.includes(d.data["Dimension"]) &&
@@ -13638,14 +13738,19 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13638
13738
  newAnnotation.data.isVisible = oldAnnotation.data.isVisible ?? true;
13639
13739
  newAnnotation.connector.points = oldAnnotation.connector.points;
13640
13740
  if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
13641
- newAnnotation.connector["points"] = [[0, 0], [0, 0]];
13741
+ newAnnotation.connector["points"] = [
13742
+ [0, 0],
13743
+ [0, 0]
13744
+ ];
13642
13745
  }
13643
13746
  }
13644
13747
  });
13645
13748
  }
13646
13749
  finalAnnotationList.push(newAnnotation);
13647
13750
  });
13648
- makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13751
+ makeAnnotations.editMode(
13752
+ formatOptions.annotation.annotationDraggable && isReportEditable
13753
+ ).accessors({
13649
13754
  x: function(d) {
13650
13755
  const chartType = d.x.type || d.type;
13651
13756
  if (getChartType.includes(chartType)) {
@@ -13667,9 +13772,23 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13667
13772
  y: function(d) {
13668
13773
  const chartType = d.type ?? d.x.type;
13669
13774
  if (d.x.axis == axisTypes.primary) {
13670
- return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
13775
+ return dataLabelsPosition(
13776
+ d.y,
13777
+ parseFloat(d.position),
13778
+ yScaleLeft,
13779
+ minValue,
13780
+ d.prevValue,
13781
+ chartType
13782
+ );
13671
13783
  } else {
13672
- return dataLabelsPosition(d.y, parseFloat(d.position), yScaleRight, minValue, d.prevValue, chartType);
13784
+ return dataLabelsPosition(
13785
+ d.y,
13786
+ parseFloat(d.position),
13787
+ yScaleRight,
13788
+ minValue,
13789
+ d.prevValue,
13790
+ chartType
13791
+ );
13673
13792
  }
13674
13793
  }
13675
13794
  }).on("dragend", function(annotation2) {
@@ -13677,12 +13796,13 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13677
13796
  annotation2.data.isVisible = true;
13678
13797
  oldAnnotationList.forEach((d) => {
13679
13798
  if (d.data.x.dimension == annotation2.data.x.dimension && d.data.x.legend == annotation2.data.x.legend && d.data.x.type == annotation2.data.x.type && d.data.prevValue == annotation2.data.prevValue) {
13680
- annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue).attr("display", "block");
13799
+ annotations.selectAll(".annotation-note-label").filter(
13800
+ (d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue
13801
+ ).attr("display", "block");
13681
13802
  d.data.isVisible = true;
13682
13803
  }
13683
13804
  });
13684
13805
  }
13685
- ;
13686
13806
  oldAnnotationList.forEach((d) => {
13687
13807
  if (d.data.x.dimension == annotation2.data.x.dimension && d.data.x.legend == annotation2.data.x.legend && d.data.x.type == annotation2.data.x.type && d.data.prevValue == annotation2.data.prevValue) {
13688
13808
  d.dx = annotation2._dx * width / d.width;
@@ -13690,16 +13810,24 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13690
13810
  d.connector["points"] = annotation2.connector.points;
13691
13811
  }
13692
13812
  });
13693
- annotations.selectAll(".connector").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle]);
13813
+ annotations.selectAll(".connector").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
13814
+ "stroke-dasharray",
13815
+ connectedStyle[formatOptions.annotation.connectorStyle]
13816
+ );
13694
13817
  annotations.selectAll(`.connector-${connectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
13695
- annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle]).filter((d) => d._dx == 0 && d._dy == 0).remove();
13818
+ annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
13819
+ "stroke-dasharray",
13820
+ connectedStyle[formatOptions.annotation.connectorStyle]
13821
+ ).filter((d) => d._dx == 0 && d._dy == 0).remove();
13696
13822
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
13697
13823
  }).on("noteclick", function(annotation2) {
13698
13824
  if (formatOptions.annotation.annotationDraggable && isReportEditable) {
13699
13825
  annotation2.data.isVisible = false;
13700
13826
  oldAnnotationList.forEach((d) => {
13701
13827
  if (d.data.x.dimension == annotation2.data.x.dimension && d.data.x.legend == annotation2.data.x.legend && d.data.x.type == annotation2.data.x.type && d.data.prevValue == annotation2.data.prevValue) {
13702
- annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue).attr("display", "none");
13828
+ annotations.selectAll(".annotation-note-label").filter(
13829
+ (d2) => d2.data.x.dimension == annotation2.data.x.dimension && d2.data.x.legend == annotation2.data.x.legend && d2.data.x.type == annotation2.data.x.type && d2.data.prevValue == annotation2.data.prevValue
13830
+ ).attr("display", "none");
13703
13831
  d.data.isVisible = false;
13704
13832
  }
13705
13833
  });
@@ -13709,8 +13837,17 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13709
13837
  x: (d) => xScale.invert(d.x),
13710
13838
  y: (d) => d.x.axis == axisTypes.primary ? yScaleLeft.invert(d.y) : yScaleRight.invert(d.y)
13711
13839
  }).notePadding(0).annotations(finalAnnotationList);
13712
- if (!formatOptions.plotArea.fitChart) svg.selectAll(".annotation-group").remove();
13713
- let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
13840
+ if (!formatOptions.plotArea.fitChart)
13841
+ svg.selectAll(".annotation-group").remove();
13842
+ let annotations = appendAnnotations(
13843
+ svg,
13844
+ formatOptions,
13845
+ margin,
13846
+ fontStyle,
13847
+ makeAnnotations,
13848
+ connectorType,
13849
+ false
13850
+ );
13714
13851
  }
13715
13852
  } catch (error) {
13716
13853
  throw error;
@@ -13718,10 +13855,9 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13718
13855
  }
13719
13856
  const conditionallyResetOldAnnotations = (oldAnnotationList, formatOptions, chartType) => {
13720
13857
  try {
13721
- let path2 = [
13722
- chartTypes.PieChart,
13723
- chartTypes.DonutChart
13724
- ].includes(chartType) ? "plotArea" : "annotation";
13858
+ let path2 = [chartTypes.PieChart, chartTypes.DonutChart].includes(
13859
+ chartType
13860
+ ) ? "plotArea" : "annotation";
13725
13861
  const isDraggable = formatOptions[path2].annotationDraggable;
13726
13862
  const isMeasureReplaced = false;
13727
13863
  oldAnnotationList = isDraggable && !isMeasureReplaced ? oldAnnotationList ?? [] : [];
@@ -13747,7 +13883,14 @@ const annotationTypeforCharts = (d3Annotation2, type) => {
13747
13883
  };
13748
13884
  const dataLabelsPosition = (yCordinate, position, yScale, minValue, prevValue, chartType) => {
13749
13885
  try {
13750
- let allStackCharts = [chartTypes.LineChart, chartTypes.StackLineChart, chartTypes.StackAreaChart, chartTypes.NormalizedStackAreaChart, chartTypes.NormalizedStackLineChart, chartTypes.StackAreaChart];
13886
+ let allStackCharts = [
13887
+ chartTypes.LineChart,
13888
+ chartTypes.StackLineChart,
13889
+ chartTypes.StackAreaChart,
13890
+ chartTypes.NormalizedStackAreaChart,
13891
+ chartTypes.NormalizedStackLineChart,
13892
+ chartTypes.StackAreaChart
13893
+ ];
13751
13894
  prevValue ? prevValue : prevValue = 0;
13752
13895
  switch (position) {
13753
13896
  case 1:
@@ -13788,7 +13931,6 @@ const dataLabelsPosition = (yCordinate, position, yScale, minValue, prevValue, c
13788
13931
  } else {
13789
13932
  return chartType.includes("stack") ? yCordinate === -1 && prevValue === 0 ? yScale(0) + 10 : yCordinate === 1 && prevValue !== 0 ? yScale(prevValue) - 10 : prevValue < 0 ? yScale(prevValue) + 10 : prevValue === 0 && yCordinate < 0 ? yScale(0) + 10 : prevValue === 0 && yCordinate > 0 ? yScale(0) - 10 : yScale(prevValue) - 10 : yCordinate < 0 ? yScale(0) + 10 : yScale(0) - 10;
13790
13933
  }
13791
- ;
13792
13934
  }
13793
13935
  } catch (e) {
13794
13936
  throw e;
@@ -13803,14 +13945,20 @@ const dataTablePreCalculation = (formatOptions, yLabel, yTitle, seriesData, dime
13803
13945
  let exactAvailableWidth = yLabel + yTitle;
13804
13946
  seriesData.forEach((data, i) => {
13805
13947
  let tempObj = {
13806
- "data": data.data.filter((data2) => dimensionList.includes(data2.dimension)),
13807
- "properties": {
13808
- "legend": data.properties.alias,
13809
- "color": data.properties.color,
13810
- "markerColor": data.properties.markerColor,
13811
- "markerShape": data.properties.markerShape,
13812
- "lineStyle": data.properties.lineStyle,
13813
- "height": calculateDataTableObjectHeight(data.properties.alias.includes("~$~") ? data.properties.alias.split("~$~")[1] : data.properties.alias, exactAvailableWidth, formatOptions)
13948
+ data: data.data.filter(
13949
+ (data2) => dimensionList.includes(data2.dimension)
13950
+ ),
13951
+ properties: {
13952
+ legend: data.properties.alias,
13953
+ color: data.properties.color,
13954
+ markerColor: data.properties.markerColor,
13955
+ markerShape: data.properties.markerShape,
13956
+ lineStyle: data.properties.lineStyle,
13957
+ height: calculateDataTableObjectHeight(
13958
+ data.properties.alias.includes("~$~") ? data.properties.alias.split("~$~")[1] : data.properties.alias,
13959
+ exactAvailableWidth,
13960
+ formatOptions
13961
+ )
13814
13962
  }
13815
13963
  };
13816
13964
  dataTableHeight += tempObj.properties.height;
@@ -13827,9 +13975,19 @@ const dataTablePreCalculation = (formatOptions, yLabel, yTitle, seriesData, dime
13827
13975
  const calculateDataTableObjectHeight = (legend, maxWidthAvailable, formatOptions) => {
13828
13976
  try {
13829
13977
  let minHeight = 20;
13830
- let legendWidth = calculateWidthHeightDynamically(legend, formatOptions.dataTableProperties.dataTableFontSize, formatOptions.dataTableProperties.dataTableFontFamily)[0];
13978
+ let legendWidth = calculateWidthHeightDynamically(
13979
+ legend,
13980
+ formatOptions.dataTableProperties.dataTableFontSize,
13981
+ formatOptions.dataTableProperties.dataTableFontFamily
13982
+ )[0];
13831
13983
  if (legendWidth > maxWidthAvailable) {
13832
- minHeight = calculateWidthHeightDynamically(legend, formatOptions.dataTableProperties.dataTableFontSize, formatOptions.dataTableProperties.dataTableFontFamily, void 0, maxWidthAvailable)[1];
13984
+ minHeight = calculateWidthHeightDynamically(
13985
+ legend,
13986
+ formatOptions.dataTableProperties.dataTableFontSize,
13987
+ formatOptions.dataTableProperties.dataTableFontFamily,
13988
+ void 0,
13989
+ maxWidthAvailable
13990
+ )[1];
13833
13991
  }
13834
13992
  return minHeight;
13835
13993
  } catch (error) {
@@ -13840,10 +13998,49 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
13840
13998
  try {
13841
13999
  let getLegendsAppended = function(temp, i, data, cellHeight2) {
13842
14000
  if (i == 0) {
13843
- temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY).attr("class", "blankClass").attr("width", margin.left).attr("height", 20).append("xhtml:div").style("width", margin.left).style("height", `${20}px`).style("border-width", outerBorder ? `0px ${0}px ${outerBorderLineWidth}px 0px` : "0px 0px 0px 0px").style("border-style", outerBorder ? `solid ${outerBorderLineStyle} ${outerBorderLineStyle} solid` : "solid solid solid solid").style("border-color", outerBorder ? `black ${outerBorderLineColor} ${outerBorderLineColor} black` : "black black black black").style("text-align", "center").style("vertical-align", "middle").text("");
14001
+ temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY).attr("class", "blankClass").attr("width", margin.left).attr("height", 20).append("xhtml:div").style("width", margin.left).style("height", `${20}px`).style(
14002
+ "border-width",
14003
+ outerBorder ? `0px ${0}px ${outerBorderLineWidth}px 0px` : "0px 0px 0px 0px"
14004
+ ).style(
14005
+ "border-style",
14006
+ outerBorder ? `solid ${outerBorderLineStyle} ${outerBorderLineStyle} solid` : "solid solid solid solid"
14007
+ ).style(
14008
+ "border-color",
14009
+ outerBorder ? `black ${outerBorderLineColor} ${outerBorderLineColor} black` : "black black black black"
14010
+ ).style("text-align", "center").style("vertical-align", "middle").text("");
13844
14011
  }
13845
14012
  let legendsParentTag = temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY + yCordinate).attr("width", margin.left).attr("height", cellHeight2);
13846
- let innerdiv = legendsParentTag.append("xhtml:div").style("display", "flex").style("justify-content", "flex-start").style("align-items", "center").attr("class", "parentClass").style("flex-wrap", "nowrap").style("pointer-events", "auto").style("width", cellWidth).style("height", `${cellHeight2}px`).style("padding-left", `5px`).style("padding-right", `3px`).style("border-width", getBorderStyle(formatOptions, i, void 0, dimensionCount, legendsCount, "width")).style("border-style", getBorderStyle(formatOptions, i, void 0, dimensionCount, legendsCount, "style")).style("border-color", getBorderStyle(formatOptions, i, void 0, dimensionCount, legendsCount, "color"));
14013
+ let innerdiv = legendsParentTag.append("xhtml:div").style("display", "flex").style("justify-content", "flex-start").style("align-items", "center").attr("class", "parentClass").style("flex-wrap", "nowrap").style("pointer-events", "auto").style("width", cellWidth).style("height", `${cellHeight2}px`).style("padding-left", `5px`).style("padding-right", `3px`).style(
14014
+ "border-width",
14015
+ getBorderStyle(
14016
+ formatOptions,
14017
+ i,
14018
+ void 0,
14019
+ dimensionCount,
14020
+ legendsCount,
14021
+ "width"
14022
+ )
14023
+ ).style(
14024
+ "border-style",
14025
+ getBorderStyle(
14026
+ formatOptions,
14027
+ i,
14028
+ void 0,
14029
+ dimensionCount,
14030
+ legendsCount,
14031
+ "style"
14032
+ )
14033
+ ).style(
14034
+ "border-color",
14035
+ getBorderStyle(
14036
+ formatOptions,
14037
+ i,
14038
+ void 0,
14039
+ dimensionCount,
14040
+ legendsCount,
14041
+ "color"
14042
+ )
14043
+ );
13847
14044
  switch (chartType) {
13848
14045
  case chartTypes.ColumnChart:
13849
14046
  case chartTypes.StackColumnChart:
@@ -13865,7 +14062,16 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
13865
14062
  {
13866
14063
  text = data.properties.legend;
13867
14064
  }
13868
- innerdiv.append("xhtml:div").style("max-width", cellWidth).attr("class", "demo").style("text-align", "left").style("vertical-align", "middle").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style("text-decoration", fontStyle.includes("Underline") ? "Underline" : "").style("padding-left", `5px`).style("white-space", "normal").style("overflow-wrap", "break-word").style("color", "black").style("width", "100%").style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr("title", text).text(text);
14065
+ innerdiv.append("xhtml:div").style("max-width", cellWidth).attr("class", "demo").style("text-align", "left").style("vertical-align", "middle").style(
14066
+ "font-size",
14067
+ formatOptions.dataTableProperties.dataTableFontSize + "px"
14068
+ ).style(
14069
+ "font-family",
14070
+ formatOptions.dataTableProperties.dataTableFontFamily
14071
+ ).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14072
+ "text-decoration",
14073
+ fontStyle.includes("Underline") ? "Underline" : ""
14074
+ ).style("padding-left", `5px`).style("white-space", "normal").style("overflow-wrap", "break-word").style("color", "black").style("width", "100%").style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr("title", text).text(text);
13869
14075
  };
13870
14076
  let innerVerticalBorderLineWidth = formatOptions.dataTableInnerBorder.verticalBorderLineWidth;
13871
14077
  let innerHorizontalBorderLineWidth = formatOptions.dataTableInnerBorder.horizontalBorderLineWidth;
@@ -13900,25 +14106,126 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
13900
14106
  (d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
13901
14107
  );
13902
14108
  if (i == 0 && formatOptions.dataTableProperties.dataTableAxisLabel) {
13903
- parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", "20px").append("xhtml:div").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${20}px`).style("border-width", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "width", "colHeaders")).style("border-style", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "style", "colHeaders")).style("border-color", (d, index2) => getBorderStyle(formatOptions, index2, void 0, dimensionCount, legendsCount, "color", "colHeaders")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14109
+ parentTag.append("foreignObject").attr("class", "dataTableColHeaders").attr("x", 0).attr("y", tableStartY).attr("id", (d, index2) => index2).attr(
14110
+ "width",
14111
+ (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth
14112
+ ).attr("height", "20px").append("xhtml:div").style(
14113
+ "width",
14114
+ (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth
14115
+ ).style("height", `${20}px`).style(
14116
+ "border-width",
14117
+ (d, index2) => getBorderStyle(
14118
+ formatOptions,
14119
+ index2,
14120
+ void 0,
14121
+ dimensionCount,
14122
+ legendsCount,
14123
+ "width",
14124
+ "colHeaders"
14125
+ )
14126
+ ).style(
14127
+ "border-style",
14128
+ (d, index2) => getBorderStyle(
14129
+ formatOptions,
14130
+ index2,
14131
+ void 0,
14132
+ dimensionCount,
14133
+ legendsCount,
14134
+ "style",
14135
+ "colHeaders"
14136
+ )
14137
+ ).style(
14138
+ "border-color",
14139
+ (d, index2) => getBorderStyle(
14140
+ formatOptions,
14141
+ index2,
14142
+ void 0,
14143
+ dimensionCount,
14144
+ legendsCount,
14145
+ "color",
14146
+ "colHeaders"
14147
+ )
14148
+ ).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-left", "3px").style(
14149
+ "font-size",
14150
+ formatOptions.dataTableProperties.dataTableFontSize + "px"
14151
+ ).style(
14152
+ "font-family",
14153
+ formatOptions.dataTableProperties.dataTableFontFamily
14154
+ ).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
13904
14155
  "text-decoration",
13905
14156
  fontStyle.includes("Underline") ? "Underline" : ""
13906
- ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style("color", "black").attr("title", (d, index2) => formatedDimensionMap.get(Array.isArray(d.dimension) ? d.dimension[0] : d.dimension)).text((d, index2) => formatedDimensionMap.get(Array.isArray(d.dimension) ? d.dimension[0] : d.dimension));
14157
+ ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").style("color", "black").attr(
14158
+ "title",
14159
+ (d, index2) => formatedDimensionMap.get(
14160
+ Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
14161
+ )
14162
+ ).text(
14163
+ (d, index2) => formatedDimensionMap.get(
14164
+ Array.isArray(d.dimension) ? d.dimension[0] : d.dimension
14165
+ )
14166
+ );
13907
14167
  }
13908
- parentTag.append("foreignObject").attr("x", (d) => 0).attr("y", tableStartY + yCordinate).attr("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).attr("height", cellHeight).style("justify-content", "center").append("xhtml:div").attr("class", "middlepart").style("width", (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth).style("height", `${cellHeight}px`).style("line-height", `${cellHeight}px`).style("border-width", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "width")).style("border-style", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "style")).style("border-color", (d, pos) => getBorderStyle(formatOptions, i, pos, dimensionCount, legendsCount, "color")).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-inline", "3px").style("font-size", formatOptions.dataTableProperties.dataTableFontSize + "px").style("font-family", formatOptions.dataTableProperties.dataTableFontFamily).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14168
+ parentTag.append("foreignObject").attr("x", (d) => 0).attr("y", tableStartY + yCordinate).attr(
14169
+ "width",
14170
+ (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth
14171
+ ).attr("height", cellHeight).style("justify-content", "center").append("xhtml:div").attr("class", "middlepart").style(
14172
+ "width",
14173
+ (d, index2) => index2 === 0 ? cellWidth + outerPadding + calWidthForSeriesNames / 2 : index2 === dimensionCount - 1 ? cellWidth + outerPadding - calWidthForSeriesNames / 2 : cellWidth
14174
+ ).style("height", `${cellHeight}px`).style("line-height", `${cellHeight}px`).style(
14175
+ "border-width",
14176
+ (d, pos) => getBorderStyle(
14177
+ formatOptions,
14178
+ i,
14179
+ pos,
14180
+ dimensionCount,
14181
+ legendsCount,
14182
+ "width"
14183
+ )
14184
+ ).style(
14185
+ "border-style",
14186
+ (d, pos) => getBorderStyle(
14187
+ formatOptions,
14188
+ i,
14189
+ pos,
14190
+ dimensionCount,
14191
+ legendsCount,
14192
+ "style"
14193
+ )
14194
+ ).style(
14195
+ "border-color",
14196
+ (d, pos) => getBorderStyle(
14197
+ formatOptions,
14198
+ i,
14199
+ pos,
14200
+ dimensionCount,
14201
+ legendsCount,
14202
+ "color"
14203
+ )
14204
+ ).style("text-align", "center").style("white-space", "nowrap").style("text-overflow", "ellipsis").style("overflow", "hidden").style("padding-inline", "3px").style(
14205
+ "font-size",
14206
+ formatOptions.dataTableProperties.dataTableFontSize + "px"
14207
+ ).style(
14208
+ "font-family",
14209
+ formatOptions.dataTableProperties.dataTableFontFamily
14210
+ ).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
13909
14211
  "text-decoration",
13910
14212
  fontStyle.includes("Underline") ? "Underline" : ""
13911
- ).style("color", formatOptions.dataTableProperties.dataTableLabelColor).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr("title", (d) => getNumberWithFormat(
13912
- chartType.includes("100stack") ? d.TooltipMeasure / d.TotalMeasure : d.TooltipMeasure || d.value,
13913
- formatOptions.dataTableProperties.dataTableDisplayUnits,
13914
- formatOptions.dataTableProperties.dataTableNumberFormat,
13915
- formatOptions.dataTableProperties.dataTableDecimalPrecision
13916
- )).text((d) => getNumberWithFormat(
13917
- chartType.includes("100stack") ? d.TooltipMeasure / d.TotalMeasure : d.TooltipMeasure || d.value,
13918
- formatOptions.dataTableProperties.dataTableDisplayUnits,
13919
- formatOptions.dataTableProperties.dataTableNumberFormat,
13920
- formatOptions.dataTableProperties.dataTableDecimalPrecision
13921
- ));
14213
+ ).style("color", formatOptions.dataTableProperties.dataTableLabelColor).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr(
14214
+ "title",
14215
+ (d) => getNumberWithFormat(
14216
+ chartType.includes("100stack") ? d.TooltipMeasure / d.TotalMeasure : d.TooltipMeasure || d.value,
14217
+ formatOptions.dataTableProperties.dataTableDisplayUnits,
14218
+ formatOptions.dataTableProperties.dataTableNumberFormat,
14219
+ formatOptions.dataTableProperties.dataTableDecimalPrecision
14220
+ )
14221
+ ).text(
14222
+ (d) => getNumberWithFormat(
14223
+ chartType.includes("100stack") ? d.TooltipMeasure / d.TotalMeasure : d.TooltipMeasure || d.value,
14224
+ formatOptions.dataTableProperties.dataTableDisplayUnits,
14225
+ formatOptions.dataTableProperties.dataTableNumberFormat,
14226
+ formatOptions.dataTableProperties.dataTableDecimalPrecision
14227
+ )
14228
+ );
13922
14229
  });
13923
14230
  } catch (error) {
13924
14231
  throw error;
@@ -14585,7 +14892,9 @@ function getStackedData(dimensionList, seriesData, isNormalizedChart) {
14585
14892
  let absoluteTotal = 0;
14586
14893
  let displayTotal = 0;
14587
14894
  for (let k2 = 0; k2 < seriesData.length; k2++) {
14588
- let measure = seriesData[k2].data.find((dimensionData) => dimensionData.dimension === dimensionList[j])?.value || 0;
14895
+ let measure = seriesData[k2].data.find(
14896
+ (dimensionData) => dimensionData.dimension === dimensionList[j]
14897
+ )?.value || 0;
14589
14898
  stackChartObj[seriesData[k2].properties.legend] = measure;
14590
14899
  sum2 = sum2 + (isNormalizedChart ? Math.abs(measure) : measure);
14591
14900
  absoluteTotal += measure > 0 ? measure : 0;
@@ -14677,7 +14986,11 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14677
14986
  let dataLabelColor = formatOptions?.annotation?.annotationSetLabelColor == "2" ? "color" : "labelColor";
14678
14987
  let fontStyle = formatOptions.annotation.annotationFontStyle;
14679
14988
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
14680
- oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartType);
14989
+ oldAnnotationList = conditionallyResetOldAnnotations(
14990
+ oldAnnotationList,
14991
+ formatOptions,
14992
+ chartType
14993
+ );
14681
14994
  let annotationsList = [];
14682
14995
  let finalAnnotationList = [];
14683
14996
  if (oldAnnotationList.length != 0) {
@@ -14701,9 +15014,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14701
15014
  break;
14702
15015
  case "1":
14703
15016
  for (let i = 0; i < chartData[0].length; i++) {
14704
- chartData.forEach(
14705
- (d) => labelData.push(d[i])
14706
- );
15017
+ chartData.forEach((d) => labelData.push(d[i]));
14707
15018
  }
14708
15019
  break;
14709
15020
  case "5":
@@ -14740,7 +15051,6 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14740
15051
  if (maxValue < d.Measure) {
14741
15052
  maxValue = d.Measure;
14742
15053
  }
14743
- ;
14744
15054
  });
14745
15055
  let minValue = maxValue * 0.1;
14746
15056
  labelData.forEach((d, i) => {
@@ -14783,12 +15093,15 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14783
15093
  width: 15
14784
15094
  },
14785
15095
  color: d.properties[dataLabelColor],
14786
- type: annotationTypeforCharts(d3Annotation2, parseFloat(annotationType)),
15096
+ type: annotationTypeforCharts(
15097
+ d3Annotation2,
15098
+ parseFloat(annotationType)
15099
+ ),
14787
15100
  height,
14788
15101
  width
14789
15102
  };
14790
15103
  dimensionList.includes(d.data.dimension) && // !labelExcludeList.includes(d.key) && (d.data.total > 0 ? (yScaleLeft(d[1]) <= barChart ? innerWidth : innerHeight && yScaleLeft(d[1]) >= 0) : (yScaleLeft(d[0]) < (dataTableHeight > 0 ? barChart ? innerWidth : innerHeight - dataTableHeight : barChart ? innerWidth : innerHeight)))
14791
- // ?
15104
+ // ?
14792
15105
  annotationsList.push(singleAnnotation);
14793
15106
  });
14794
15107
  oldAnnotationList = oldAnnotationList.length == 0 ? annotationsList : oldAnnotationList;
@@ -14803,17 +15116,30 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14803
15116
  newAnnotation.data.isVisible = oldAnnotation.data.isVisible ?? true;
14804
15117
  newAnnotation.connector.points = oldAnnotation.connector.points;
14805
15118
  if (formatOptions.annotation.annotationType == "5" && newAnnotation.dx == 0 && newAnnotation.dy == 0) {
14806
- newAnnotation.connector["points"] = [[0, 0], [0, 0]];
15119
+ newAnnotation.connector["points"] = [
15120
+ [0, 0],
15121
+ [0, 0]
15122
+ ];
14807
15123
  }
14808
15124
  }
14809
15125
  });
14810
15126
  }
14811
15127
  finalAnnotationList.push(newAnnotation);
14812
15128
  });
14813
- makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
15129
+ makeAnnotations.editMode(
15130
+ formatOptions.annotation.annotationDraggable && isReportEditable
15131
+ ).accessors({
14814
15132
  x: function(d) {
14815
15133
  if (barChart) {
14816
- return dataLabelsPositionForBarChartFamily(formatOptions, d.x, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
15134
+ return dataLabelsPositionForBarChartFamily(
15135
+ formatOptions,
15136
+ d.x,
15137
+ parseFloat(d.position),
15138
+ yScaleLeft,
15139
+ minValue,
15140
+ d.prevValue,
15141
+ chartType
15142
+ );
14817
15143
  } else {
14818
15144
  return xScale(d.x) + xScale.bandwidth() / 2;
14819
15145
  }
@@ -14822,7 +15148,14 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14822
15148
  if (barChart) {
14823
15149
  return xScale(d.y) + xScale.bandwidth() / 2;
14824
15150
  } else {
14825
- return dataLabelsPosition(d.y, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
15151
+ return dataLabelsPosition(
15152
+ d.y,
15153
+ parseFloat(d.position),
15154
+ yScaleLeft,
15155
+ minValue,
15156
+ d.prevValue,
15157
+ chartType
15158
+ );
14826
15159
  }
14827
15160
  }
14828
15161
  }).on("dragend", function(annotation2) {
@@ -14830,12 +15163,13 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14830
15163
  annotation2.data.isVisible = true;
14831
15164
  oldAnnotationList.forEach((d) => {
14832
15165
  if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
14833
- annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y).attr("display", "block");
15166
+ annotations.selectAll(".annotation-note-label").filter(
15167
+ (d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y
15168
+ ).attr("display", "block");
14834
15169
  d.data.isVisible = true;
14835
15170
  }
14836
15171
  });
14837
15172
  }
14838
- ;
14839
15173
  oldAnnotationList.forEach((d) => {
14840
15174
  if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
14841
15175
  d.dx = annotation2._dx * width / d.width;
@@ -14852,7 +15186,9 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14852
15186
  annotation2.data.isVisible = false;
14853
15187
  oldAnnotationList.forEach((d) => {
14854
15188
  if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
14855
- annotations.selectAll(".annotation-note-label").filter((d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y).attr("display", "none");
15189
+ annotations.selectAll(".annotation-note-label").filter(
15190
+ (d2) => d2.data.x == annotation2.data.x && d2.data.y == annotation2.data.y
15191
+ ).attr("display", "none");
14856
15192
  d.data.isVisible = false;
14857
15193
  }
14858
15194
  });
@@ -14863,7 +15199,15 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14863
15199
  y: (d) => yScaleLeft.invert(d.y)
14864
15200
  }).notePadding(0).annotations(finalAnnotationList);
14865
15201
  if (true) svg.selectAll(".annotation-group").remove();
14866
- let annotations = appendAnnotations(svg, formatOptions, margin, fontStyle, makeAnnotations, connectorType, false);
15202
+ let annotations = appendAnnotations(
15203
+ svg,
15204
+ formatOptions,
15205
+ margin,
15206
+ fontStyle,
15207
+ makeAnnotations,
15208
+ connectorType,
15209
+ false
15210
+ );
14867
15211
  }
14868
15212
  } catch (error) {
14869
15213
  throw error;
@@ -14877,9 +15221,15 @@ const appendAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotation
14877
15221
  ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").call(makeAnnotations);
14878
15222
  annotations.selectAll("rect").style("visibility", "hidden");
14879
15223
  annotations.selectAll(".annotation-subject").remove();
14880
- annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle]);
15224
+ annotations.selectAll(".connector").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
15225
+ "stroke-dasharray",
15226
+ connectedStyle[formatOptions.annotation.connectorStyle]
15227
+ );
14881
15228
  annotations.selectAll(`.connector-${ConnectorType}`).attr("fill", formatOptions.annotation.connectorColor || "#ccc").style("stroke", formatOptions.annotation.connectorColor || "#ccc");
14882
- annotations.selectAll(".note-line").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr("stroke-dasharray", connectedStyle[formatOptions.annotation.connectorStyle]).filter((d) => d._dx == 0 && d._dy == 0).remove();
15229
+ annotations.selectAll(".note-line").style("stroke", formatOptions.annotation.connectorColor || "#ccc").attr(
15230
+ "stroke-dasharray",
15231
+ connectedStyle[formatOptions.annotation.connectorStyle]
15232
+ ).filter((d) => d._dx == 0 && d._dy == 0).remove();
14883
15233
  annotations.selectAll(".connector-end").filter((d) => d.connector.end == "dot" && d._dx == 0 && d._dy == 0).remove();
14884
15234
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && !d.data.isVisible).style("display", "none");
14885
15235
  formatOptions.annotation.annotationType == "1" && annotations.selectAll(".annotation-note-content").attr("transform", function() {
@@ -14893,8 +15243,17 @@ const appendAnnotations = (svg, formatOptions, margin, fontStyle, makeAnnotation
14893
15243
  annotations.selectAll("text").style(
14894
15244
  "text-anchor",
14895
15245
  (d) => isBarChart ? d.data.position == "2" ? "middle" : "start" : "start"
14896
- ).append("text").style("fill", formatOptions.annotation.annotationColor !== commonColors.white ? formatOptions.annotation.annotationColor : "none");
14897
- annotations.selectAll("tspan").attr("hoverId", (d) => d.data.hoverId ? d.data.hoverId : d.data.currentLegend.replaceAll(" ", "-")).style("visibility", (d) => parseFloat(d.data.y) == 0 && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible");
15246
+ ).append("text").style(
15247
+ "fill",
15248
+ formatOptions.annotation.annotationColor !== commonColors.white ? formatOptions.annotation.annotationColor : "none"
15249
+ );
15250
+ annotations.selectAll("tspan").attr(
15251
+ "hoverId",
15252
+ (d) => d.data.hoverId ? d.data.hoverId : d.data.currentLegend.replaceAll(" ", "-")
15253
+ ).style(
15254
+ "visibility",
15255
+ (d) => parseFloat(d.data.y) == 0 && formatOptions.annotation.annotationHideZeroValues ? "hidden" : "visible"
15256
+ );
14898
15257
  return annotations;
14899
15258
  };
14900
15259
  const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xAxisBottom) => {
@@ -14907,18 +15266,20 @@ const initXaxisBar = (formatOptions, gTag, yLabel, innerHeight2, innerWidth2, xA
14907
15266
  );
14908
15267
  const xAxisG = gTag.append("g").call(xAxisBottom).attr("transform", `translate(0,${innerHeight2})`);
14909
15268
  xAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em").attr("stroke-opacity", formatOptions.plotArea.fitChart ? "1" : "0");
14910
- ;
14911
- xAxisG.selectAll("text").style("text-anchor", rotation == "rotate(0)" ? "middle" : "end").attr("dx", rotation == "rotate(0)" ? ".2em" : "-.1em").attr("dy", rotation == "rotate(0)" ? "1em" : ".15em").attr("transform", rotation).attr("transform", "rotate(-90) translate(-5,-5)").style("text-anchor", "end").style("fill", formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none").style("font-size", formatOptions.yAxisLabel.yAxisLabelFontSize).style("font-family", formatOptions.yAxisLabel.yAxisLabelFontFamily).style("font-style", formatOptions.yAxisLabel.yAxisLabelFontStyle).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
15269
+ xAxisG.selectAll("text").style("text-anchor", rotation == "rotate(0)" ? "middle" : "end").attr("dx", rotation == "rotate(0)" ? ".2em" : "-.1em").attr("dy", rotation == "rotate(0)" ? "1em" : ".15em").attr("transform", rotation).attr("transform", "rotate(-90) translate(-5,-5)").style("text-anchor", "end").style(
15270
+ "fill",
15271
+ formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
15272
+ ).style("font-size", formatOptions.yAxisLabel.yAxisLabelFontSize).style("font-family", formatOptions.yAxisLabel.yAxisLabelFontFamily).style("font-style", formatOptions.yAxisLabel.yAxisLabelFontStyle).style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14912
15273
  "text-decoration",
14913
15274
  fontStyle.includes("Underline") ? "Underline" : ""
14914
15275
  ).style("font-weight", fontStyle.includes("Bold") ? "Bold" : "").attr(
14915
15276
  "visibility",
14916
15277
  formatOptions.yAxisLabel.yAxisLabelVisibility ? "visible" : "hidden"
14917
15278
  );
14918
- xAxisG.select(".domain").style("shape-rendering", "crispEdges").style(
14919
- "stroke",
14920
- formatOptions.yAxisLabel.yAxisColor
14921
- ).attr("stroke-width", formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
15279
+ xAxisG.select(".domain").style("shape-rendering", "crispEdges").style("stroke", formatOptions.yAxisLabel.yAxisColor).attr(
15280
+ "stroke-width",
15281
+ formatOptions.yAxisLabel.yAxisWidth ? formatOptions.yAxisLabel.yAxisWidth : formatOptions.plotArea.plotAreaBorderThickness
15282
+ );
14922
15283
  } catch (error) {
14923
15284
  throw error;
14924
15285
  }
@@ -14953,16 +15314,39 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14953
15314
  let dimHeight = xScale.step();
14954
15315
  const lineHeight = parseInt(formatOptions.xAxisLabel.xAxisLabelFontSize) * 1.2;
14955
15316
  const maxLines = Math.floor(dimHeight / lineHeight);
14956
- let yRect = gTag.append("rect").attr("id", "yAxisRect").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${-xLabelMargin + 10},0)` : `translate(${xaxisLabelPosition === 0 ? -xLabelMargin - 5 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0) + (-xLabelMargin - 5)},0)`).attr("height", innerHeight2).attr("width", chartType === chartTypes.TornadoChart ? xLabelMargin + 20 : xLabelMargin + 5).attr(
15317
+ const isRotationZero = formatOptions.xAxisLabel.xAxisLabelRotation == 0;
15318
+ let yRect = gTag.append("rect").attr("id", "yAxisRect").attr(
15319
+ "transform",
15320
+ chartType === chartTypes.TornadoChart ? `translate(${-xLabelMargin + 10},0)` : `translate(${xaxisLabelPosition === 0 ? -xLabelMargin - 5 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0) + (-xLabelMargin - 5)},0)`
15321
+ ).attr("height", innerHeight2).attr(
15322
+ "width",
15323
+ chartType === chartTypes.TornadoChart ? xLabelMargin + 20 : xLabelMargin + 5
15324
+ ).attr(
14957
15325
  "fill",
14958
15326
  formatOptions.xAxisLabel.xAxisLabelVisibility ? formatOptions.xAxisLabel.xAxisBackgroundColor ? formatOptions.xAxisLabel.xAxisBackgroundColor !== commonColors.white ? formatOptions.xAxisLabel.xAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
14959
15327
  );
14960
- const YaxisG = gTag.append("g").attr("id", "yAxisG").attr("transform", isTornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`).call(yAxis);
15328
+ const YaxisG = gTag.append("g").attr("id", "yAxisG").attr(
15329
+ "transform",
15330
+ isTornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`
15331
+ ).call(yAxis);
14961
15332
  let foreignObject = YaxisG.selectAll("g").append("foreignObject").attr("class", "testingoverflowing").style("align-content", "center").attr("width", xLabelMargin).attr("height", dimHeight + "px").attr(
14962
15333
  "transform",
14963
- getTransformStringForYaxisLabels(isTornadoChart, xaxisLabelPosition, formatOptions, xScaleBottom, yMaxLeft, xLabelMargin, xLabel, dimHeight)
15334
+ getTransformStringForYaxisLabels(
15335
+ isTornadoChart,
15336
+ xaxisLabelPosition,
15337
+ formatOptions,
15338
+ xScaleBottom,
15339
+ yMaxLeft,
15340
+ xLabelMargin,
15341
+ xLabel,
15342
+ dimHeight
15343
+ )
14964
15344
  );
14965
- let xLabelh3 = foreignObject.append("xhtml:h3").style("text-align", formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? "center" : "start").style("user-select", "none").style("margin", 0);
15345
+ let innerDiv = foreignObject.append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").style("justify-content", isRotationZero ? "center" : "start").style("align-items", isRotationZero ? "start" : "center").style("overflow", "visible").style("text-align", "center");
15346
+ let xLabelh3 = innerDiv.append("xhtml:div").style(
15347
+ "text-align",
15348
+ formatOptions.xAxisLabel.xAxisLabelRotation == 0 ? "center" : "start"
15349
+ ).style("user-select", "none").style("margin", 0);
14966
15350
  if (formatOptions.xAxisLabel.labelTextWrap && !formatOptions.xAxisLabel.multiLineLabelWrap || !formatOptions.xAxisLabel.labelTextWrap) {
14967
15351
  xLabelh3.style("white-space", "pre").style("text-overflow", "ellipsis").style("overflow", "hidden");
14968
15352
  }
@@ -14987,20 +15371,11 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14987
15371
  "stroke-width",
14988
15372
  formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14989
15373
  );
14990
- YaxisRightG.selectAll("text").style(
14991
- "visibility",
14992
- "hidden"
14993
- );
15374
+ YaxisRightG.selectAll("text").style("visibility", "hidden");
14994
15375
  }
14995
- YaxisG.selectAll("text").style(
14996
- "visibility",
14997
- "hidden"
14998
- );
15376
+ YaxisG.selectAll("text").style("visibility", "hidden");
14999
15377
  } else {
15000
- YaxisG.selectAll("text").style(
15001
- "visibility",
15002
- "hidden"
15003
- );
15378
+ YaxisG.selectAll("text").style("visibility", "hidden");
15004
15379
  }
15005
15380
  YaxisG.selectAll("line").style("shape-rendering", "crispEdges").style("stroke", formatOptions.plotArea.gridLinesColor).attr(
15006
15381
  "visibility",
@@ -15009,10 +15384,7 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
15009
15384
  YaxisG.select(".domain").style("shape-rendering", "crispEdges").attr(
15010
15385
  "stroke-width",
15011
15386
  formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
15012
- ).style(
15013
- "stroke",
15014
- formatOptions.xAxisLabel.xAxisColor
15015
- );
15387
+ ).style("stroke", formatOptions.xAxisLabel.xAxisColor);
15016
15388
  } catch (e) {
15017
15389
  throw e;
15018
15390
  }
@@ -15476,7 +15848,7 @@ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width,
15476
15848
  svg,
15477
15849
  seriesData,
15478
15850
  7,
15479
- chartTitleHeight + 5,
15851
+ chartTitleHeight,
15480
15852
  width - 10,
15481
15853
  30,
15482
15854
  position,
@@ -22804,7 +23176,7 @@ const HorizontalBarChart = ({
22804
23176
  margin,
22805
23177
  yTitle,
22806
23178
  yLabel,
22807
- width
23179
+ innerWidth2
22808
23180
  );
22809
23181
  yAxistitleRight(
22810
23182
  svg,
@@ -27421,7 +27793,7 @@ const PieChart = ({ data, formatOptions, chartId }) => {
27421
27793
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27422
27794
  )(d.currentTarget.__data__.data.data[0].value)
27423
27795
  },
27424
- { key: "Legend", value: d.currentTarget.__data__.data.legend }
27796
+ { key: "Legend", value: d.currentTarget.__data__.data.properties.alias }
27425
27797
  ],
27426
27798
  chartFormatOptions,
27427
27799
  void 0,
@@ -27821,7 +28193,7 @@ const DonutChart = ({
27821
28193
  chartFormatOptions.toolTip.toolTipDecimalPrecision
27822
28194
  )(d.currentTarget.__data__.data.data[0].value)
27823
28195
  },
27824
- { key: "Legend", value: d.currentTarget.__data__.data.legend }
28196
+ { key: "Legend", value: d.currentTarget.__data__.data.properties.alias }
27825
28197
  ],
27826
28198
  chartFormatOptions,
27827
28199
  void 0,