pace-chart-lib 1.0.41 → 1.0.43

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.
@@ -569,6 +569,9 @@ export declare const defaultChartFormatOptions: {
569
569
  dataTableDisplayUnits: string;
570
570
  dataTableLabelColor: commonColors;
571
571
  dataTableAxisLabel: boolean;
572
+ dataTableLegends: boolean;
573
+ disableLegendIcon: boolean;
574
+ legendsWrapText: boolean;
572
575
  };
573
576
  dataTableOuterBorder: {
574
577
  borderButtonVisibility: boolean;
@@ -11446,7 +11446,10 @@ const defaultChartFormatOptions = {
11446
11446
  dataTableDecimalPrecision: "2",
11447
11447
  dataTableDisplayUnits: "None",
11448
11448
  dataTableLabelColor: commonColors.black,
11449
- dataTableAxisLabel: true
11449
+ dataTableAxisLabel: true,
11450
+ dataTableLegends: true,
11451
+ disableLegendIcon: true,
11452
+ legendsWrapText: false
11450
11453
  },
11451
11454
  dataTableOuterBorder: {
11452
11455
  borderButtonVisibility: true,
@@ -11709,6 +11712,7 @@ function calculateHorizontalMargins(windowWidth, windowHeight, maxNumberForPrima
11709
11712
  const yAxisRelatedMargin = isBarChart ? metrics.xTitle + metrics.xLabel : metrics.yTitle + metrics.yLabel;
11710
11713
  const legendPosition = formatOptions.legends.legendPosition;
11711
11714
  const legendVisibility = formatOptions.legends.legendVisibility;
11715
+ const yAxisPosition = formatOptions.xAxisLabel.xAxisPosition;
11712
11716
  let left2 = 0;
11713
11717
  let right2 = 0;
11714
11718
  const secondaryExtra = isSecondaryAxisDrawn ? metrics.secondaryYLabel + metrics.secondaryAxisTitleWidth : 0;
@@ -11719,16 +11723,16 @@ function calculateHorizontalMargins(windowWidth, windowHeight, maxNumberForPrima
11719
11723
  left2 = yAxisRelatedMargin + 5;
11720
11724
  break;
11721
11725
  case staticLegendPosition.top:
11722
- right2 = 15 + secondaryExtra;
11723
- left2 = yAxisRelatedMargin + 5;
11726
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 : 15 + secondaryExtra;
11727
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra : yAxisRelatedMargin + 5;
11724
11728
  break;
11725
11729
  case staticLegendPosition.right:
11726
- right2 = metrics.legendMargin + secondaryExtra + 35;
11727
- left2 = yAxisRelatedMargin + 5;
11730
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 + metrics.legendMargin : metrics.legendMargin + secondaryExtra + 35;
11731
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra + metrics.legendMargin : yAxisRelatedMargin + 5;
11728
11732
  break;
11729
11733
  case staticLegendPosition.bottom:
11730
- right2 = 15 + secondaryExtra;
11731
- left2 = yAxisRelatedMargin + 5;
11734
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 : 15 + secondaryExtra;
11735
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra : yAxisRelatedMargin + 5;
11732
11736
  break;
11733
11737
  case staticLegendPosition.left:
11734
11738
  left2 = metrics.legendMargin + yAxisRelatedMargin + 33;
@@ -12281,14 +12285,14 @@ function responsiveSecondaryYaxisLabel(secondaryYmax, secondaryYmin, formatOptio
12281
12285
  }
12282
12286
  } else {
12283
12287
  let labelWidthPx = calculateWidthHeightDynamically(
12284
- (parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMaxText) || secondaryYmax).toString(),
12288
+ secondaryYmax.toString(),
12285
12289
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelFontSize,
12286
12290
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelFontFamily,
12287
12291
  0
12288
12292
  );
12289
12293
  secondaryYAxisLabelArray = getLabelsFromAlgo(
12290
- parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMinText) || secondaryYmin,
12291
- parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMaxText) || secondaryYmax,
12294
+ secondaryYmin,
12295
+ secondaryYmax,
12292
12296
  innerHeight2,
12293
12297
  labelWidthPx[0]
12294
12298
  );
@@ -12459,7 +12463,7 @@ function initYaxis$1(gTag, formatOptions, dataTableHeight, yLabel, yAxisLeft, in
12459
12463
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
12460
12464
  );
12461
12465
  const yAxisG = gTag.append("g").call(yAxisLeft);
12462
- yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em").attr("stroke-opacity", formatOptions.plotArea.fitChart ? "1" : "0");
12466
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
12463
12467
  yAxisG.selectAll("text").style(
12464
12468
  "fill",
12465
12469
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -14035,7 +14039,7 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
14035
14039
  if (i == 0) {
14036
14040
  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(
14037
14041
  "border-width",
14038
- outerBorder ? `0px ${0}px ${outerBorderLineWidth}px 0px` : "0px 0px 0px 0px"
14042
+ outerBorder ? `0px ${0}px ${!formatOptions.dataTableProperties.dataTableAxisLabel ? 0 : outerBorderLineWidth}px 0px` : "0px 0px 0px 0px"
14039
14043
  ).style(
14040
14044
  "border-style",
14041
14045
  outerBorder ? `solid ${outerBorderLineStyle} ${outerBorderLineStyle} solid` : "solid solid solid solid"
@@ -14045,7 +14049,7 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
14045
14049
  ).style("text-align", "center").style("vertical-align", "middle").text("");
14046
14050
  }
14047
14051
  let legendsParentTag = temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY + yCordinate).attr("width", margin.left).attr("height", cellHeight2);
14048
- 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(
14052
+ 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", formatOptions.dataTableProperties.disableLegendIcon ? `2px` : `5px`).style("padding-right", `3px`).style(
14049
14053
  "border-width",
14050
14054
  getBorderStyle(
14051
14055
  formatOptions,
@@ -14076,22 +14080,24 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
14076
14080
  "color"
14077
14081
  )
14078
14082
  );
14079
- switch (chartType) {
14080
- case chartTypes.ColumnChart:
14081
- case chartTypes.StackColumnChart:
14082
- case chartTypes.NormalizedStackColumnChart:
14083
- innerdiv.append("xhtml:div").style("height", "10px").style("width", "15px").style("background", data.properties.color).style("border-radius", "1px");
14084
- break;
14085
- case chartTypes.LineChart:
14086
- case chartTypes.StackLineChart:
14087
- case chartTypes.NormalizedStackLineChart:
14088
- getLineShape(data, innerdiv, formatOptions);
14089
- break;
14090
- case chartTypes.AreaChart:
14091
- case chartTypes.StackAreaChart:
14092
- case chartTypes.NormalizedStackAreaChart:
14093
- getAreaShape(data, innerdiv, formatOptions);
14094
- break;
14083
+ if (!formatOptions.dataTableProperties.disableLegendIcon) {
14084
+ switch (chartType) {
14085
+ case chartTypes.ColumnChart:
14086
+ case chartTypes.StackColumnChart:
14087
+ case chartTypes.NormalizedStackColumnChart:
14088
+ innerdiv.append("xhtml:div").style("height", "10px").style("width", "15px").style("background", data.properties.color).style("border-radius", "1px");
14089
+ break;
14090
+ case chartTypes.LineChart:
14091
+ case chartTypes.StackLineChart:
14092
+ case chartTypes.NormalizedStackLineChart:
14093
+ getLineShape(data, innerdiv, formatOptions);
14094
+ break;
14095
+ case chartTypes.AreaChart:
14096
+ case chartTypes.StackAreaChart:
14097
+ case chartTypes.NormalizedStackAreaChart:
14098
+ getAreaShape(data, innerdiv, formatOptions);
14099
+ break;
14100
+ }
14095
14101
  }
14096
14102
  let text = "";
14097
14103
  {
@@ -14135,7 +14141,13 @@ function addDataTable(isFitChart, svg, currentTag, dataTable, colWidth, yAxis, x
14135
14141
  dataTable.forEach((data, i) => {
14136
14142
  yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
14137
14143
  cellHeight = data.properties.height;
14138
- getLegendsAppended(tag, i, data, cellHeight);
14144
+ if (formatOptions.dataTableProperties.dataTableLegends) {
14145
+ if (!isFitChart) {
14146
+ getLegendsAppended(tag, i, data, cellHeight);
14147
+ } else {
14148
+ getLegendsAppended(tag, i, data, cellHeight);
14149
+ }
14150
+ }
14139
14151
  let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
14140
14152
  "transform",
14141
14153
  (d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
@@ -14532,11 +14544,11 @@ function getBorderStyle(formatOptions, position, currentCellIndex, totalDimensio
14532
14544
  borderStyle = `solid solid solid solid`;
14533
14545
  borderColor = `black black black black`;
14534
14546
  } else if (outerBorder && !innerHorizontalBorder && !innerVerticalBorder) {
14535
- borderWidth = `${0}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14547
+ borderWidth = `${outerBorderLineWidth}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14536
14548
  borderStyle = `${outerBorderLineStyle} solid solid ${outerBorderLineStyle}`;
14537
14549
  borderColor = `${outerBorderLineColor} black black ${outerBorderLineColor}`;
14538
14550
  } else if (outerBorder && !innerHorizontalBorder && innerVerticalBorder) {
14539
- borderWidth = `${0}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14551
+ borderWidth = `${outerBorderLineWidth}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14540
14552
  borderStyle = `${outerBorderLineStyle} ${innerVerticalBorderLineStyle} solid ${outerBorderLineStyle}`;
14541
14553
  borderColor = `${outerBorderLineColor} ${innerVerticalBorderLineColor} black ${outerBorderLineColor}`;
14542
14554
  } else if (outerBorder && innerHorizontalBorder && innerVerticalBorder) {
@@ -18038,14 +18050,6 @@ const CustomColumnChart = ({
18038
18050
  ]);
18039
18051
  }
18040
18052
  if (isSecondaryAxisDrawn) {
18041
- let secondaryYAxisLabelArray = responsiveSecondaryYaxisLabel(
18042
- secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
18043
- secondaryCustomYaxisMinValue ? secondaryCustomYaxisMinValue : chartJSON.yMinRight,
18044
- formatOptions,
18045
- innerHeight2
18046
- ).secondaryYAxisLabelArray;
18047
- chartJSON.yMaxRight = secondaryYAxisLabelArray[secondaryYAxisLabelArray.length - 1];
18048
- chartJSON.yMinRight = secondaryYAxisLabelArray[0];
18049
18053
  yScaleRight = linear$1().domain([
18050
18054
  chartJSON.yMinRight >= 0 ? (secondaryCustomYaxisMinValue || secondaryCustomYaxisMinValue == 0) && !Number.isNaN(secondaryCustomYaxisMinValue) ? secondaryCustomYaxisMinValue : 0 : (secondaryCustomYaxisMinValue || secondaryCustomYaxisMinValue == 0) && !Number.isNaN(secondaryCustomYaxisMinValue) ? secondaryCustomYaxisMinValue : chartJSON.yMinRight * 1.1,
18051
18055
  chartJSON.yMaxRight <= 0 ? (secondaryCustomYaxisMaxValue || secondaryCustomYaxisMaxValue == 0) && !Number.isNaN(secondaryCustomYaxisMaxValue) ? secondaryCustomYaxisMaxValue : 0 : (secondaryCustomYaxisMaxValue || secondaryCustomYaxisMaxValue == 0) && !Number.isNaN(secondaryCustomYaxisMaxValue) ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight * 1.1
@@ -20856,7 +20860,7 @@ function initYaxis(gTag, formatOptions, dataTableHeight, yLabel, yAxisLeft, inne
20856
20860
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
20857
20861
  );
20858
20862
  const yAxisG = gTag.append("g").call(yAxisLeft);
20859
- yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em").attr("stroke-opacity", formatOptions.plotArea.fitChart ? "1" : "0");
20863
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
20860
20864
  yAxisG.selectAll("text").style(
20861
20865
  "fill",
20862
20866
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -22110,7 +22114,7 @@ const LineChart = ({
22110
22114
  void 0,
22111
22115
  void 0,
22112
22116
  dataTableHeight,
22113
- "Line",
22117
+ chartType,
22114
22118
  formatOptions,
22115
22119
  yLabel,
22116
22120
  yTitle,
@@ -22648,7 +22652,7 @@ const StackLineChart = ({
22648
22652
  void 0,
22649
22653
  void 0,
22650
22654
  dataTableHeight,
22651
- "Line",
22655
+ chartTypes.LineChart,
22652
22656
  formatOptions,
22653
22657
  yLabel,
22654
22658
  yTitle,
@@ -23176,7 +23180,7 @@ const NormalisedStackLineChart = ({
23176
23180
  void 0,
23177
23181
  void 0,
23178
23182
  dataTableHeight,
23179
- "Line",
23183
+ chartTypes.LineChart,
23180
23184
  formatOptions,
23181
23185
  yLabel,
23182
23186
  yTitle,
@@ -23396,28 +23400,32 @@ const HorizontalBarChart = ({
23396
23400
  innerWidth2,
23397
23401
  innerHeight2
23398
23402
  );
23399
- yAxistitle$1(
23400
- innerHeight2,
23401
- formatOptions,
23402
- dataTableHeight,
23403
- barChart,
23404
- svg,
23405
- margin,
23406
- yTitle,
23407
- yLabel,
23408
- innerWidth2
23409
- );
23410
- formatOptions.xAxisLabel.xAxisPosition == "2" && yAxistitleRight(
23411
- svg,
23412
- isSecondaryAxisDrawn,
23413
- margin,
23414
- formatOptions,
23415
- dataTableHeight,
23416
- innerHeight2,
23417
- innerWidth2,
23418
- secondaryYLabel,
23419
- secondaryAxisTitleWidth
23420
- );
23403
+ if (formatOptions.xAxisLabel.xAxisPosition != "1") {
23404
+ yAxistitle$1(
23405
+ innerHeight2,
23406
+ formatOptions,
23407
+ dataTableHeight,
23408
+ barChart,
23409
+ svg,
23410
+ margin,
23411
+ yTitle,
23412
+ yLabel,
23413
+ innerWidth2
23414
+ );
23415
+ }
23416
+ if (formatOptions.xAxisLabel.xAxisPosition == "1") {
23417
+ yAxistitleRight(
23418
+ svg,
23419
+ isSecondaryAxisDrawn,
23420
+ margin,
23421
+ formatOptions,
23422
+ dataTableHeight,
23423
+ innerHeight2,
23424
+ innerWidth2,
23425
+ secondaryYLabel,
23426
+ secondaryAxisTitleWidth
23427
+ );
23428
+ }
23421
23429
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23422
23430
  drawLegends(
23423
23431
  height,
@@ -26677,7 +26685,7 @@ const AreaChart = ({
26677
26685
  void 0,
26678
26686
  void 0,
26679
26687
  dataTableHeight,
26680
- "Area",
26688
+ chartType,
26681
26689
  formatOptions,
26682
26690
  yLabel,
26683
26691
  yTitle,
@@ -53787,7 +53795,7 @@ const BubbleChart = ({
53787
53795
  let tempLegendEntries = legendEntries;
53788
53796
  maxLegendDimensions = calculateLegendsMaxPossibleWidth(
53789
53797
  chartFormatOptions,
53790
- tempLegendEntries,
53798
+ tempLegendEntries ?? [],
53791
53799
  "alias"
53792
53800
  );
53793
53801
  let convertedData = convertIncomingData(data);
@@ -53871,6 +53879,18 @@ const BubbleChart = ({
53871
53879
  drawReferenceLines();
53872
53880
  initLegendList();
53873
53881
  initCircles();
53882
+ setnumberOfBubbles(
53883
+ svg,
53884
+ chartFormatOptions.legends.legendPosition,
53885
+ chartFormatOptions,
53886
+ height,
53887
+ width,
53888
+ margins,
53889
+ innerHeight2,
53890
+ xTitle,
53891
+ xLabel,
53892
+ data.length
53893
+ );
53874
53894
  };
53875
53895
  const initCircles = () => {
53876
53896
  try {
@@ -54019,7 +54039,7 @@ const BubbleChart = ({
54019
54039
  formatOptions.xAxisLabel.xAxisLabelDecimalPrecision ?? "2"
54020
54040
  )
54021
54041
  ).tickSize(
54022
- chartFormatOptions.plotArea.gridLinesVisibility ? chartFormatOptions.plotArea.gridLinesVertical ? chartFormatOptions.xAxisLabel.xAxisPosition === "0" ? -innerHeight2 : chartFormatOptions.xAxisLabel.xAxisPosition === "1" ? innerHeight2 : 0 : 0 : 0
54042
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0)
54023
54043
  ).tickValues(autoLabelFlag ? void 0 : xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54024
54044
  initXaxis(
54025
54045
  chartAreaTagG,
@@ -54115,7 +54135,7 @@ const BubbleChart = ({
54115
54135
  };
54116
54136
  const initLegendList = () => {
54117
54137
  try {
54118
- let tempLegendEntries = legendEntries.map((d) => {
54138
+ let tempLegendEntries = legendEntries?.map((d) => {
54119
54139
  let modifiedProperties = {
54120
54140
  ...d,
54121
54141
  legendFontStyle: d.fontStyle,
@@ -54131,7 +54151,7 @@ const BubbleChart = ({
54131
54151
  initLegendListWithTotalValueAllowance(
54132
54152
  chartFormatOptions,
54133
54153
  svg,
54134
- tempLegendEntries,
54154
+ tempLegendEntries || [],
54135
54155
  width,
54136
54156
  height,
54137
54157
  maxLegendDimensions[0],
@@ -55461,7 +55481,7 @@ const WaterfallChart = ({
55461
55481
  };
55462
55482
  const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
55463
55483
  const mapAdvancedWaterfallData = (rawData) => {
55464
- const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
55484
+ const tempRawDataForAAWaterfallChart = rawData[0]?.Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : isAdvancedAnalyticsWaterFall ? rawData.Data : rawData;
55465
55485
  return tempRawDataForAAWaterfallChart.map((d) => ({
55466
55486
  xKey: d.Column1 || (d.Dimension || d.Legend),
55467
55487
  base: toNumber(d.Column3 || d.Total),
@@ -11449,7 +11449,10 @@
11449
11449
  dataTableDecimalPrecision: "2",
11450
11450
  dataTableDisplayUnits: "None",
11451
11451
  dataTableLabelColor: commonColors.black,
11452
- dataTableAxisLabel: true
11452
+ dataTableAxisLabel: true,
11453
+ dataTableLegends: true,
11454
+ disableLegendIcon: true,
11455
+ legendsWrapText: false
11453
11456
  },
11454
11457
  dataTableOuterBorder: {
11455
11458
  borderButtonVisibility: true,
@@ -11712,6 +11715,7 @@
11712
11715
  const yAxisRelatedMargin = isBarChart ? metrics.xTitle + metrics.xLabel : metrics.yTitle + metrics.yLabel;
11713
11716
  const legendPosition = formatOptions.legends.legendPosition;
11714
11717
  const legendVisibility = formatOptions.legends.legendVisibility;
11718
+ const yAxisPosition = formatOptions.xAxisLabel.xAxisPosition;
11715
11719
  let left2 = 0;
11716
11720
  let right2 = 0;
11717
11721
  const secondaryExtra = isSecondaryAxisDrawn ? metrics.secondaryYLabel + metrics.secondaryAxisTitleWidth : 0;
@@ -11722,16 +11726,16 @@
11722
11726
  left2 = yAxisRelatedMargin + 5;
11723
11727
  break;
11724
11728
  case staticLegendPosition.top:
11725
- right2 = 15 + secondaryExtra;
11726
- left2 = yAxisRelatedMargin + 5;
11729
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 : 15 + secondaryExtra;
11730
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra : yAxisRelatedMargin + 5;
11727
11731
  break;
11728
11732
  case staticLegendPosition.right:
11729
- right2 = metrics.legendMargin + secondaryExtra + 35;
11730
- left2 = yAxisRelatedMargin + 5;
11733
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 + metrics.legendMargin : metrics.legendMargin + secondaryExtra + 35;
11734
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra + metrics.legendMargin : yAxisRelatedMargin + 5;
11731
11735
  break;
11732
11736
  case staticLegendPosition.bottom:
11733
- right2 = 15 + secondaryExtra;
11734
- left2 = yAxisRelatedMargin + 5;
11737
+ right2 = yAxisPosition == "1" ? yAxisRelatedMargin + 5 : 15 + secondaryExtra;
11738
+ left2 = yAxisPosition == "1" ? 15 + secondaryExtra : yAxisRelatedMargin + 5;
11735
11739
  break;
11736
11740
  case staticLegendPosition.left:
11737
11741
  left2 = metrics.legendMargin + yAxisRelatedMargin + 33;
@@ -12284,14 +12288,14 @@
12284
12288
  }
12285
12289
  } else {
12286
12290
  let labelWidthPx = calculateWidthHeightDynamically(
12287
- (parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMaxText) || secondaryYmax).toString(),
12291
+ secondaryYmax.toString(),
12288
12292
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelFontSize,
12289
12293
  formatOptions.secondaryYAxisLabel.secondaryYAxisLabelFontFamily,
12290
12294
  0
12291
12295
  );
12292
12296
  secondaryYAxisLabelArray = getLabelsFromAlgo(
12293
- parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMinText) || secondaryYmin,
12294
- parseFloat(formatOptions.secondaryYAxisLabel.secondaryYAxisMaxText) || secondaryYmax,
12297
+ secondaryYmin,
12298
+ secondaryYmax,
12295
12299
  innerHeight2,
12296
12300
  labelWidthPx[0]
12297
12301
  );
@@ -12462,7 +12466,7 @@
12462
12466
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
12463
12467
  );
12464
12468
  const yAxisG = gTag.append("g").call(yAxisLeft);
12465
- yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em").attr("stroke-opacity", formatOptions.plotArea.fitChart ? "1" : "0");
12469
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
12466
12470
  yAxisG.selectAll("text").style(
12467
12471
  "fill",
12468
12472
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -14038,7 +14042,7 @@
14038
14042
  if (i == 0) {
14039
14043
  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(
14040
14044
  "border-width",
14041
- outerBorder ? `0px ${0}px ${outerBorderLineWidth}px 0px` : "0px 0px 0px 0px"
14045
+ outerBorder ? `0px ${0}px ${!formatOptions.dataTableProperties.dataTableAxisLabel ? 0 : outerBorderLineWidth}px 0px` : "0px 0px 0px 0px"
14042
14046
  ).style(
14043
14047
  "border-style",
14044
14048
  outerBorder ? `solid ${outerBorderLineStyle} ${outerBorderLineStyle} solid` : "solid solid solid solid"
@@ -14048,7 +14052,7 @@
14048
14052
  ).style("text-align", "center").style("vertical-align", "middle").text("");
14049
14053
  }
14050
14054
  let legendsParentTag = temp.append("foreignObject").attr("x", -margin.left).attr("y", tableStartY + yCordinate).attr("width", margin.left).attr("height", cellHeight2);
14051
- 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(
14055
+ 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", formatOptions.dataTableProperties.disableLegendIcon ? `2px` : `5px`).style("padding-right", `3px`).style(
14052
14056
  "border-width",
14053
14057
  getBorderStyle(
14054
14058
  formatOptions,
@@ -14079,22 +14083,24 @@
14079
14083
  "color"
14080
14084
  )
14081
14085
  );
14082
- switch (chartType) {
14083
- case chartTypes.ColumnChart:
14084
- case chartTypes.StackColumnChart:
14085
- case chartTypes.NormalizedStackColumnChart:
14086
- innerdiv.append("xhtml:div").style("height", "10px").style("width", "15px").style("background", data.properties.color).style("border-radius", "1px");
14087
- break;
14088
- case chartTypes.LineChart:
14089
- case chartTypes.StackLineChart:
14090
- case chartTypes.NormalizedStackLineChart:
14091
- getLineShape(data, innerdiv, formatOptions);
14092
- break;
14093
- case chartTypes.AreaChart:
14094
- case chartTypes.StackAreaChart:
14095
- case chartTypes.NormalizedStackAreaChart:
14096
- getAreaShape(data, innerdiv, formatOptions);
14097
- break;
14086
+ if (!formatOptions.dataTableProperties.disableLegendIcon) {
14087
+ switch (chartType) {
14088
+ case chartTypes.ColumnChart:
14089
+ case chartTypes.StackColumnChart:
14090
+ case chartTypes.NormalizedStackColumnChart:
14091
+ innerdiv.append("xhtml:div").style("height", "10px").style("width", "15px").style("background", data.properties.color).style("border-radius", "1px");
14092
+ break;
14093
+ case chartTypes.LineChart:
14094
+ case chartTypes.StackLineChart:
14095
+ case chartTypes.NormalizedStackLineChart:
14096
+ getLineShape(data, innerdiv, formatOptions);
14097
+ break;
14098
+ case chartTypes.AreaChart:
14099
+ case chartTypes.StackAreaChart:
14100
+ case chartTypes.NormalizedStackAreaChart:
14101
+ getAreaShape(data, innerdiv, formatOptions);
14102
+ break;
14103
+ }
14098
14104
  }
14099
14105
  let text = "";
14100
14106
  {
@@ -14138,7 +14144,13 @@
14138
14144
  dataTable.forEach((data, i) => {
14139
14145
  yCordinate = yCordinate + (!formatOptions.dataTableProperties.dataTableAxisLabel && i === 0 ? 0 : cellHeight);
14140
14146
  cellHeight = data.properties.height;
14141
- getLegendsAppended(tag, i, data, cellHeight);
14147
+ if (formatOptions.dataTableProperties.dataTableLegends) {
14148
+ if (!isFitChart) {
14149
+ getLegendsAppended(tag, i, data, cellHeight);
14150
+ } else {
14151
+ getLegendsAppended(tag, i, data, cellHeight);
14152
+ }
14153
+ }
14142
14154
  let parentTag = tag.append("g").attr("class", "dataTableBorder").selectAll("#scaling-svg" + chartId + " .foreignObject").data((d, pos) => data["data"]).enter().filter((d) => xAxis(d.dimension)).append("g").attr("fill", commonColors.transparent).attr(
14143
14155
  "transform",
14144
14156
  (d, index2) => `translate(${index2 === 0 ? 0 : xAxis(d.dimension) - cellWidth / 2},0)`
@@ -14535,11 +14547,11 @@
14535
14547
  borderStyle = `solid solid solid solid`;
14536
14548
  borderColor = `black black black black`;
14537
14549
  } else if (outerBorder && !innerHorizontalBorder && !innerVerticalBorder) {
14538
- borderWidth = `${0}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14550
+ borderWidth = `${outerBorderLineWidth}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14539
14551
  borderStyle = `${outerBorderLineStyle} solid solid ${outerBorderLineStyle}`;
14540
14552
  borderColor = `${outerBorderLineColor} black black ${outerBorderLineColor}`;
14541
14553
  } else if (outerBorder && !innerHorizontalBorder && innerVerticalBorder) {
14542
- borderWidth = `${0}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14554
+ borderWidth = `${outerBorderLineWidth}px ${0}px ${0}px ${outerBorderLineWidth}px`;
14543
14555
  borderStyle = `${outerBorderLineStyle} ${innerVerticalBorderLineStyle} solid ${outerBorderLineStyle}`;
14544
14556
  borderColor = `${outerBorderLineColor} ${innerVerticalBorderLineColor} black ${outerBorderLineColor}`;
14545
14557
  } else if (outerBorder && innerHorizontalBorder && innerVerticalBorder) {
@@ -18041,14 +18053,6 @@
18041
18053
  ]);
18042
18054
  }
18043
18055
  if (isSecondaryAxisDrawn) {
18044
- let secondaryYAxisLabelArray = responsiveSecondaryYaxisLabel(
18045
- secondaryCustomYaxisMaxValue ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight,
18046
- secondaryCustomYaxisMinValue ? secondaryCustomYaxisMinValue : chartJSON.yMinRight,
18047
- formatOptions,
18048
- innerHeight2
18049
- ).secondaryYAxisLabelArray;
18050
- chartJSON.yMaxRight = secondaryYAxisLabelArray[secondaryYAxisLabelArray.length - 1];
18051
- chartJSON.yMinRight = secondaryYAxisLabelArray[0];
18052
18056
  yScaleRight = linear$1().domain([
18053
18057
  chartJSON.yMinRight >= 0 ? (secondaryCustomYaxisMinValue || secondaryCustomYaxisMinValue == 0) && !Number.isNaN(secondaryCustomYaxisMinValue) ? secondaryCustomYaxisMinValue : 0 : (secondaryCustomYaxisMinValue || secondaryCustomYaxisMinValue == 0) && !Number.isNaN(secondaryCustomYaxisMinValue) ? secondaryCustomYaxisMinValue : chartJSON.yMinRight * 1.1,
18054
18058
  chartJSON.yMaxRight <= 0 ? (secondaryCustomYaxisMaxValue || secondaryCustomYaxisMaxValue == 0) && !Number.isNaN(secondaryCustomYaxisMaxValue) ? secondaryCustomYaxisMaxValue : 0 : (secondaryCustomYaxisMaxValue || secondaryCustomYaxisMaxValue == 0) && !Number.isNaN(secondaryCustomYaxisMaxValue) ? secondaryCustomYaxisMaxValue : chartJSON.yMaxRight * 1.1
@@ -20859,7 +20863,7 @@
20859
20863
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
20860
20864
  );
20861
20865
  const yAxisG = gTag.append("g").call(yAxisLeft);
20862
- yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em").attr("stroke-opacity", formatOptions.plotArea.fitChart ? "1" : "0");
20866
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
20863
20867
  yAxisG.selectAll("text").style(
20864
20868
  "fill",
20865
20869
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -22113,7 +22117,7 @@
22113
22117
  void 0,
22114
22118
  void 0,
22115
22119
  dataTableHeight,
22116
- "Line",
22120
+ chartType,
22117
22121
  formatOptions,
22118
22122
  yLabel,
22119
22123
  yTitle,
@@ -22651,7 +22655,7 @@
22651
22655
  void 0,
22652
22656
  void 0,
22653
22657
  dataTableHeight,
22654
- "Line",
22658
+ chartTypes.LineChart,
22655
22659
  formatOptions,
22656
22660
  yLabel,
22657
22661
  yTitle,
@@ -23179,7 +23183,7 @@
23179
23183
  void 0,
23180
23184
  void 0,
23181
23185
  dataTableHeight,
23182
- "Line",
23186
+ chartTypes.LineChart,
23183
23187
  formatOptions,
23184
23188
  yLabel,
23185
23189
  yTitle,
@@ -23399,28 +23403,32 @@
23399
23403
  innerWidth2,
23400
23404
  innerHeight2
23401
23405
  );
23402
- yAxistitle$1(
23403
- innerHeight2,
23404
- formatOptions,
23405
- dataTableHeight,
23406
- barChart,
23407
- svg,
23408
- margin,
23409
- yTitle,
23410
- yLabel,
23411
- innerWidth2
23412
- );
23413
- formatOptions.xAxisLabel.xAxisPosition == "2" && yAxistitleRight(
23414
- svg,
23415
- isSecondaryAxisDrawn,
23416
- margin,
23417
- formatOptions,
23418
- dataTableHeight,
23419
- innerHeight2,
23420
- innerWidth2,
23421
- secondaryYLabel,
23422
- secondaryAxisTitleWidth
23423
- );
23406
+ if (formatOptions.xAxisLabel.xAxisPosition != "1") {
23407
+ yAxistitle$1(
23408
+ innerHeight2,
23409
+ formatOptions,
23410
+ dataTableHeight,
23411
+ barChart,
23412
+ svg,
23413
+ margin,
23414
+ yTitle,
23415
+ yLabel,
23416
+ innerWidth2
23417
+ );
23418
+ }
23419
+ if (formatOptions.xAxisLabel.xAxisPosition == "1") {
23420
+ yAxistitleRight(
23421
+ svg,
23422
+ isSecondaryAxisDrawn,
23423
+ margin,
23424
+ formatOptions,
23425
+ dataTableHeight,
23426
+ innerHeight2,
23427
+ innerWidth2,
23428
+ secondaryYLabel,
23429
+ secondaryAxisTitleWidth
23430
+ );
23431
+ }
23424
23432
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23425
23433
  drawLegends(
23426
23434
  height,
@@ -26680,7 +26688,7 @@
26680
26688
  void 0,
26681
26689
  void 0,
26682
26690
  dataTableHeight,
26683
- "Area",
26691
+ chartType,
26684
26692
  formatOptions,
26685
26693
  yLabel,
26686
26694
  yTitle,
@@ -53790,7 +53798,7 @@
53790
53798
  let tempLegendEntries = legendEntries;
53791
53799
  maxLegendDimensions = calculateLegendsMaxPossibleWidth(
53792
53800
  chartFormatOptions,
53793
- tempLegendEntries,
53801
+ tempLegendEntries ?? [],
53794
53802
  "alias"
53795
53803
  );
53796
53804
  let convertedData = convertIncomingData(data);
@@ -53874,6 +53882,18 @@
53874
53882
  drawReferenceLines();
53875
53883
  initLegendList();
53876
53884
  initCircles();
53885
+ setnumberOfBubbles(
53886
+ svg,
53887
+ chartFormatOptions.legends.legendPosition,
53888
+ chartFormatOptions,
53889
+ height,
53890
+ width,
53891
+ margins,
53892
+ innerHeight2,
53893
+ xTitle,
53894
+ xLabel,
53895
+ data.length
53896
+ );
53877
53897
  };
53878
53898
  const initCircles = () => {
53879
53899
  try {
@@ -54022,7 +54042,7 @@
54022
54042
  formatOptions.xAxisLabel.xAxisLabelDecimalPrecision ?? "2"
54023
54043
  )
54024
54044
  ).tickSize(
54025
- chartFormatOptions.plotArea.gridLinesVisibility ? chartFormatOptions.plotArea.gridLinesVertical ? chartFormatOptions.xAxisLabel.xAxisPosition === "0" ? -innerHeight2 : chartFormatOptions.xAxisLabel.xAxisPosition === "1" ? innerHeight2 : 0 : 0 : 0
54045
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0)
54026
54046
  ).tickValues(autoLabelFlag ? void 0 : xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54027
54047
  initXaxis(
54028
54048
  chartAreaTagG,
@@ -54118,7 +54138,7 @@
54118
54138
  };
54119
54139
  const initLegendList = () => {
54120
54140
  try {
54121
- let tempLegendEntries = legendEntries.map((d) => {
54141
+ let tempLegendEntries = legendEntries?.map((d) => {
54122
54142
  let modifiedProperties = {
54123
54143
  ...d,
54124
54144
  legendFontStyle: d.fontStyle,
@@ -54134,7 +54154,7 @@
54134
54154
  initLegendListWithTotalValueAllowance(
54135
54155
  chartFormatOptions,
54136
54156
  svg,
54137
- tempLegendEntries,
54157
+ tempLegendEntries || [],
54138
54158
  width,
54139
54159
  height,
54140
54160
  maxLegendDimensions[0],
@@ -55464,7 +55484,7 @@
55464
55484
  };
55465
55485
  const toNumber = (v) => v === null || v === void 0 || v === "" ? 0 : Number(v);
55466
55486
  const mapAdvancedWaterfallData = (rawData) => {
55467
- const tempRawDataForAAWaterfallChart = rawData[0].Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : rawData;
55487
+ const tempRawDataForAAWaterfallChart = rawData[0]?.Column1 == "" ? rawData.filter((d) => d.Column1 && d.Column1 !== "*") : isAdvancedAnalyticsWaterFall ? rawData.Data : rawData;
55468
55488
  return tempRawDataForAAWaterfallChart.map((d) => ({
55469
55489
  xKey: d.Column1 || (d.Dimension || d.Legend),
55470
55490
  base: toNumber(d.Column3 || d.Total),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "A simple React + Vite + TS UI library with a Button using custom fonts via SCSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",