pace-chart-lib 1.0.18 → 1.0.20

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.
@@ -11434,81 +11434,73 @@ const chartMargins = {
11434
11434
  bottom: 0,
11435
11435
  left: 0
11436
11436
  };
11437
- var actualChartTypes = /* @__PURE__ */ ((actualChartTypes2) => {
11438
- actualChartTypes2["waterfall"] = "Waterfall";
11439
- actualChartTypes2["lineWithMarker"] = "LineWithMarker";
11440
- actualChartTypes2["stackLine"] = "StackLine";
11441
- actualChartTypes2["stackLine100"] = "100StackLine";
11442
- actualChartTypes2["line"] = "Line";
11443
- actualChartTypes2["bar"] = "Bar";
11444
- actualChartTypes2["stackColumn"] = "StackColumn";
11445
- actualChartTypes2["area"] = "Area";
11446
- actualChartTypes2["pie"] = "Pie";
11447
- actualChartTypes2["sankey"] = "Sankey";
11448
- actualChartTypes2["sunburst"] = "Sunburst";
11449
- actualChartTypes2["horizontalBar"] = "HorizontalBar";
11450
- actualChartTypes2["stackArea"] = "StackArea";
11451
- actualChartTypes2["stackArea100"] = "100StackArea";
11452
- actualChartTypes2["treeMap"] = "TreeMap";
11453
- actualChartTypes2["stackBar"] = "StackBar";
11454
- actualChartTypes2["stackColumn100"] = "100StackColumn";
11455
- actualChartTypes2["stackBar100"] = "100StackBar";
11456
- actualChartTypes2["scatterPlot"] = "ScatterPlot";
11457
- actualChartTypes2["customColumnChart"] = "CustomColumnChart";
11458
- actualChartTypes2["customBarChart"] = "CustomBarChart";
11459
- actualChartTypes2["histogram"] = "Histogram";
11460
- actualChartTypes2["columnHistogram"] = "ColumnHistogram";
11461
- actualChartTypes2["barHistogram"] = "BarHistogram";
11462
- actualChartTypes2["column"] = "Column";
11463
- actualChartTypes2["miscellaneous"] = "Miscellaneous";
11464
- actualChartTypes2["custom"] = "Custom";
11465
- actualChartTypes2["collapsableTree"] = "CollapsableTree";
11466
- actualChartTypes2["maps"] = "Maps";
11467
- actualChartTypes2["tornadoChart"] = "Tornado";
11468
- actualChartTypes2["pieOfPie"] = "PieOfPie";
11469
- actualChartTypes2["wordCloud"] = "WordCloud";
11470
- actualChartTypes2["boxPlot"] = "BoxPlot";
11471
- actualChartTypes2["bubblePlot"] = "BubblePlot";
11472
- actualChartTypes2["vennDiagramChart"] = "VennDiagramChart";
11473
- actualChartTypes2["speedometerChart"] = "SpeedometerChart";
11474
- actualChartTypes2["layeredColumnChart"] = "LayeredColumnChart";
11475
- actualChartTypes2["layeredBarChart"] = "LayeredBarChart";
11476
- actualChartTypes2["organizationalChart"] = "OrganizationalChart";
11477
- actualChartTypes2["pyramidChart"] = "PyramidChart";
11478
- actualChartTypes2["scaleBreakStackedColumnChart"] = "ScaleBreakStackedColumnChart";
11479
- actualChartTypes2["progressChart"] = "ProgressChart";
11480
- actualChartTypes2["radialBarChart"] = "RadialBarChart";
11481
- return actualChartTypes2;
11482
- })(actualChartTypes || {});
11437
+ var chartTypes = /* @__PURE__ */ ((chartTypes2) => {
11438
+ chartTypes2["WaterfallChart"] = "WaterfallChart";
11439
+ chartTypes2["StackLineChart"] = "StackLineChart";
11440
+ chartTypes2["NormalizedStackLineChart"] = "NormalizedStackLineChart";
11441
+ chartTypes2["LineChart"] = "LineChart";
11442
+ chartTypes2["ColumnChart"] = "ColumnChart";
11443
+ chartTypes2["StackColumnChart"] = "StackColumnChart";
11444
+ chartTypes2["AreaChart"] = "AreaChart";
11445
+ chartTypes2["PieChart"] = "PieChart";
11446
+ chartTypes2["SankeyChart"] = "SankeyChart";
11447
+ chartTypes2["DonutChart"] = "DonutChart";
11448
+ chartTypes2["HorizontalBarChart"] = "HorizontalBarChart";
11449
+ chartTypes2["StackAreaChart"] = "StackAreaChart";
11450
+ chartTypes2["NormalizedStackAreaChart"] = "NormalizedStackAreaChart";
11451
+ chartTypes2["Treemap"] = "Treemap";
11452
+ chartTypes2["StackHorizontalBarChart"] = "StackHorizontalBarChart";
11453
+ chartTypes2["NormalizedStackColumnChart"] = "NormalizedStackColumnChart";
11454
+ chartTypes2["NormalizedStackHorizontalBarChart"] = "NormalizedStackHorizontalBarChart";
11455
+ chartTypes2["ScatterChart"] = "ScatterChart";
11456
+ chartTypes2["CustomColumnChart"] = "CustomColumnChart";
11457
+ chartTypes2["customBarChart"] = "CustomBarChart";
11458
+ chartTypes2["ColumnHistogramChart"] = "ColumnHistogramChart";
11459
+ chartTypes2["HorizontalHistogramChart"] = "HorizontalHistogramChart";
11460
+ chartTypes2["Maps"] = "Maps";
11461
+ chartTypes2["TornadoChart"] = "TornadoChart";
11462
+ chartTypes2["PieofPie"] = "PieofPie";
11463
+ chartTypes2["WordCloud"] = "WordCloud";
11464
+ chartTypes2["BubbleChart"] = "BubbleChart";
11465
+ chartTypes2["VennChart"] = "VennChart";
11466
+ chartTypes2["Speedometer"] = "Speedometer";
11467
+ chartTypes2["LayeredColumnChart"] = "LayeredColumnChart";
11468
+ chartTypes2["LayeredHorizontalBarChart"] = "LayeredHorizontalBarChart";
11469
+ chartTypes2["OrganizationChart"] = "OrganizationChart";
11470
+ chartTypes2["PyramidChart"] = "PyramidChart";
11471
+ chartTypes2["ProgressChart"] = "ProgressChart";
11472
+ chartTypes2["RadialBarChart"] = "RadialBarChart";
11473
+ return chartTypes2;
11474
+ })(chartTypes || {});
11483
11475
  const connecterCurve = {
11484
11476
  1: "",
11485
11477
  2: curveLinear$1,
11486
11478
  3: step
11487
11479
  };
11488
11480
  const chartsWithDataTableArray = [
11489
- actualChartTypes.bar,
11490
- actualChartTypes.stackColumn,
11491
- actualChartTypes.stackColumn100,
11492
- actualChartTypes.line,
11493
- actualChartTypes.stackLine,
11494
- actualChartTypes.stackLine100,
11495
- actualChartTypes.area,
11496
- actualChartTypes.stackArea,
11497
- actualChartTypes.stackArea100
11481
+ chartTypes.ColumnChart,
11482
+ chartTypes.StackColumnChart,
11483
+ chartTypes.NormalizedStackColumnChart,
11484
+ chartTypes.LineChart,
11485
+ chartTypes.StackLineChart,
11486
+ chartTypes.NormalizedStackLineChart,
11487
+ chartTypes.AreaChart,
11488
+ chartTypes.StackAreaChart,
11489
+ chartTypes.NormalizedStackAreaChart
11498
11490
  ];
11499
11491
  const chartsWithoutPlotArea = [
11500
- actualChartTypes.pie,
11501
- actualChartTypes.pieOfPie,
11502
- actualChartTypes.sunburst,
11503
- actualChartTypes.pyramidChart,
11504
- actualChartTypes.organizationalChart,
11505
- actualChartTypes.vennDiagramChart,
11506
- actualChartTypes.progressChart,
11507
- actualChartTypes.maps,
11508
- actualChartTypes.wordCloud,
11509
- actualChartTypes.sankey,
11510
- actualChartTypes.speedometerChart,
11511
- actualChartTypes.radialBarChart
11492
+ chartTypes.PieChart,
11493
+ chartTypes.PieofPie,
11494
+ chartTypes.DonutChart,
11495
+ chartTypes.PyramidChart,
11496
+ chartTypes.OrganizationChart,
11497
+ chartTypes.VennChart,
11498
+ chartTypes.ProgressChart,
11499
+ chartTypes.Maps,
11500
+ chartTypes.WordCloud,
11501
+ chartTypes.SankeyChart,
11502
+ chartTypes.Speedometer,
11503
+ chartTypes.RadialBarChart
11512
11504
  ];
11513
11505
  function calculateWidthHeightDynamically(content, fontSize, fontFamily, rotationDegree, fixedWidth) {
11514
11506
  var div = document.createElement("div");
@@ -11882,7 +11874,7 @@ function initSvg$1(svg, width, height, formatOptions) {
11882
11874
  if (chartAreaBorder) {
11883
11875
  const borderColor = formatOptions.chartArea.chartAreaBorderColor;
11884
11876
  const borderWidth = formatOptions.chartArea.chartAreaBorderThickness;
11885
- const borderStyle = formatOptions.chartArea.chartAreaBorderStyle;
11877
+ const borderStyle = formatOptions.chartArea.chartAreaBorderStyle.toString();
11886
11878
  const border = borderStyle === "1" ? "solid" : borderStyle === "2" ? "dashed" : "dotted";
11887
11879
  svg.style("outline", `${borderWidth}px ${border} ${borderColor}`).style("outline-offset", `-${borderWidth}px`);
11888
11880
  } else {
@@ -12268,6 +12260,28 @@ function responsiveYaxisLabel$1(Ymax, Ymin, innerHeight2, formatOptions, chartJS
12268
12260
  );
12269
12261
  let yAxisLabelArray = [];
12270
12262
  let customTickValue;
12263
+ const isTornadoChart = Ymin < 0 && Ymax > 0;
12264
+ if (isTornadoChart) {
12265
+ const maxAbs = Math.max(Math.abs(Ymin), Math.abs(Ymax));
12266
+ const finalMax = customYaxisMaxValue || maxAbs;
12267
+ const finalMin = customYaxisMinValue || -finalMax;
12268
+ if (customYaxisIntervalValue && customYaxisIntervalValue > 0) {
12269
+ for (let v = finalMin; v <= finalMax + 1e-6; v += customYaxisIntervalValue) {
12270
+ yAxisLabelArray.push(parseFloat(v.toFixed(6)));
12271
+ }
12272
+ customTickValue = yAxisLabelArray.length;
12273
+ } else {
12274
+ autoLabelFlag = true;
12275
+ const tickCount = 6;
12276
+ for (let i = -tickCount; i <= tickCount; i++) {
12277
+ yAxisLabelArray.push(
12278
+ parseFloat((i * finalMax / tickCount).toFixed(6))
12279
+ );
12280
+ }
12281
+ customTickValue = barChart ? innerWidth2 / 80 : innerHeight2 / 80;
12282
+ }
12283
+ return { yAxisLabelArray, customTickValue, autoLabelFlag };
12284
+ }
12271
12285
  if (!customYaxisMaxValue && Ymax > 0) {
12272
12286
  const range2 = Ymax - Ymin;
12273
12287
  const padding = range2 * 0.05;
@@ -12479,14 +12493,14 @@ function responsiveXaxisLabel(dimensionList, innerWidth2) {
12479
12493
  }
12480
12494
  function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yScaleLeft, xAxis, dimensionHeightWidthArray, height, barWidth, isDateType, innerWidth2, innerHeight2, filteredDimensionList) {
12481
12495
  try {
12482
- let responsiveDimList = chartJSON.chartType !== actualChartTypes.columnHistogram ? responsiveXaxisLabel(
12496
+ let responsiveDimList = chartJSON.chartType !== chartTypes.ColumnHistogramChart ? responsiveXaxisLabel(
12483
12497
  filteredDimensionList,
12484
12498
  innerWidth2
12485
12499
  ) : [];
12486
12500
  let formatedResponsiveDimList = [];
12487
12501
  let actualDimesionWidth = dimensionHeightWidthArray[0] + 5;
12488
12502
  let maxDimensionWidth = dimensionHeightWidthArray[3] + 10;
12489
- if (chartJSON.chartType != actualChartTypes.waterfall && chartJSON.chartType != actualChartTypes.columnHistogram) {
12503
+ if (chartJSON.chartType != chartTypes.WaterfallChart && chartJSON.chartType != chartTypes.ColumnHistogramChart) {
12490
12504
  formatedResponsiveDimList = isDateType ? setDateFormats(
12491
12505
  formatOptions.xAxisLabel.xAxisNumberFormat,
12492
12506
  responsiveDimList.map((d) => d)
@@ -12545,7 +12559,7 @@ function initXaxis$1(gTag, chartJSON, xLabel, formatOptions, dataTableHeight, yS
12545
12559
  "visibility",
12546
12560
  formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
12547
12561
  );
12548
- if (chartJSON.chartType === actualChartTypes.columnHistogram) {
12562
+ if (chartJSON.chartType === chartTypes.ColumnHistogramChart) {
12549
12563
  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));
12550
12564
  } else {
12551
12565
  xLabelsObj.attr("title", (d, i) => ("" + formatedResponsiveDimList[i]).trim()).html((d, i) => ("" + formatedResponsiveDimList[i]).trim());
@@ -12711,12 +12725,12 @@ function setXaxistitle$1(formatOptions, barChart, svg, margin, xLabel, height, x
12711
12725
  // ? formatOptions?.xAxisLabel?.xAxisPosition == "1"
12712
12726
  // ? 0
12713
12727
  // : xLabel
12714
- // : chartType == actualChartTypes.tornadoChart
12728
+ // : chartType == chartTypes.tornadoChart
12715
12729
  // ? xLabel + 5
12716
12730
  // : yLabel + 5)
12717
12731
  // })`
12718
12732
  `translate(${margin.left},${margin.top + innerHeight2 + (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : barChart ? yLabel : xLabel)})`
12719
- // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == ActualChartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
12733
+ // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == chartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
12720
12734
  ).attr("class", "xAxisTitle").attr("width", innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
12721
12735
  if (formatOptions.xAxisTitle.xAxisDynamicTitleText.length !== 0) {
12722
12736
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.xAxisTitle.xAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
@@ -12807,9 +12821,8 @@ function getCurveType(formatOptions) {
12807
12821
  return stepAfter;
12808
12822
  }
12809
12823
  }
12810
- function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isSensitivityChart, barChart) {
12824
+ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, columnWidth, isReportEditable, isSensitivityChart, barChart) {
12811
12825
  try {
12812
- let fromReportBuilder = false;
12813
12826
  let annotationType = formatOptions.annotation.annotationType ?? "1";
12814
12827
  if (formatOptions.annotation.annotationVisibility) {
12815
12828
  let Disable = [annotationType == "1" ? "connector" : ""];
@@ -12970,12 +12983,12 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
12970
12983
  let singleAnnotation = {
12971
12984
  note: {
12972
12985
  label: d.Measure >= 1e9 && formatOptions.annotation.annotationNumberFormat === ".2s" ? Math.round(d.Measure / 1e9) + "B" : getNumberWithFormat(
12973
- chartType === actualChartTypes.tornadoChart ? Math.abs(d.Measure) : d.Measure,
12986
+ chartType === chartTypes.TornadoChart ? Math.abs(d.Measure) : d.Measure,
12974
12987
  formatOptions.annotation.annotationDisplayUnits || formatOptions.plotArea.plotAreaDisplayUnits,
12975
12988
  formatOptions.annotation.annotationNumberFormat,
12976
12989
  formatOptions.annotation.annotationDecimalPrecision
12977
12990
  ),
12978
- align: barChart && chartType !== actualChartTypes.tornadoChart ? parseInt(d.LabelPosition) === 2 ? "middle" : "start" : chartType === actualChartTypes.tornadoChart ? "end" : "middle"
12991
+ align: barChart && chartType !== chartTypes.TornadoChart ? parseInt(d.LabelPosition) === 2 ? "middle" : "start" : chartType === chartTypes.TornadoChart ? "end" : "middle"
12979
12992
  },
12980
12993
  data: barChart ? {
12981
12994
  y: d.Dimension,
@@ -13036,15 +13049,13 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13036
13049
  }
13037
13050
  finalAnnotationList.push(newAnnotation);
13038
13051
  });
13039
- makeAnnotations.editMode(
13040
- formatOptions.annotation.annotationDraggable && !(fromReportBuilder == void 0 && widgetId != void 0)
13041
- ).accessors({
13052
+ makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13042
13053
  x: function(d) {
13043
13054
  if (barChart) {
13044
13055
  let requiredXScale = d.x.axis === "Primary" ? yScaleLeft : yScaleRight;
13045
13056
  let axis2 = d.x.axis;
13046
13057
  return dataLabelsPositionForBarChartFamily(formatOptions, d.x.measure ? d.x.measure : 0, d.position, requiredXScale, minValue, void 0, chartType, isSensitivityChart, axis2);
13047
- } else if (chartType === actualChartTypes.column) {
13058
+ } else if (chartType === chartTypes.ColumnChart) {
13048
13059
  return xScaleForLegends(d.currentLegend) ? xScale(d.x) + xScaleForLegends(d.currentLegend) - (columnWidth - xScaleForLegends.bandwidth()) / 2 : xScale(d.x);
13049
13060
  } else {
13050
13061
  return xScale(d.x);
@@ -13062,7 +13073,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13062
13073
  );
13063
13074
  } else {
13064
13075
  if (barChart) {
13065
- let actualColWidth = chartType === actualChartTypes.tornadoChart || chartType === actualChartTypes.layeredBarChart ? xScaleForLegends.bandwidth() : -columnWidth;
13076
+ let actualColWidth = chartType === chartTypes.TornadoChart || chartType === chartTypes.LayeredHorizontalBarChart ? xScaleForLegends.bandwidth() : -columnWidth;
13066
13077
  return (xScaleForLegends && xScaleForLegends(d.currentLegend) ? xScaleForLegends(d.currentLegend) + xScaleForLegends.bandwidth() / 2 : 0) + xScale(d.y) - 5;
13067
13078
  } else
13068
13079
  return dataLabelsPosition(
@@ -13108,7 +13119,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13108
13119
  ).filter((d) => d._dx == 0 && d._dy == 0).remove();
13109
13120
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
13110
13121
  }).on("noteclick", function(annotation2) {
13111
- if (formatOptions.annotation.annotationDraggable && !(fromReportBuilder == void 0 && widgetId != void 0)) {
13122
+ if (formatOptions.annotation.annotationDraggable && isReportEditable) {
13112
13123
  annotation2.data.isVisible = false;
13113
13124
  oldAnnotationList.forEach((d) => {
13114
13125
  if (d.data.x == annotation2.data.x && d.data.y.measure == annotation2.data.y.measure) {
@@ -13131,7 +13142,7 @@ function commonAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d
13131
13142
  throw error;
13132
13143
  }
13133
13144
  }
13134
- function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, stackColumnData, stackAreaData, labelExcludeList, individualLabelColor, columnWidth, oldAnnotationList, formatOptions, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends) {
13145
+ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, stackColumnData, stackAreaData, labelExcludeList, individualLabelColor, columnWidth, oldAnnotationList, formatOptions, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, xScaleForLegends, isReportEditable) {
13135
13146
  try {
13136
13147
  let annotationType = formatOptions.annotation.annotationType ?? "1";
13137
13148
  if (formatOptions.annotation.annotationVisibility) {
@@ -13144,7 +13155,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13144
13155
  let stackData = [];
13145
13156
  let getChartType = [];
13146
13157
  let connectorType = formatOptions.annotation.connectorType ? formatOptions.annotation.connectorType.toLowerCase() : "None";
13147
- oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, actualChartTypes.customColumnChart);
13158
+ oldAnnotationList = conditionallyResetOldAnnotations(oldAnnotationList, formatOptions, chartTypes.CustomColumnChart);
13148
13159
  let annotationsList = [];
13149
13160
  let finalAnnotationList = [];
13150
13161
  if (oldAnnotationList.length != 0) {
@@ -13165,15 +13176,15 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13165
13176
  case "2":
13166
13177
  chartData.forEach((d, i) => {
13167
13178
  switch (d.properties.type) {
13168
- case actualChartTypes.column:
13169
- case actualChartTypes.line:
13170
- case actualChartTypes.area:
13179
+ case chartTypes.ColumnChart:
13180
+ case chartTypes.LineChart:
13181
+ case chartTypes.AreaChart:
13171
13182
  labelData.push(d.data[0]);
13172
13183
  break;
13173
- case actualChartTypes.stackColumn:
13184
+ case chartTypes.StackColumnChart:
13174
13185
  stackColumnData.forEach((dta) => labelData.push(dta[0]));
13175
13186
  break;
13176
- case actualChartTypes.stackArea:
13187
+ case chartTypes.StackAreaChart:
13177
13188
  stackAreaData.forEach((dta) => labelData.push(dta[0]));
13178
13189
  break;
13179
13190
  }
@@ -13182,17 +13193,17 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13182
13193
  case "3":
13183
13194
  chartData.forEach((d) => {
13184
13195
  switch (d.properties.type) {
13185
- case actualChartTypes.column:
13186
- case actualChartTypes.line:
13187
- case actualChartTypes.area:
13196
+ case chartTypes.ColumnChart:
13197
+ case chartTypes.LineChart:
13198
+ case chartTypes.AreaChart:
13188
13199
  labelData.push(d.data[d.data.length - 1]);
13189
13200
  break;
13190
- case actualChartTypes.stackColumn:
13201
+ case chartTypes.StackColumnChart:
13191
13202
  stackColumnData.forEach(
13192
13203
  (dta) => labelData.push(dta[dta.length - 1])
13193
13204
  );
13194
13205
  break;
13195
- case actualChartTypes.stackArea:
13206
+ case chartTypes.StackAreaChart:
13196
13207
  stackAreaData.forEach(
13197
13208
  (dta) => labelData.push(dta[dta.length - 1])
13198
13209
  );
@@ -13203,34 +13214,34 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13203
13214
  case "4":
13204
13215
  chartData.forEach((d, i) => {
13205
13216
  switch (d.properties.type) {
13206
- case actualChartTypes.column:
13207
- case actualChartTypes.line:
13208
- case actualChartTypes.area:
13217
+ case chartTypes.ColumnChart:
13218
+ case chartTypes.LineChart:
13219
+ case chartTypes.AreaChart:
13209
13220
  labelData.push(d.data[0]);
13210
13221
  break;
13211
- case actualChartTypes.stackColumn:
13222
+ case chartTypes.StackColumnChart:
13212
13223
  stackColumnData.forEach((dta) => labelData.push(dta[0]));
13213
13224
  break;
13214
- case actualChartTypes.stackArea:
13225
+ case chartTypes.StackAreaChart:
13215
13226
  stackAreaData.forEach((dta) => labelData.push(dta[0]));
13216
13227
  break;
13217
13228
  }
13218
13229
  });
13219
13230
  chartData.forEach((d) => {
13220
13231
  switch (d.properties.type) {
13221
- case actualChartTypes.column:
13222
- case actualChartTypes.line:
13223
- case actualChartTypes.area:
13232
+ case chartTypes.ColumnChart:
13233
+ case chartTypes.LineChart:
13234
+ case chartTypes.AreaChart:
13224
13235
  labelData.push(
13225
13236
  d.data[d.data.length - 1]
13226
13237
  );
13227
13238
  break;
13228
- case actualChartTypes.stackColumn:
13239
+ case chartTypes.StackColumnChart:
13229
13240
  stackColumnData.forEach(
13230
13241
  (dta) => labelData.push(dta[dta.length - 1])
13231
13242
  );
13232
13243
  break;
13233
- case actualChartTypes.stackArea:
13244
+ case chartTypes.StackAreaChart:
13234
13245
  stackAreaData.forEach(
13235
13246
  (dta) => labelData.push(dta[dta.length - 1])
13236
13247
  );
@@ -13241,18 +13252,18 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13241
13252
  case "1":
13242
13253
  chartData.forEach((d) => {
13243
13254
  switch (d.properties.type) {
13244
- case actualChartTypes.column:
13245
- case actualChartTypes.line:
13246
- case actualChartTypes.area:
13255
+ case chartTypes.ColumnChart:
13256
+ case chartTypes.LineChart:
13257
+ case chartTypes.AreaChart:
13247
13258
  d.data.forEach((j) => labelData.push(j));
13248
13259
  break;
13249
- case actualChartTypes.stackColumn:
13260
+ case chartTypes.StackColumnChart:
13250
13261
  let stackColumnIndex = stackColumnData.findIndex((id2) => id2.key === d.properties.legend);
13251
13262
  if (stackColumnIndex !== -1) {
13252
13263
  stackColumnData[stackColumnIndex].forEach((dta) => labelData.push(dta));
13253
13264
  }
13254
13265
  break;
13255
- case actualChartTypes.stackArea:
13266
+ case chartTypes.StackAreaChart:
13256
13267
  let stackAreaIndex = stackAreaData.findIndex((id2) => id2.key === d.properties.legend);
13257
13268
  if (stackAreaIndex !== -1) {
13258
13269
  stackAreaData[stackAreaIndex].forEach((dta) => labelData.push(dta));
@@ -13294,7 +13305,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13294
13305
  },
13295
13306
  data: {
13296
13307
  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 },
13297
- y: d.value || d.value == 0 ? d.value : d.data.type != actualChartTypes.stackColumn ? d[1] ? d[1] : 0 : d[1] > 0 ? d[1] : d[0],
13308
+ 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],
13298
13309
  prevValue: d[0] >= 0 ? d[0] : d[1],
13299
13310
  position: parseInt(d.labelPosition) ? parseInt(d.labelPosition) : parseInt(d.data.labelPosition),
13300
13311
  type: d.dimension && d.legend ? d.type : d.data.type,
@@ -13346,10 +13357,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13346
13357
  }
13347
13358
  finalAnnotationList.push(newAnnotation);
13348
13359
  });
13349
- makeAnnotations.editMode(
13350
- formatOptions.annotation.annotationDraggable
13351
- // && (!(self.attributes.fromReportBuilder == undefined && this.svgIndex != undefined))
13352
- ).accessors({
13360
+ makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
13353
13361
  x: function(d) {
13354
13362
  if (getChartType.includes(d.x.type) || getChartType.includes(d.type)) {
13355
13363
  let chartType = d.x.type || d.type;
@@ -13400,7 +13408,7 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13400
13408
  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();
13401
13409
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
13402
13410
  }).on("noteclick", function(annotation2) {
13403
- if (formatOptions.annotation.annotationDraggable) {
13411
+ if (formatOptions.annotation.annotationDraggable && isReportEditable) {
13404
13412
  annotation2.data.isVisible = false;
13405
13413
  oldAnnotationList.forEach((d) => {
13406
13414
  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) {
@@ -13424,8 +13432,8 @@ function commonAnnotationsForCustomChart(chartData, xScale, yScaleLeft, yScaleRi
13424
13432
  const conditionallyResetOldAnnotations = (oldAnnotationList, formatOptions, chartType) => {
13425
13433
  try {
13426
13434
  let path2 = [
13427
- actualChartTypes.pie,
13428
- actualChartTypes.sunburst
13435
+ chartTypes.PieChart,
13436
+ chartTypes.DonutChart
13429
13437
  ].includes(chartType) ? "plotArea" : "annotation";
13430
13438
  const isDraggable = formatOptions[path2].annotationDraggable;
13431
13439
  const isMeasureReplaced = false;
@@ -13452,28 +13460,28 @@ const annotationTypeforCharts = (d3Annotation2, type) => {
13452
13460
  };
13453
13461
  const dataLabelsPosition = (yCordinate, position, yScale, minValue, prevValue, chartType) => {
13454
13462
  try {
13455
- let allStackCharts = [actualChartTypes.line, actualChartTypes.stackLine, actualChartTypes.stackArea, actualChartTypes.stackArea100, actualChartTypes.stackLine100, actualChartTypes.stackArea];
13463
+ let allStackCharts = [chartTypes.LineChart, chartTypes.StackLineChart, chartTypes.StackAreaChart, chartTypes.NormalizedStackAreaChart, chartTypes.NormalizedStackLineChart, chartTypes.StackAreaChart];
13456
13464
  prevValue ? prevValue : prevValue = 0;
13457
13465
  switch (position) {
13458
13466
  case 1:
13459
13467
  let yOffset;
13460
13468
  switch (chartType) {
13461
- case actualChartTypes.line:
13462
- case actualChartTypes.bar:
13463
- case actualChartTypes.column:
13464
- case actualChartTypes.area:
13465
- case actualChartTypes.stackArea:
13469
+ case chartTypes.LineChart:
13470
+ case chartTypes.HorizontalBarChart:
13471
+ case chartTypes.ColumnChart:
13472
+ case chartTypes.AreaChart:
13473
+ case chartTypes.StackAreaChart:
13466
13474
  yOffset = yCordinate < 0 ? yScale(yCordinate) + 7 : yScale(yCordinate) - 15;
13467
13475
  break;
13468
- case actualChartTypes.stackBar:
13469
- case actualChartTypes.stackLine100:
13470
- case actualChartTypes.stackLine:
13471
- case actualChartTypes.stackArea100:
13472
- case actualChartTypes.stackArea:
13473
- case actualChartTypes.stackColumn:
13476
+ case chartTypes.StackHorizontalBarChart:
13477
+ case chartTypes.NormalizedStackLineChart:
13478
+ case chartTypes.StackLineChart:
13479
+ case chartTypes.NormalizedStackAreaChart:
13480
+ case chartTypes.StackAreaChart:
13481
+ case chartTypes.StackColumnChart:
13474
13482
  yOffset = yCordinate < 0 ? yScale(yCordinate) + 5 : yScale(yCordinate) - 15;
13475
13483
  break;
13476
- case actualChartTypes.tornadoChart:
13484
+ case chartTypes.TornadoChart:
13477
13485
  yOffset = yScale(yCordinate) + yScale.bandwidth() / 2;
13478
13486
  break;
13479
13487
  default:
@@ -13550,19 +13558,19 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
13550
13558
  let legendsParentTag = temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY + yCordinate).attr("width", margin.left).attr("height", cellHeight2);
13551
13559
  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"));
13552
13560
  switch (chartType) {
13553
- case actualChartTypes.column:
13554
- case actualChartTypes.stackColumn:
13555
- case actualChartTypes.stackColumn100:
13561
+ case chartTypes.ColumnChart:
13562
+ case chartTypes.StackColumnChart:
13563
+ case chartTypes.NormalizedStackColumnChart:
13556
13564
  innerdiv.append("xhtml:div").style("height", "10px").style("width", "15px").style("background", data.properties.color).style("border-radius", "1px");
13557
13565
  break;
13558
- case actualChartTypes.line:
13559
- case actualChartTypes.stackLine:
13560
- case actualChartTypes.stackLine100:
13566
+ case chartTypes.LineChart:
13567
+ case chartTypes.StackLineChart:
13568
+ case chartTypes.NormalizedStackLineChart:
13561
13569
  getLineShape(data, innerdiv, formatOptions);
13562
13570
  break;
13563
- case actualChartTypes.area:
13564
- case actualChartTypes.stackArea:
13565
- case actualChartTypes.stackArea100:
13571
+ case chartTypes.AreaChart:
13572
+ case chartTypes.StackAreaChart:
13573
+ case chartTypes.NormalizedStackAreaChart:
13566
13574
  getAreaShape(data, innerdiv, formatOptions);
13567
13575
  break;
13568
13576
  }
@@ -13589,7 +13597,7 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
13589
13597
  let cellHeight = 20;
13590
13598
  let yCordinate = 0;
13591
13599
  let calWidthForSeriesNames = calculatedRange[0] ? calculatedRange[0] : 0;
13592
- let isNormalizedChart = chartType == actualChartTypes.stackColumn100 || chartType == actualChartTypes.stackLine100 || chartType == actualChartTypes.stackArea100;
13600
+ let isNormalizedChart = chartType == chartTypes.NormalizedStackColumnChart || chartType == chartTypes.NormalizedStackLineChart || chartType == chartTypes.NormalizedStackAreaChart;
13593
13601
  let outerPadding = 2;
13594
13602
  let fontStyle = formatOptions.dataTableProperties.dataTableFontStyle;
13595
13603
  let legendStringMaxLength = 0;
@@ -14369,7 +14377,7 @@ function prepareDataForSeriesLabel(innerWidth2, yScaleLeft, formatOptions, filte
14369
14377
  throw error;
14370
14378
  }
14371
14379
  }
14372
- function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, dataTableHeight, barChart) {
14380
+ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin, d3Annotation2, labelExcludeList, individualLabelColor, oldAnnotationList, formatOptions, chartType, height, width, innerWidth2, dimensionList, innerHeight2, widgetId, svg, dataTableHeight, isReportEditable, barChart) {
14373
14381
  try {
14374
14382
  let fromReportBuilder = false;
14375
14383
  let annotationType = formatOptions.annotation.annotationType ?? "1";
@@ -14514,7 +14522,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14514
14522
  }
14515
14523
  finalAnnotationList.push(newAnnotation);
14516
14524
  });
14517
- makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && !(fromReportBuilder == void 0 && widgetId != void 0)).accessors({
14525
+ makeAnnotations.editMode(formatOptions.annotation.annotationDraggable && isReportEditable).accessors({
14518
14526
  x: function(d) {
14519
14527
  if (barChart) {
14520
14528
  return dataLabelsPositionForBarChartFamily(formatOptions, d.x, parseFloat(d.position), yScaleLeft, minValue, d.prevValue, chartType);
@@ -14552,7 +14560,7 @@ function stacklineAnnotations(chartData, xScale, yScaleLeft, yScaleRight, margin
14552
14560
  annotations.selectAll(".note-line").attr("hoverId", (d) => d.data.currentLegend).style("stroke", formatOptions.annotation.connectorColor || "#ccc").filter((d) => d._dx == 0 && d._dy == 0).remove();
14553
14561
  annotations.selectAll(".annotation-note-label").filter((d) => d.data && d.data.isVisible).style("display", "block");
14554
14562
  }).on("noteclick", function(annotation2) {
14555
- if (formatOptions.annotation.annotationDraggable) {
14563
+ if (formatOptions.annotation.annotationDraggable && isReportEditable) {
14556
14564
  annotation2.data.isVisible = false;
14557
14565
  oldAnnotationList.forEach((d) => {
14558
14566
  if (d.data.x == annotation2.data.x && d.data.y == annotation2.data.y) {
@@ -14640,12 +14648,12 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14640
14648
  ).map((d) => d) : responsiveDimList;
14641
14649
  gTag.selectAll("#yAxisRect").remove();
14642
14650
  gTag.selectAll("#yAxisG").remove();
14643
- let yRect = gTag.append("rect").attr("id", "yAxisRect").attr("transform", chartType === actualChartTypes.tornadoChart ? `translate(${-xLabelMargin - 20},0)` : `translate(${xaxisLabelPosition === 0 ? -xLabelMargin - 5 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0) + (-xLabelMargin - 5)},0)`).attr("height", innerHeight2).attr("width", chartType === actualChartTypes.tornadoChart ? xLabelMargin + 20 : xLabelMargin + 5).attr(
14651
+ let yRect = gTag.append("rect").attr("id", "yAxisRect").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${-xLabelMargin - 20},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(
14644
14652
  "fill",
14645
14653
  formatOptions.xAxisLabel.xAxisLabelVisibility ? formatOptions.xAxisLabel.xAxisBackgroundColor ? formatOptions.xAxisLabel.xAxisBackgroundColor !== "#ffffff" ? formatOptions.xAxisLabel.xAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
14646
14654
  );
14647
- const YaxisG = gTag.append("g").attr("id", "yAxisG").attr("transform", chartType === actualChartTypes.tornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`).call(yAxis);
14648
- if (chartType !== actualChartTypes.tornadoChart) {
14655
+ const YaxisG = gTag.append("g").attr("id", "yAxisG").attr("transform", chartType === chartTypes.TornadoChart ? `translate(${xScaleBottom(0)},0)` : `translate(${xaxisLabelPosition === 0 ? 0 : xaxisLabelPosition === 1 ? innerWidth2 : xScaleBottom(0)},0)`).call(yAxis);
14656
+ if (chartType !== chartTypes.TornadoChart) {
14649
14657
  let foreignObject = YaxisG.selectAll("g").append("foreignObject").attr("class", "testingoverflowing").attr("width", xLabelMargin).attr("height", "20px").attr(
14650
14658
  "transform",
14651
14659
  `rotate(${90 - formatOptions.xAxisLabel.xAxisLabelRotation})
@@ -14659,7 +14667,7 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14659
14667
  formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
14660
14668
  ).attr("title", (d, i) => formatedResponsiveDimList[i]).html((d, i) => formatedResponsiveDimList[i]);
14661
14669
  }
14662
- if (chartType === actualChartTypes.tornadoChart) {
14670
+ if (chartType === chartTypes.TornadoChart) {
14663
14671
  YaxisG.selectAll("text").attr("dx", `${-(xScaleBottom(yMaxLeft * 0.01) + 15)}px`).style("fill", formatOptions.xAxisLabel.xAxisLabelColor !== "#ffffff" ? formatOptions.xAxisLabel.xAxisLabelColor : "none").style("font-family", formatOptions.xAxisLabel.xAxisLabelFontFamily).style("color", formatOptions.xAxisLabel.xAxisLabelColor).style("font-size", formatOptions.xAxisLabel.xAxisLabelFontSize + "px").style("font-style", fontStyle.includes("Italic") ? "Italic" : "").style(
14664
14672
  "text-decoration",
14665
14673
  fontStyle.includes("Underline") ? "Underline" : ""
@@ -14667,15 +14675,17 @@ const initYaxisBar = (formatOptions, gTag, xLabel, innerHeight2, innerWidth2, yA
14667
14675
  "visibility",
14668
14676
  formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : "hidden"
14669
14677
  ).attr("title", (d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]).html((d, i) => responsiveXaxisLabel(dimensionList, innerWidth2)[i]);
14670
- const YaxisRightG = gTag.append("g").attr("transform", `translate(${xScaleBottom(0)},0)`).call(xAxisTop);
14671
- YaxisRightG.selectAll("line").style("shape-rendering", "crispEdges").style("stroke", formatOptions.plotArea.gridLinesColor).attr(
14672
- "visibility",
14673
- formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
14674
- );
14675
- YaxisRightG.select(".domain").style("shape-rendering", "crispEdges").style(
14676
- "stroke",
14677
- formatOptions.xAxisLabel.xAxisColor
14678
- ).attr("stroke-width", formatOptions.xAxisLabel.xAxisWidth ? formatOptions.xAxisLabel.xAxisWidth : formatOptions.plotArea.plotAreaBorderThickness);
14678
+ if (xAxisTop) {
14679
+ const YaxisRightG = gTag.append("g").attr("transform", `translate(${xScaleBottom(0)},0)`).call(xAxisTop);
14680
+ YaxisRightG.selectAll("line").style("shape-rendering", "crispEdges").style("stroke", formatOptions.plotArea.gridLinesColor).attr(
14681
+ "visibility",
14682
+ formatOptions.xAxisLabel.xAxisLabelVisibility ? "visible" : formatOptions.plotArea.gridLinesVertical ? "visible" : "hidden"
14683
+ );
14684
+ YaxisRightG.select(".domain").style("shape-rendering", "crispEdges").style("stroke", formatOptions.xAxisLabel.xAxisColor).attr(
14685
+ "stroke-width",
14686
+ formatOptions.xAxisLabel.xAxisWidth ?? formatOptions.plotArea.plotAreaBorderThickness
14687
+ );
14688
+ }
14679
14689
  } else {
14680
14690
  YaxisG.selectAll("text").style(
14681
14691
  "visibility",
@@ -14702,7 +14712,7 @@ const dataLabelsPositionForBarChartFamily = (formatOptions, xCordinate, position
14702
14712
  formatOptions.plotArea.plotAreaDisplayUnits,
14703
14713
  formatOptions.annotation.annotationNumberFormat,
14704
14714
  formatOptions.annotation.annotationDecimalPrecision,
14705
- chartType === actualChartTypes.tornadoChart
14715
+ chartType === chartTypes.TornadoChart
14706
14716
  );
14707
14717
  const formattedLength = String(formattedValue).length;
14708
14718
  const scaledX = xScale(xCordinate);
@@ -14978,33 +14988,33 @@ const chartProperties = {
14978
14988
  };
14979
14989
  const fileName$b = "CommonFunctions.ts";
14980
14990
  [
14981
- actualChartTypes.bar,
14982
- actualChartTypes.stackColumn,
14983
- actualChartTypes.stackColumn100,
14984
- actualChartTypes.line,
14985
- actualChartTypes.stackLine,
14986
- actualChartTypes.stackLine100,
14987
- actualChartTypes.area,
14988
- actualChartTypes.stackArea,
14989
- actualChartTypes.stackArea100
14991
+ chartTypes.ColumnChart,
14992
+ chartTypes.StackColumnChart,
14993
+ chartTypes.NormalizedStackColumnChart,
14994
+ chartTypes.LineChart,
14995
+ chartTypes.StackLineChart,
14996
+ chartTypes.NormalizedStackLineChart,
14997
+ chartTypes.AreaChart,
14998
+ chartTypes.StackAreaChart,
14999
+ chartTypes.NormalizedStackAreaChart
14990
15000
  ];
14991
15001
  [
14992
- actualChartTypes.pie,
14993
- actualChartTypes.pieOfPie,
14994
- actualChartTypes.sunburst,
14995
- actualChartTypes.pyramidChart,
14996
- actualChartTypes.organizationalChart,
14997
- actualChartTypes.vennDiagramChart,
14998
- actualChartTypes.progressChart,
14999
- actualChartTypes.maps,
15000
- actualChartTypes.wordCloud,
15001
- actualChartTypes.sankey,
15002
- actualChartTypes.speedometerChart,
15003
- actualChartTypes.radialBarChart
15002
+ chartTypes.PieChart,
15003
+ chartTypes.PieofPie,
15004
+ chartTypes.DonutChart,
15005
+ chartTypes.PyramidChart,
15006
+ chartTypes.OrganizationChart,
15007
+ chartTypes.VennChart,
15008
+ chartTypes.ProgressChart,
15009
+ chartTypes.Maps,
15010
+ chartTypes.WordCloud,
15011
+ chartTypes.SankeyChart,
15012
+ chartTypes.Speedometer,
15013
+ chartTypes.RadialBarChart
15004
15014
  ];
15005
- function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, inputSeries, chartId, legendShape) {
15015
+ function drawLegends(height, svg, maxLegendDimensions, chartTitleHeight, width, legendMargin, formatOptions, inputSeries, chartId, legendShape, chartType) {
15006
15016
  try {
15007
- let seriesData = [...inputSeries].reverse();
15017
+ let seriesData = chartType !== chartTypes.TornadoChart ? [...inputSeries].reverse() : [...inputSeries];
15008
15018
  let position = formatOptions.legends.legendPosition;
15009
15019
  let horizontalLegendAlignment = formatOptions.legends.legendAlignmentTopBottom;
15010
15020
  let verticalLegendAlignment = formatOptions.legends.legendAlignment;
@@ -15133,12 +15143,12 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15133
15143
  return Symbol$1().type(Markershapes(d.markerShape)).size(d.markerSize * 50)();
15134
15144
  }).attr("visibility", (d) => {
15135
15145
  const hideByX = !xScale(d.dimension) && xScale(d.dimension) !== 0;
15136
- const visible = formatOptions.marker.markerVisibility ? checkVisibleConditions(chartData, d, type, hideZeroValues, secondaryCustomYaxisMaxValue, secondaryCustomYaxisMinValue, customYaxisMinValue, customYaxisMaxValue) ? "hidden" : [actualChartTypes.stackLine100, "CombiLine"].includes(type) ? "visible" : [actualChartTypes.stackArea, actualChartTypes.area, "CombiArea", "CombiStackArea"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "visible" : type === "CombiLine" ? "visible" : ["Area", "CombiArea"].includes(type) ? formatOptions.plotArea.plotAreaHideLineAndMarkers ? "visible" : "hidden" : "hidden";
15146
+ 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";
15137
15147
  return hideByX ? "hidden" : visible;
15138
15148
  }).attr("transform", (d) => {
15139
15149
  let requiredYScale = d.axis == "Primary" ? yScale : yScaleRight;
15140
15150
  const x2 = xScale(d.dimension);
15141
- const y2 = [actualChartTypes.stackArea100, actualChartTypes.stackArea, actualChartTypes.stackLine, actualChartTypes.stackLine100, "CombiStackArea"].includes(type) ? d[1] > 0 ? requiredYScale(d[1]) : requiredYScale(d[0]) : requiredYScale(d.value);
15151
+ 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);
15142
15152
  return `translate(${x2},${y2})`;
15143
15153
  }).on("mousemove", function(event2, d) {
15144
15154
  const dataPoint = d;
@@ -15155,7 +15165,7 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15155
15165
  {
15156
15166
  key: formatOptions.yAxisTitle.yAxisTitleText || dataPoint.value,
15157
15167
  value: getNumberWithFormat(
15158
- [actualChartTypes.stackLine100, actualChartTypes.stackArea100, ""].includes(type) ? dataPoint[1] - dataPoint[0] : dataPoint.value,
15168
+ [chartTypes.NormalizedStackLineChart, chartTypes.NormalizedStackAreaChart, ""].includes(type) ? dataPoint[1] - dataPoint[0] : dataPoint.value,
15159
15169
  formatOptions.toolTip.toolTipDisplayUnits,
15160
15170
  formatOptions.toolTip.toolTipNumberFormat,
15161
15171
  formatOptions.toolTip.toolTipDecimalPrecision
@@ -15177,12 +15187,12 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15177
15187
  parentG.selectAll(".halo").remove();
15178
15188
  parentG.insert("circle", ":first-child").attr("class", "halo").attr("cx", xScale(dataPoint.dimension)).attr("cy", () => {
15179
15189
  const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15180
- return [actualChartTypes.stackArea100, actualChartTypes.stackArea, actualChartTypes.stackLine, actualChartTypes.stackLine100, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15190
+ return [chartTypes.NormalizedStackAreaChart, chartTypes.StackAreaChart, chartTypes.StackLineChart, chartTypes.NormalizedStackLineChart, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15181
15191
  }).attr("fill", legendEntry.markerColor).attr("opacity", 0.5).attr("r", legendEntry.markerSize * 10);
15182
15192
  select$2(this).transition().duration(100).attr("transform", () => {
15183
15193
  const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15184
15194
  const x2 = xScale(dataPoint.dimension);
15185
- const y2 = [actualChartTypes.stackArea100, actualChartTypes.stackArea, actualChartTypes.stackLine, actualChartTypes.stackLine100, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15195
+ 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);
15186
15196
  return `translate(${x2},${y2}) scale(1.3)`;
15187
15197
  });
15188
15198
  }).on("mouseout", function(event2, d) {
@@ -15193,7 +15203,7 @@ function lineMarkers(lines, chartData, type, xScale, yScale, yScaleRight, toolti
15193
15203
  select$2(this).transition().duration(100).attr("transform", () => {
15194
15204
  const requiredYScale = dataPoint.axis === "Primary" ? yScale : yScaleRight;
15195
15205
  const x2 = xScale(dataPoint.dimension);
15196
- const y2 = [actualChartTypes.stackArea100, actualChartTypes.stackArea, actualChartTypes.stackLine, actualChartTypes.stackLine100, "CombiStackArea"].includes(type) ? dataPoint[1] > 0 ? requiredYScale(dataPoint[1]) : requiredYScale(dataPoint[0]) : requiredYScale(dataPoint.value);
15206
+ 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);
15197
15207
  return `translate(${x2},${y2}) scale(1)`;
15198
15208
  });
15199
15209
  });
@@ -15237,7 +15247,7 @@ function onHoverMarkerForAreaChartFamily(formatOptions, areas, focus, filteredDi
15237
15247
  { key: formatOptions.xAxisTitle.xAxisTitleText, value: lineData[legendIndex].data[dimensionIndex].dimension },
15238
15248
  {
15239
15249
  key: lineData[legendIndex].properties.currentMeasure ? lineData[legendIndex].properties.currentMeasure : this.basestyle.YAxisTitle.YAxisTitleText,
15240
- value: getNumberWithFormat(chartType === actualChartTypes.stackArea100 ? legendIndex === 0 ? lineData[legendIndex].data[dimensionIndex].value : lineData[legendIndex].data[dimensionIndex].value - lineData[legendIndex - 1].data[dimensionIndex].value : lineData[legendIndex].data[dimensionIndex].value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision)
15250
+ value: getNumberWithFormat(chartType === chartTypes.NormalizedStackAreaChart ? legendIndex === 0 ? lineData[legendIndex].data[dimensionIndex].value : lineData[legendIndex].data[dimensionIndex].value - lineData[legendIndex - 1].data[dimensionIndex].value : lineData[legendIndex].data[dimensionIndex].value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision)
15241
15251
  },
15242
15252
  { key: "Legend", value: lineData[legendIndex].data[dimensionIndex].legend.includes("~$~") ? lineData[legendIndex].data[dimensionIndex].legend.split("~$~")[1] : lineData[legendIndex].data[dimensionIndex].legend }
15243
15253
  // { key: "Calculated Tooltip", value: lineData[legendIndex].data[dimensionIndex]. },
@@ -15603,11 +15613,11 @@ const legendsWithScroll = (svg, seriesData, x2, y2, width, height, legendPositio
15603
15613
  let customLegendShape;
15604
15614
  if (!legendShape) {
15605
15615
  let legendType = d.properties.type;
15606
- if (legendType == actualChartTypes.column || legendType == actualChartTypes.stackColumn) {
15616
+ if (legendType == chartTypes.ColumnChart || legendType == chartTypes.StackColumnChart) {
15607
15617
  customLegendShape = staticLegendShape.rectangle;
15608
- } else if (legendType == actualChartTypes.line || legendType == actualChartTypes.stackLine) {
15618
+ } else if (legendType == chartTypes.LineChart || legendType == chartTypes.StackLineChart) {
15609
15619
  customLegendShape = staticLegendShape.line;
15610
- } else if (legendType == actualChartTypes.area || legendType == actualChartTypes.stackArea) {
15620
+ } else if (legendType == chartTypes.AreaChart || legendType == chartTypes.StackAreaChart) {
15611
15621
  customLegendShape = staticLegendShape.areaWithLine;
15612
15622
  }
15613
15623
  }
@@ -16006,7 +16016,7 @@ function generalizedChartData(chartData, dimensionList) {
16006
16016
  return {
16007
16017
  ...item,
16008
16018
  properties,
16009
- data: normalizedData
16019
+ data: item.data
16010
16020
  };
16011
16021
  });
16012
16022
  } catch (error) {
@@ -16126,12 +16136,13 @@ const getHoverId = (inputText) => {
16126
16136
  const ColumnChart = ({
16127
16137
  isDateType,
16128
16138
  formatOptions,
16129
- data
16139
+ data,
16140
+ isReportEditable
16130
16141
  }) => {
16131
16142
  const chartId = crypto.randomUUID();
16132
16143
  let columnWidth = 0;
16133
16144
  let scrollbarVisible = false;
16134
- const chartType = actualChartTypes.column;
16145
+ const chartType = chartTypes.ColumnChart;
16135
16146
  const svgRef = useRef();
16136
16147
  const seriesData = generalizedChartData(
16137
16148
  data.ChartData,
@@ -16565,8 +16576,8 @@ const ColumnChart = ({
16565
16576
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
16566
16577
  value: getNumberWithFormat(
16567
16578
  [
16568
- actualChartTypes.stackLine100,
16569
- actualChartTypes.stackArea100,
16579
+ chartTypes.NormalizedStackLineChart,
16580
+ chartTypes.NormalizedStackAreaChart,
16570
16581
  ""
16571
16582
  ].includes(chartType) ? d[1] - d[0] : d.value,
16572
16583
  formatOptions.toolTip.toolTipDisplayUnits,
@@ -16649,7 +16660,8 @@ const ColumnChart = ({
16649
16660
  chartId,
16650
16661
  svg,
16651
16662
  xScaleForLegends,
16652
- columnWidth
16663
+ columnWidth,
16664
+ isReportEditable
16653
16665
  );
16654
16666
  addDataTable(
16655
16667
  formatOptions.plotArea.fitChart,
@@ -16690,13 +16702,14 @@ const ColumnChart = ({
16690
16702
  const CustomColumnChart = ({
16691
16703
  isDateType,
16692
16704
  formatOptions,
16693
- data
16705
+ data,
16706
+ isReportEditable
16694
16707
  }) => {
16695
16708
  const chartId = crypto.randomUUID();
16696
16709
  let columnWidth = 0;
16697
16710
  let scrollbarVisible = false;
16698
16711
  let stackChartData = [];
16699
- const chartType = actualChartTypes.customColumnChart;
16712
+ const chartType = chartTypes.CustomColumnChart;
16700
16713
  const svgRef = useRef();
16701
16714
  const seriesData = generalizedChartData(
16702
16715
  data.ChartData,
@@ -16738,6 +16751,7 @@ const CustomColumnChart = ({
16738
16751
  let yScaleRight;
16739
16752
  let xScale;
16740
16753
  let xScaleForLegends;
16754
+ let calculatedRange;
16741
16755
  let stackAreaChartDataForPrimaryAxis = [];
16742
16756
  let stackAreaChartDataForSecondaryAxis = [];
16743
16757
  let stackColumnChartDataForPrimaryAxis = [];
@@ -16803,7 +16817,10 @@ const CustomColumnChart = ({
16803
16817
  chartTitleHeight,
16804
16818
  secondaryAxisTitleWidth,
16805
16819
  legendMargin,
16806
- secondaryYLabel
16820
+ secondaryYLabel,
16821
+ visibleBars,
16822
+ columnWidth,
16823
+ scrollbarVisible
16807
16824
  } = marginCalculation(
16808
16825
  // for all margin related calculations
16809
16826
  width,
@@ -16939,27 +16956,27 @@ const CustomColumnChart = ({
16939
16956
  let yMinRight = Infinity;
16940
16957
  let tempChartData = [];
16941
16958
  seriesData.forEach((series, i) => {
16942
- if (![actualChartTypes.stackColumn, actualChartTypes.stackArea].includes(series.properties.type)) {
16959
+ if (![chartTypes.StackColumnChart, chartTypes.StackAreaChart].includes(series.properties.type)) {
16943
16960
  tempChartData.push(series);
16944
- series.properties.type !== actualChartTypes.line && legendList.push(series.legend);
16961
+ series.properties.type !== chartTypes.LineChart && legendList.push(series.legend);
16945
16962
  } else if (!legendList.includes("stackLegend")) {
16946
16963
  legendList.push(`stackLegend`);
16947
16964
  }
16948
16965
  if (series.properties.axis === "Secondary") {
16949
16966
  secondaryStackAxisData.push(series);
16950
- if (series.properties.type == actualChartTypes.stackColumn) {
16967
+ if (series.properties.type == chartTypes.StackColumnChart) {
16951
16968
  secondaryStackColumnAxisData.push(series);
16952
16969
  }
16953
- if (series.properties.type == actualChartTypes.stackArea) {
16970
+ if (series.properties.type == chartTypes.StackAreaChart) {
16954
16971
  secondaryStackAreaAxisData.push(series);
16955
16972
  }
16956
16973
  }
16957
16974
  if (series.properties.axis === "Primary") {
16958
16975
  primaryStackAxisData.push(series);
16959
- if (series.properties.type == actualChartTypes.stackColumn) {
16976
+ if (series.properties.type == chartTypes.StackColumnChart) {
16960
16977
  primaryStackColumnAxisData.push(series);
16961
16978
  }
16962
- if (series.properties.type == actualChartTypes.stackArea) {
16979
+ if (series.properties.type == chartTypes.StackAreaChart) {
16963
16980
  primaryStackAreaAxisData.push(series);
16964
16981
  }
16965
16982
  }
@@ -17171,6 +17188,13 @@ const CustomColumnChart = ({
17171
17188
  0
17172
17189
  ]);
17173
17190
  }
17191
+ calculatedRange = [0, innerWidth2];
17192
+ };
17193
+ const getXScale = () => {
17194
+ xScaleForLegends = band().domain(chartJSON.legendList).range([0, columnWidth]).paddingInner(
17195
+ chartJSON.legendList.length > 1 ? 0.3 * parseFloat(formatOptions.plotArea.plotAreaSeriesWidth) / 100 : 0
17196
+ );
17197
+ xScale = point$7().domain(filteredDimension).range(calculatedRange).padding(0.5);
17174
17198
  };
17175
17199
  const initAxis = () => {
17176
17200
  {
@@ -17223,23 +17247,28 @@ const CustomColumnChart = ({
17223
17247
  ).tickPadding(8).tickSizeOuter(0);
17224
17248
  }
17225
17249
  };
17250
+ const getXAxis = () => {
17251
+ xAxis = axisBottom(xScale).tickSize(
17252
+ formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesVertical ? formatOptions.plotArea.gridLinesVertical ? -(dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) : parseFloat(formatOptions.plotArea.ticksHeight) * ((dataTableHeight > 0 ? innerHeight2 - dataTableHeight : innerHeight2) / 100) * (formatOptions.xAxisLabel.xAxisPosition == "1" ? 1 : -1) : 0 : 0
17253
+ ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(filteredDimension, innerWidth2));
17254
+ };
17226
17255
  const getChartType = (lineData) => {
17227
17256
  lineData.forEach((data2) => {
17228
17257
  switch (data2.properties.type) {
17229
- case actualChartTypes.column:
17258
+ case chartTypes.ColumnChart:
17230
17259
  drawColumnChart(data2);
17231
17260
  break;
17232
- case actualChartTypes.line:
17261
+ case chartTypes.LineChart:
17233
17262
  drawLineChart([data2]);
17234
17263
  break;
17235
- case actualChartTypes.area:
17264
+ case chartTypes.AreaChart:
17236
17265
  drawAreaChart([data2]);
17237
17266
  break;
17238
- case actualChartTypes.stackColumn:
17267
+ case chartTypes.StackColumnChart:
17239
17268
  stackColumnData = createStackData(data2);
17240
17269
  drawStackColumnChart();
17241
17270
  break;
17242
- case actualChartTypes.stackArea:
17271
+ case chartTypes.StackAreaChart:
17243
17272
  stackAreaData = createStackData(data2);
17244
17273
  drawStackAreaChart(data2);
17245
17274
  break;
@@ -17288,8 +17317,8 @@ const CustomColumnChart = ({
17288
17317
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
17289
17318
  value: getNumberWithFormat(
17290
17319
  [
17291
- actualChartTypes.stackLine100,
17292
- actualChartTypes.stackArea100,
17320
+ chartTypes.NormalizedStackLineChart,
17321
+ chartTypes.NormalizedStackAreaChart,
17293
17322
  ""
17294
17323
  ].includes(chartType) ? d[1] - d[0] : d.value,
17295
17324
  formatOptions.toolTip.toolTipDisplayUnits,
@@ -17544,7 +17573,7 @@ const CustomColumnChart = ({
17544
17573
  );
17545
17574
  filteredData = JSON.parse(JSON.stringify(requiredData));
17546
17575
  filteredData.forEach((data2, i) => {
17547
- if (data2.properties.type === actualChartTypes.stackColumn || data2.properties.type === actualChartTypes.stackArea) {
17576
+ if (data2.properties.type === chartTypes.StackColumnChart || data2.properties.type === chartTypes.StackAreaChart) {
17548
17577
  data2.data.forEach(
17549
17578
  (stackData, pos) => filteredData[i].data[pos]["data"] = stackData.data.filter(
17550
17579
  (d) => filteredDimension.includes(d.dimension)
@@ -17559,6 +17588,8 @@ const CustomColumnChart = ({
17559
17588
  drawCustomChart();
17560
17589
  };
17561
17590
  const drawCustomChart = () => {
17591
+ getXScale();
17592
+ getXAxis();
17562
17593
  getChartType(filteredData);
17563
17594
  initXaxis$1(
17564
17595
  gTag,
@@ -17601,7 +17632,8 @@ const CustomColumnChart = ({
17601
17632
  innerHeight2,
17602
17633
  chartId,
17603
17634
  svg,
17604
- xScaleForLegends
17635
+ xScaleForLegends,
17636
+ isReportEditable
17605
17637
  );
17606
17638
  };
17607
17639
  const createStackData = (requiredStackChatData) => {
@@ -17660,11 +17692,12 @@ const CustomColumnChart = ({
17660
17692
  const LayeredColumnChart = ({
17661
17693
  isDateType,
17662
17694
  formatOptions,
17663
- data
17695
+ data,
17696
+ isReportEditable
17664
17697
  }) => {
17665
17698
  const chartId = crypto.randomUUID();
17666
17699
  let columnWidth = 0;
17667
- const chartType = actualChartTypes.layeredColumnChart;
17700
+ const chartType = chartTypes.LayeredColumnChart;
17668
17701
  const svgRef = useRef();
17669
17702
  const seriesData = generalizedChartData(
17670
17703
  data.ChartData,
@@ -18043,8 +18076,8 @@ const LayeredColumnChart = ({
18043
18076
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
18044
18077
  value: getNumberWithFormat(
18045
18078
  [
18046
- actualChartTypes.stackLine100,
18047
- actualChartTypes.stackArea100,
18079
+ chartTypes.NormalizedStackLineChart,
18080
+ chartTypes.NormalizedStackAreaChart,
18048
18081
  ""
18049
18082
  ].includes(chartType) ? d[1] - d[0] : d.value,
18050
18083
  formatOptions.toolTip.toolTipDisplayUnits,
@@ -18121,7 +18154,8 @@ const LayeredColumnChart = ({
18121
18154
  chartId,
18122
18155
  svg,
18123
18156
  void 0,
18124
- columnWidth
18157
+ columnWidth,
18158
+ isReportEditable
18125
18159
  );
18126
18160
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
18127
18161
  if (formatOptions.xAxisLabel.xAxisPosition != "1")
@@ -18138,7 +18172,7 @@ const LayeredColumnChart = ({
18138
18172
  void 0,
18139
18173
  void 0,
18140
18174
  dataTableHeight,
18141
- actualChartTypes.column,
18175
+ chartTypes.ColumnChart,
18142
18176
  formatOptions,
18143
18177
  yLabel,
18144
18178
  yTitle,
@@ -18171,12 +18205,13 @@ const LayeredColumnChart = ({
18171
18205
  const StackColumnChart = ({
18172
18206
  isDateType,
18173
18207
  formatOptions,
18174
- data
18208
+ data,
18209
+ isReportEditable
18175
18210
  }) => {
18176
18211
  const chartId = crypto.randomUUID();
18177
18212
  let columnWidth = 0;
18178
18213
  let scrollbarVisible = false;
18179
- const chartType = actualChartTypes.stackColumn;
18214
+ const chartType = chartTypes.StackColumnChart;
18180
18215
  const svgRef = useRef();
18181
18216
  const seriesData = generalizedChartData(
18182
18217
  data.ChartData,
@@ -18623,7 +18658,9 @@ const StackColumnChart = ({
18623
18658
  filteredDimension,
18624
18659
  innerHeight2,
18625
18660
  chartId,
18626
- svg
18661
+ svg,
18662
+ dataTableHeight,
18663
+ isReportEditable
18627
18664
  );
18628
18665
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
18629
18666
  if (formatOptions.xAxisLabel.xAxisPosition != "1") {
@@ -18892,11 +18929,12 @@ const StackColumnChart = ({
18892
18929
  const NormalizedStackColumnChart = ({
18893
18930
  isDateType,
18894
18931
  formatOptions,
18895
- data
18932
+ data,
18933
+ isReportEditable
18896
18934
  }) => {
18897
18935
  const chartId = crypto.randomUUID();
18898
18936
  let columnWidth = 0;
18899
- const chartType = actualChartTypes.stackColumn100;
18937
+ const chartType = chartTypes.NormalizedStackColumnChart;
18900
18938
  const svgRef = useRef();
18901
18939
  const seriesData = generalizedChartData(
18902
18940
  data.ChartData,
@@ -19347,7 +19385,9 @@ const NormalizedStackColumnChart = ({
19347
19385
  filteredDimension,
19348
19386
  innerHeight2,
19349
19387
  chartId,
19350
- svg
19388
+ svg,
19389
+ dataTableHeight,
19390
+ isReportEditable
19351
19391
  );
19352
19392
  if (formatOptions.dataTableProperties && formatOptions.dataTableProperties.dataTable) {
19353
19393
  if (formatOptions.xAxisLabel.xAxisPosition != "1") {
@@ -19671,7 +19711,7 @@ function setXaxistitle(formatOptions, barChart, svg, margin, xLabel, height, xTi
19671
19711
  ).attr(
19672
19712
  "transform",
19673
19713
  !formatOptions.plotArea.fitChart && chartsWithXScrollFlag ? `translate(${margin.left},${margin.top + innerHeight2 + (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : xLabel)})` : !formatOptions.plotArea.fitChart && chartsWithYScrollFlag ? `translate(${margin.left},${height - xTitle - 5})` : `translate(${margin.left},${margin.top + innerHeight2 + (chartsWithXScrollFlag ? formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : xLabel : chartType == "tornado" ? xLabel + 5 : yLabel + 5)})`
19674
- // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == ActualChartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
19714
+ // `translate(${margin.left},${Margin.top + innerHeight + (chartsWithXScrollFlag ? (formatOptions?.xAxisLabel?.xAxisPosition == "1" ? 0 : Xlabel) : (attributes.type == chartTypes.TornadoChart) ? Xlabel + 5 : yLabel + 5) })`
19675
19715
  ).attr("class", "xAxisTitle").attr("width", innerWidth2).attr("height", xTitle + "px").style("z-index", "9999");
19676
19716
  if (formatOptions.xAxisTitle.xAxisDynamicTitleText.length !== 0) {
19677
19717
  object2.append("xhtml:div").style("color", "rgba(119,119,119)").attr("title", formatOptions.xAxisTitle.xAxisTitleText).style("white-space", "pre").style("text-overflow", "ellipsis").html(
@@ -19928,7 +19968,7 @@ const ColumnHistogramChart = ({
19928
19968
  }) => {
19929
19969
  const chartId = crypto.randomUUID();
19930
19970
  const columnWidth = 0;
19931
- const chartType = actualChartTypes.columnHistogram;
19971
+ const chartType = chartTypes.ColumnHistogramChart;
19932
19972
  const svgRef = useRef();
19933
19973
  const seriesData = data.ChartData;
19934
19974
  const dimensionList = data.DimensionList;
@@ -20412,11 +20452,12 @@ const ColumnHistogramChart = ({
20412
20452
  const LineChart = ({
20413
20453
  isDateType,
20414
20454
  formatOptions,
20415
- data
20455
+ data,
20456
+ isReportEditable
20416
20457
  }) => {
20417
20458
  const chartId = crypto.randomUUID();
20418
20459
  const barWidth = 0;
20419
- const chartType = actualChartTypes.line;
20460
+ const chartType = chartTypes.LineChart;
20420
20461
  const svgRef = useRef();
20421
20462
  const seriesData = generalizedChartData(
20422
20463
  data.ChartData,
@@ -20907,7 +20948,8 @@ const LineChart = ({
20907
20948
  filteredDimension,
20908
20949
  innerHeight2,
20909
20950
  chartId,
20910
- svg
20951
+ svg,
20952
+ isReportEditable
20911
20953
  );
20912
20954
  let newSeriesLabelArray = prepareDataForSeriesLabel(
20913
20955
  innerWidth2,
@@ -20960,11 +21002,12 @@ const LineChart = ({
20960
21002
  const StackLineChart = ({
20961
21003
  isDateType,
20962
21004
  formatOptions,
20963
- data
21005
+ data,
21006
+ isReportEditable
20964
21007
  }) => {
20965
21008
  const chartId = crypto.randomUUID();
20966
21009
  const barWidth = 0;
20967
- const chartType = actualChartTypes.stackLine;
21010
+ const chartType = chartTypes.StackLineChart;
20968
21011
  const svgRef = useRef();
20969
21012
  const seriesData = generalizedChartData(
20970
21013
  data.ChartData,
@@ -21408,7 +21451,9 @@ const StackLineChart = ({
21408
21451
  filteredDimension,
21409
21452
  innerHeight2,
21410
21453
  chartId,
21411
- svg
21454
+ svg,
21455
+ dataTableHeight,
21456
+ isReportEditable
21412
21457
  );
21413
21458
  let newSeriesLabelArray = prepareDataForSeriesLabel(
21414
21459
  innerWidth2,
@@ -21495,11 +21540,12 @@ const StackLineChart = ({
21495
21540
  const NormalisedStackLineChart = ({
21496
21541
  isDateType,
21497
21542
  formatOptions,
21498
- data
21543
+ data,
21544
+ isReportEditable
21499
21545
  }) => {
21500
21546
  const chartId = crypto.randomUUID();
21501
21547
  const barWidth = 0;
21502
- const chartType = actualChartTypes.stackLine100;
21548
+ const chartType = chartTypes.NormalizedStackLineChart;
21503
21549
  const svgRef = useRef();
21504
21550
  const seriesData = generalizedChartData(
21505
21551
  data.ChartData,
@@ -21905,7 +21951,9 @@ const NormalisedStackLineChart = ({
21905
21951
  filteredDimension,
21906
21952
  innerHeight2,
21907
21953
  chartId,
21908
- svg
21954
+ svg,
21955
+ dataTableHeight,
21956
+ isReportEditable
21909
21957
  );
21910
21958
  let newSeriesLabelArray = prepareDataForSeriesLabel(
21911
21959
  innerWidth2,
@@ -21985,11 +22033,12 @@ const NormalisedStackLineChart = ({
21985
22033
  const HorizontalBarChart = ({
21986
22034
  isDateType,
21987
22035
  formatOptions,
21988
- data
22036
+ data,
22037
+ isReportEditable
21989
22038
  }) => {
21990
22039
  const chartId = crypto.randomUUID();
21991
22040
  let columnWidth = 0;
21992
- const chartType = actualChartTypes.horizontalBar;
22041
+ const chartType = chartTypes.HorizontalBarChart;
21993
22042
  const svgRef = useRef();
21994
22043
  const seriesData = generalizedChartData(
21995
22044
  data.ChartData,
@@ -22382,7 +22431,7 @@ const HorizontalBarChart = ({
22382
22431
  {
22383
22432
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
22384
22433
  value: getNumberWithFormat(
22385
- [actualChartTypes.stackLine100, actualChartTypes.stackArea100, ""].includes(chartType) ? d[1] - d[0] : d.value,
22434
+ [chartTypes.NormalizedStackLineChart, chartTypes.NormalizedStackAreaChart, ""].includes(chartType) ? d[1] - d[0] : d.value,
22386
22435
  formatOptions.toolTip.toolTipDisplayUnits,
22387
22436
  formatOptions.toolTip.toolTipNumberFormat,
22388
22437
  formatOptions.toolTip.toolTipDecimalPrecision
@@ -22465,6 +22514,7 @@ const HorizontalBarChart = ({
22465
22514
  yScaleLegends,
22466
22515
  columnWidth,
22467
22516
  false,
22517
+ isReportEditable,
22468
22518
  barChart
22469
22519
  );
22470
22520
  };
@@ -22481,11 +22531,12 @@ const HorizontalBarChart = ({
22481
22531
  const StackHorizontalChart = ({
22482
22532
  isDateType,
22483
22533
  formatOptions,
22484
- data
22534
+ data,
22535
+ isReportEditable
22485
22536
  }) => {
22486
22537
  const chartId = crypto.randomUUID();
22487
22538
  let columnWidth = 0;
22488
- const chartType = actualChartTypes.stackBar;
22539
+ const chartType = chartTypes.StackHorizontalBarChart;
22489
22540
  const svgRef = useRef();
22490
22541
  const seriesData = generalizedChartData(
22491
22542
  data.ChartData,
@@ -22919,6 +22970,7 @@ const StackHorizontalChart = ({
22919
22970
  chartId,
22920
22971
  svg,
22921
22972
  0,
22973
+ isReportEditable,
22922
22974
  barChart
22923
22975
  );
22924
22976
  getConnectors();
@@ -23171,11 +23223,12 @@ const StackHorizontalChart = ({
23171
23223
  const NormalizedStackHorizontalBarChart = ({
23172
23224
  isDateType,
23173
23225
  formatOptions,
23174
- data
23226
+ data,
23227
+ isReportEditable
23175
23228
  }) => {
23176
23229
  const chartId = crypto.randomUUID();
23177
23230
  let columnWidth = 0;
23178
- const chartType = actualChartTypes.stackBar100;
23231
+ const chartType = chartTypes.NormalizedStackHorizontalBarChart;
23179
23232
  const svgRef = useRef();
23180
23233
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList)?.reverse();
23181
23234
  const dimensionList = data.DimensionList;
@@ -23581,6 +23634,7 @@ const NormalizedStackHorizontalBarChart = ({
23581
23634
  chartId,
23582
23635
  svg,
23583
23636
  0,
23637
+ isReportEditable,
23584
23638
  barChart
23585
23639
  );
23586
23640
  };
@@ -23631,11 +23685,12 @@ const NormalizedStackHorizontalBarChart = ({
23631
23685
  const LayeredHorizontalBarChart = ({
23632
23686
  isDateType,
23633
23687
  formatOptions,
23634
- data
23688
+ data,
23689
+ isReportEditable
23635
23690
  }) => {
23636
23691
  const chartId = crypto.randomUUID();
23637
23692
  let columnWidth = 0;
23638
- const chartType = actualChartTypes.layeredBarChart;
23693
+ const chartType = chartTypes.LayeredHorizontalBarChart;
23639
23694
  const svgRef = useRef();
23640
23695
  const seriesData = generalizedChartData(
23641
23696
  data.ChartData,
@@ -23982,8 +24037,8 @@ const LayeredHorizontalBarChart = ({
23982
24037
  key: formatOptions.yAxisTitle.yAxisTitleText || d.value,
23983
24038
  value: getNumberWithFormat(
23984
24039
  [
23985
- actualChartTypes.stackLine100,
23986
- actualChartTypes.stackArea100,
24040
+ chartTypes.NormalizedStackLineChart,
24041
+ chartTypes.NormalizedStackAreaChart,
23987
24042
  ""
23988
24043
  ].includes(chartType) ? d[1] - d[0] : d.value,
23989
24044
  formatOptions.toolTip.toolTipDisplayUnits,
@@ -24071,6 +24126,7 @@ const LayeredHorizontalBarChart = ({
24071
24126
  yScale,
24072
24127
  columnWidth,
24073
24128
  false,
24129
+ isReportEditable,
24074
24130
  barChart
24075
24131
  );
24076
24132
  getConnectors();
@@ -24312,7 +24368,7 @@ const HorizontalHistogramChart = ({
24312
24368
  }) => {
24313
24369
  const chartId = crypto.randomUUID();
24314
24370
  const columnWidth = 0;
24315
- const chartType = actualChartTypes.columnHistogram;
24371
+ const chartType = chartTypes.ColumnHistogramChart;
24316
24372
  const svgRef = useRef();
24317
24373
  const seriesData = data.ChartData;
24318
24374
  const dimensionList = data.DimensionList;
@@ -24779,11 +24835,12 @@ const HorizontalHistogramChart = ({
24779
24835
  const AreaChart = ({
24780
24836
  isDateType,
24781
24837
  formatOptions,
24782
- data
24838
+ data,
24839
+ isReportEditable
24783
24840
  }) => {
24784
24841
  const chartId = crypto.randomUUID();
24785
24842
  const barWidth = 0;
24786
- const chartType = actualChartTypes.area;
24843
+ const chartType = chartTypes.AreaChart;
24787
24844
  const svgRef = useRef();
24788
24845
  const seriesData = generalizedChartData(
24789
24846
  data.ChartData,
@@ -25248,7 +25305,8 @@ const AreaChart = ({
25248
25305
  filteredDimension,
25249
25306
  innerHeight2,
25250
25307
  chartId,
25251
- svg
25308
+ svg,
25309
+ isReportEditable
25252
25310
  );
25253
25311
  let newSeriesLabelArray = prepareDataForSeriesLabel(
25254
25312
  innerWidth2,
@@ -25302,11 +25360,12 @@ const AreaChart = ({
25302
25360
  const StackAreaChart = ({
25303
25361
  isDateType,
25304
25362
  formatOptions,
25305
- data
25363
+ data,
25364
+ isReportEditable
25306
25365
  }) => {
25307
25366
  const chartId = crypto.randomUUID();
25308
25367
  const barWidth = 0;
25309
- const chartType = actualChartTypes.stackArea;
25368
+ const chartType = chartTypes.StackAreaChart;
25310
25369
  const svgRef = useRef();
25311
25370
  const seriesData = generalizedChartData(
25312
25371
  data.ChartData,
@@ -25787,7 +25846,9 @@ const StackAreaChart = ({
25787
25846
  filteredDimension,
25788
25847
  innerHeight2,
25789
25848
  chartId,
25790
- svg
25849
+ svg,
25850
+ dataTableHeight,
25851
+ isReportEditable
25791
25852
  );
25792
25853
  let newSeriesLabelArray = prepareDataForSeriesLabel(
25793
25854
  innerWidth2,
@@ -25867,11 +25928,12 @@ const StackAreaChart = ({
25867
25928
  const NormalizedStackAreaChart = ({
25868
25929
  isDateType,
25869
25930
  formatOptions,
25870
- data
25931
+ data,
25932
+ isReportEditable
25871
25933
  }) => {
25872
25934
  const chartId = crypto.randomUUID();
25873
25935
  const barWidth = 0;
25874
- const chartType = actualChartTypes.stackArea100;
25936
+ const chartType = chartTypes.NormalizedStackAreaChart;
25875
25937
  const svgRef = useRef();
25876
25938
  const seriesData = generalizedChartData(
25877
25939
  data.ChartData,
@@ -26348,7 +26410,9 @@ const NormalizedStackAreaChart = ({
26348
26410
  filteredDimension,
26349
26411
  innerHeight2,
26350
26412
  chartId,
26351
- svg
26413
+ svg,
26414
+ dataTableHeight,
26415
+ isReportEditable
26352
26416
  );
26353
26417
  let newSeriesLabelArray = prepareDataForSeriesLabel(
26354
26418
  innerWidth2,
@@ -53160,7 +53224,7 @@ const WaterfallChart = ({
53160
53224
  const chartId = crypto.randomUUID?.();
53161
53225
  let columnWidth = 0;
53162
53226
  let colorScale;
53163
- const chartType = actualChartTypes.waterfall;
53227
+ const chartType = chartTypes.WaterfallChart;
53164
53228
  const svgRef = useRef();
53165
53229
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53166
53230
  const dimensionList = data.DimensionList;
@@ -53792,11 +53856,12 @@ const WaterfallChart = ({
53792
53856
  const TornadoChart = ({
53793
53857
  isDateType,
53794
53858
  formatOptions,
53795
- data
53859
+ data,
53860
+ isReportEditable
53796
53861
  }) => {
53797
53862
  const chartId = crypto.randomUUID();
53798
53863
  let columnWidth = 0;
53799
- const chartType = actualChartTypes.tornadoChart;
53864
+ const chartType = chartTypes.TornadoChart;
53800
53865
  const svgRef = useRef();
53801
53866
  const seriesData = generalizedChartData(data.ChartData, data.DimensionList);
53802
53867
  const dimensionList = data.DimensionList;
@@ -53832,13 +53897,11 @@ const TornadoChart = ({
53832
53897
  let svg;
53833
53898
  let gTag;
53834
53899
  let yScaleLeft;
53835
- let yScaleRight;
53836
53900
  let xScale;
53837
53901
  let xScaleForLegends;
53838
53902
  let calculatedRange;
53839
53903
  let yAxisLeft;
53840
53904
  let xAxis;
53841
- let yAxisRight;
53842
53905
  let filteredDimension;
53843
53906
  let filteredData = [];
53844
53907
  let isSensitivityChart = false;
@@ -53849,7 +53912,7 @@ const TornadoChart = ({
53849
53912
  chartType,
53850
53913
  chartData: [],
53851
53914
  formatOptions,
53852
- legendList: [],
53915
+ legendList: data.LegendList,
53853
53916
  secondaryAxisDrawn: false,
53854
53917
  yMaxLeft: 0,
53855
53918
  yMaxRight: 0,
@@ -53898,7 +53961,7 @@ const TornadoChart = ({
53898
53961
  maxNumberForSecondaryAxis,
53899
53962
  chartJSON.yMaxLeft,
53900
53963
  formatOptions,
53901
- chartJSON.legendList,
53964
+ chartJSON.legendList.map((d) => d["alias"]),
53902
53965
  chartJSON.dimensionList,
53903
53966
  chartJSON.yMaxRight,
53904
53967
  isSecondaryAxisDrawn,
@@ -53939,7 +54002,7 @@ const TornadoChart = ({
53939
54002
  innerHeight2,
53940
54003
  innerWidth2,
53941
54004
  yAxisLeft,
53942
- yAxisRight,
54005
+ null,
53943
54006
  xScale,
53944
54007
  chartJSON.yMaxLeft,
53945
54008
  chartJSON.dimensionList,
@@ -54021,53 +54084,59 @@ const TornadoChart = ({
54021
54084
  width,
54022
54085
  legendMargin,
54023
54086
  formatOptions,
54024
- seriesData,
54087
+ mapSeriesDataWithLegendList(seriesData, chartJSON.legendList),
54025
54088
  chartId,
54026
- staticLegendShape.rectangle
54089
+ staticLegendShape.rectangle,
54090
+ chartType
54091
+ );
54092
+ };
54093
+ const mapSeriesDataWithLegendList = (seriesData2, legendList) => {
54094
+ return seriesData2.map((series, index2) => ({
54095
+ ...series,
54096
+ properties: legendList[index2] ? { ...legendList[index2] } : {}
54097
+ })).filter(
54098
+ (series) => series.properties && Object.keys(series.properties).length > 0
54027
54099
  );
54028
54100
  };
54029
54101
  const preProcessChartData = () => {
54030
- const allChartData = [];
54031
- const legendList = [];
54032
- let formatedDimensionList = [];
54033
- let firstMeasure = seriesData[0]?.properties.currentMeasure;
54102
+ const firstMeasure = seriesData[0]?.properties.currentMeasure;
54034
54103
  let yMaxLeft = 0;
54035
54104
  let yMaxRight = -Infinity;
54036
- seriesData.forEach((series) => {
54037
- legendList.push(series.legend);
54038
- series.data.forEach((point2) => {
54039
- if (series.properties.currentMeasure === firstMeasure) {
54040
- point2.value = -point2.value;
54041
- }
54042
- allChartData.push(point2);
54105
+ const processedSeriesData = seriesData.map((series) => {
54106
+ const isFirstMeasure = series.properties.currentMeasure === firstMeasure;
54107
+ const newData = series.data.map((point2) => {
54108
+ const newValue = isFirstMeasure ? -Math.abs(point2.value) : Math.abs(point2.value);
54109
+ return {
54110
+ ...point2,
54111
+ value: newValue
54112
+ };
54043
54113
  });
54044
- let measuresArray = series.data.map((d) => d.value);
54045
- if (series.properties.currentMeasure === firstMeasure) {
54046
- yMaxLeft = Math.min(yMaxLeft, Math.min(...measuresArray));
54047
- } else {
54048
- yMaxRight = Math.max(yMaxRight, Math.max(...measuresArray));
54049
- }
54114
+ const values = newData.map((d) => d.value);
54115
+ if (isFirstMeasure) yMaxLeft = Math.min(yMaxLeft, Math.min(...values));
54116
+ else yMaxRight = Math.max(yMaxRight, Math.max(...values));
54117
+ return {
54118
+ ...series,
54119
+ data: newData
54120
+ };
54050
54121
  });
54051
- chartJSON.chartData = allChartData;
54052
- chartJSON.legendList = legendList;
54122
+ chartJSON.chartData = processedSeriesData;
54053
54123
  chartJSON.yMaxLeft = yMaxLeft;
54054
54124
  chartJSON.yMaxRight = yMaxRight;
54055
- formatedDimensionList = isDateType ? setDateFormats(
54125
+ const formatedDimensionList = isDateType ? setDateFormats(
54056
54126
  formatOptions.xAxisLabel.xAxisNumberFormat,
54057
54127
  chartJSON.dimensionList
54058
- ).map((d) => d) : chartJSON.dimensionList;
54128
+ ) : chartJSON.dimensionList;
54059
54129
  chartJSON.dimensionList.forEach((dim, i) => {
54060
- chartJSON.formattedDimensionListMap.set(dim, formatedDimensionList[i]);
54061
- });
54062
- filteredData = JSON.parse(JSON.stringify(seriesData));
54063
- if (!formatOptions.plotArea.fitChart) {
54064
- filteredDimension = chartJSON.dimensionList.slice(
54065
- scrollPosition,
54066
- scrollPosition + visibleBars
54130
+ chartJSON.formattedDimensionListMap.set(
54131
+ dim,
54132
+ formatedDimensionList[i]
54067
54133
  );
54068
- } else {
54069
- filteredDimension = chartJSON.dimensionList;
54070
- }
54134
+ });
54135
+ filteredData = JSON.parse(JSON.stringify(processedSeriesData));
54136
+ filteredDimension = !formatOptions.plotArea.fitChart ? chartJSON.dimensionList.slice(
54137
+ scrollPosition,
54138
+ scrollPosition + visibleBars
54139
+ ) : chartJSON.dimensionList;
54071
54140
  if (formatOptions.plotArea.hideZeroValues) {
54072
54141
  chartJSON.hideZeroValues = true;
54073
54142
  }
@@ -54086,18 +54155,7 @@ const TornadoChart = ({
54086
54155
  }
54087
54156
  let adjustedPosition = formatOptions.annotation.annotationVisibility != "5" && formatOptions.annotation.annotationPosition == "1" ? 20 : 0;
54088
54157
  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;
54089
- let yAxisLabelArray = responsiveYaxisLabel$1(
54090
- chartJSON.yMaxRight,
54091
- chartJSON.yMaxLeft,
54092
- innerHeight2,
54093
- formatOptions,
54094
- chartJSON,
54095
- customYaxisMinValue,
54096
- customYaxisMaxValue,
54097
- barChart,
54098
- innerWidth2
54099
- ).yAxisLabelArray;
54100
- chartJSON.yMaxLeft = yAxisLabelArray[0];
54158
+ chartJSON.yMaxLeft = chartJSON.yMaxLeft;
54101
54159
  xScaleForLegends = linear$1().domain([chartJSON.yMaxLeft * (1.2 + (left2 ? scaleFactor : 0)), chartJSON.yMaxRight * (1.2 + (right2 ? scaleFactor : 0))]).range([adjustedPosition, innerWidth2 - adjustedPosition]);
54102
54160
  xScale = xScaleForLegends;
54103
54161
  calculatedRange = [0, innerWidth2];
@@ -54111,7 +54169,7 @@ const TornadoChart = ({
54111
54169
  yAxisLeft = axisLeft(yScaleLeft).tickSize(
54112
54170
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -(innerWidth2 - xScaleForLegends(0)) : 0 : 0
54113
54171
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54114
- yAxisRight = axisRight(yScaleLeft).tickSize(
54172
+ axisRight(yScaleLeft).tickSize(
54115
54173
  formatOptions.plotArea.gridLinesVisibility ? formatOptions.plotArea.gridLinesHorizontal ? -xScaleForLegends(0) : 0 : 0
54116
54174
  ).tickSizeOuter(0).tickValues(responsiveXaxisLabel(chartJSON.dimensionList, innerWidth2));
54117
54175
  };
@@ -54152,29 +54210,46 @@ const TornadoChart = ({
54152
54210
  ).customTickValue ?? (dataTableHeight > 0 ? (innerWidth2 - dataTableHeight) / 30 : innerWidth2 / 30)
54153
54211
  ).tickPadding(8).tickSizeOuter(0);
54154
54212
  };
54155
- const getChartType = (lineData) => {
54213
+ const getChartType = () => {
54214
+ gTag.selectAll(".parentGroup").remove();
54156
54215
  formatOptions.plotArea.plotAreaCalculatedHigh;
54157
54216
  formatOptions.plotArea.plotAreaCalculatedLow;
54158
- gTag.append("g").attr("class", "parentGroup").selectAll("#scaling-svg" + chartId + " .rect").data(filteredData).enter().append("g").attr("class", (d) => d.data[0].legend.replace(/ /g, "-")).selectAll("rect").data((d) => d.data.map((child) => ({
54159
- ...child,
54160
- parentProperties: d.properties
54161
- }))).enter().append("rect").attr("class", "rect").attr("y", (d) => d.dimension ? yScaleLeft(d.dimension) : yScaleLeft("defaultEntry")).attr("x", (d) => xScale(Math.max(0, d.value))).attr("stroke-dasharray", (d) => d.stackBorderStyle == 2 ? "5,3" : "0").attr("stroke-width", (d) => d.stackBorderWidth + "px").attr("stroke", (d) => d.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.stackBorderColor : "none").style("shape-rendering", "crispEdges").attr("width", (d) => d.value ? Math.abs(xScale(d.value) - xScale(0)) : 0).attr("height", yScaleLeft.bandwidth()).style("fill", (d) => d.parentProperties.color).attr("opacity", 1).on("mousemove", (event2, d) => {
54217
+ const parent = gTag.append("g").attr("class", "parentGroup");
54218
+ parent.selectAll("rect").data(
54219
+ filteredData.flatMap(
54220
+ (d) => d.data.map((child) => ({
54221
+ ...child,
54222
+ legendText: d.legend.replace("-", "~$~").split("~$~")[1].trim(),
54223
+ properties: d.properties
54224
+ }))
54225
+ )
54226
+ ).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(
54227
+ "stroke",
54228
+ (d) => d.properties.stackBorderStyle == 0 ? "none" : formatOptions.column.stackBorderVisibility ? d.properties.stackBorderColor : "none"
54229
+ ).style(
54230
+ "fill",
54231
+ (d) => d.properties.color
54232
+ ).on("mousemove", (event2, d) => {
54162
54233
  showTooltipOnMouseMove(
54163
54234
  [
54164
- { key: "Measure", value: d.legend },
54165
- { key: "Legend", value: d.dimension },
54235
+ { key: "Measure", value: d.dimension },
54236
+ { key: "Legend", value: d.legendText },
54166
54237
  {
54167
54238
  key: "Value",
54168
- value: d.value < 0 ? getNumberWithFormat(-d.value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision, true) : getNumberWithFormat(d.value, formatOptions.toolTip.toolTipDisplayUnits, formatOptions.toolTip.toolTipNumberFormat, formatOptions.toolTip.toolTipDecimalPrecision, true)
54239
+ value: getNumberWithFormat(
54240
+ Math.abs(d.value),
54241
+ formatOptions.toolTip.toolTipDisplayUnits,
54242
+ formatOptions.toolTip.toolTipNumberFormat,
54243
+ formatOptions.toolTip.toolTipDecimalPrecision,
54244
+ true
54245
+ )
54169
54246
  }
54170
54247
  ],
54171
54248
  formatOptions,
54172
- void 0,
54173
- d.parentProperties
54249
+ event2,
54250
+ d.properties
54174
54251
  );
54175
- }).on("mouseout", () => {
54176
- hideTooltipOnMouseOut();
54177
- });
54252
+ }).on("mouseout", hideTooltipOnMouseOut);
54178
54253
  };
54179
54254
  const setSVGContainer = (margin2) => {
54180
54255
  innerWidth2 = width - margin2.left - margin2.right;
@@ -54257,7 +54332,7 @@ const TornadoChart = ({
54257
54332
  filteredData,
54258
54333
  yScaleLeft,
54259
54334
  xScale,
54260
- yScaleRight,
54335
+ null,
54261
54336
  // need to pass secondary axis scale if secondary axis is drawn
54262
54337
  margin,
54263
54338
  d3Annotation,
@@ -54279,6 +54354,7 @@ const TornadoChart = ({
54279
54354
  yScaleLeft,
54280
54355
  columnWidth,
54281
54356
  isSensitivityChart,
54357
+ isReportEditable,
54282
54358
  barChart
54283
54359
  );
54284
54360
  };