pace-chart-lib 1.0.40 → 1.0.42

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.
@@ -91,5 +91,5 @@ export declare function responsiveXaxisLabelForNumericValue(xMax: number, xMin:
91
91
  };
92
92
  export declare function initYaxis(gTag: any, formatOptions: TDefaultChartFormatOptionsType, dataTableHeight: number, yLabel: number, yAxisLeft: any, innerHeight: number): void;
93
93
  export declare function initXaxis(gTag: any, formatOptions: TDefaultChartFormatOptionsType, dataTableHeight: number, xLabel: number, xAxis: any, innerHeight: number, innerWidth: number, margins: TChartMargins, yScale: any): void;
94
- export declare function pieFamilyAnnotation(d3Annotation: any, chartData: any, formatOptions: any, getPiePosition: any, chartType: any, width: any, height: any, svg: any, radius: any): void;
94
+ export declare function pieFamilyAnnotation(d3Annotation: any, chartData: any, formatOptions: any, getPiePosition: any, chartType: any, width: any, height: any, svg: any, radius: any, isReportEditable: any): void;
95
95
  export declare const setnumberOfBubbles: (svg: d3.Selection<SVGSVGElement, unknown, null, undefined>, legendPosition: string, chartFormatOptions: TDefaultChartFormatOptionsType, height: number, width: number, margins: TChartMargins, innnerHeight: number, xTitleHeight: number, XLabelHeight: number, bubbleCount: number) => void;
@@ -7,6 +7,7 @@ export interface IChartProps {
7
7
  clientWidth: number;
8
8
  clientHeight: number;
9
9
  formatOptions: TDefaultChartFormatOptionsType;
10
+ isReportEditable?: boolean;
10
11
  }
11
12
  export interface IPieofPieChartProps {
12
13
  chartId: string;
@@ -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;
@@ -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) {
@@ -20856,7 +20868,7 @@ function initYaxis(gTag, formatOptions, dataTableHeight, yLabel, yAxisLeft, inne
20856
20868
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
20857
20869
  );
20858
20870
  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");
20871
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
20860
20872
  yAxisG.selectAll("text").style(
20861
20873
  "fill",
20862
20874
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -20926,11 +20938,11 @@ function initXaxis(gTag, formatOptions, dataTableHeight, xLabel, xAxis, innerHei
20926
20938
  logError$1(fileName$a, "initXaxis", error);
20927
20939
  }
20928
20940
  }
20929
- function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosition, chartType, width, height, svg, radius) {
20941
+ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosition, chartType, width, height, svg, radius, isReportEditable) {
20930
20942
  try {
20931
20943
  if (!formatOptions.annotation.annotationVisibility) return;
20932
20944
  const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
20933
- const Disable = [AnnotationType === "1" ? "connector" : ""];
20945
+ const Disable = [AnnotationType === 1 ? "connector" : ""];
20934
20946
  const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
20935
20947
  const rotationAngle = formatOptions.plotArea.rotation ?? 0;
20936
20948
  const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
@@ -21017,7 +21029,7 @@ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosi
21017
21029
  match.connector.points = oldA.connector?.points;
21018
21030
  }
21019
21031
  });
21020
- makeAnnotations.editMode(formatOptions.plotArea.annotationDraggable).accessors({
21032
+ makeAnnotations.editMode(formatOptions.plotArea.annotationDraggable && isReportEditable).accessors({
21021
21033
  x(d) {
21022
21034
  const r = radius;
21023
21035
  const a2 = d.midAngle + rotationAngle * Math.PI / 180;
@@ -22110,7 +22122,7 @@ const LineChart = ({
22110
22122
  void 0,
22111
22123
  void 0,
22112
22124
  dataTableHeight,
22113
- "Line",
22125
+ chartType,
22114
22126
  formatOptions,
22115
22127
  yLabel,
22116
22128
  yTitle,
@@ -22648,7 +22660,7 @@ const StackLineChart = ({
22648
22660
  void 0,
22649
22661
  void 0,
22650
22662
  dataTableHeight,
22651
- "Line",
22663
+ chartTypes.LineChart,
22652
22664
  formatOptions,
22653
22665
  yLabel,
22654
22666
  yTitle,
@@ -23176,7 +23188,7 @@ const NormalisedStackLineChart = ({
23176
23188
  void 0,
23177
23189
  void 0,
23178
23190
  dataTableHeight,
23179
- "Line",
23191
+ chartTypes.LineChart,
23180
23192
  formatOptions,
23181
23193
  yLabel,
23182
23194
  yTitle,
@@ -23396,28 +23408,32 @@ const HorizontalBarChart = ({
23396
23408
  innerWidth2,
23397
23409
  innerHeight2
23398
23410
  );
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
- );
23411
+ if (formatOptions.xAxisLabel.xAxisPosition != "1") {
23412
+ yAxistitle$1(
23413
+ innerHeight2,
23414
+ formatOptions,
23415
+ dataTableHeight,
23416
+ barChart,
23417
+ svg,
23418
+ margin,
23419
+ yTitle,
23420
+ yLabel,
23421
+ innerWidth2
23422
+ );
23423
+ }
23424
+ if (formatOptions.xAxisLabel.xAxisPosition == "1") {
23425
+ yAxistitleRight(
23426
+ svg,
23427
+ isSecondaryAxisDrawn,
23428
+ margin,
23429
+ formatOptions,
23430
+ dataTableHeight,
23431
+ innerHeight2,
23432
+ innerWidth2,
23433
+ secondaryYLabel,
23434
+ secondaryAxisTitleWidth
23435
+ );
23436
+ }
23421
23437
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23422
23438
  drawLegends(
23423
23439
  height,
@@ -26677,7 +26693,7 @@ const AreaChart = ({
26677
26693
  void 0,
26678
26694
  void 0,
26679
26695
  dataTableHeight,
26680
- "Area",
26696
+ chartType,
26681
26697
  formatOptions,
26682
26698
  yLabel,
26683
26699
  yTitle,
@@ -27948,7 +27964,7 @@ const drawTotalValue = (chartFormatOptions, totalValue, chartTitleHeight, chartA
27948
27964
  }
27949
27965
  };
27950
27966
  const fileName$8 = "PieChart.tsx";
27951
- const PieChart = ({ data, formatOptions, chartId }) => {
27967
+ const PieChart = ({ data, formatOptions, chartId, isReportEditable }) => {
27952
27968
  const svgRef = useRef();
27953
27969
  const seriesData = generalizedChartData(data.ChartData);
27954
27970
  let chartFormatOptions;
@@ -28015,7 +28031,8 @@ const PieChart = ({ data, formatOptions, chartId }) => {
28015
28031
  width,
28016
28032
  height,
28017
28033
  chartAreaTagG,
28018
- Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5)
28034
+ Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5),
28035
+ isReportEditable
28019
28036
  );
28020
28037
  } else {
28021
28038
  drawPieDataLabels();
@@ -28355,7 +28372,8 @@ const fileName$7 = "DonutChart.tsx";
28355
28372
  const DonutChart = ({
28356
28373
  data,
28357
28374
  formatOptions,
28358
- chartId
28375
+ chartId,
28376
+ isReportEditable
28359
28377
  }) => {
28360
28378
  const svgRef = useRef();
28361
28379
  const seriesData = generalizedChartData(data.ChartData);
@@ -28425,7 +28443,8 @@ const DonutChart = ({
28425
28443
  width,
28426
28444
  height,
28427
28445
  chartAreaTagG,
28428
- Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5)
28446
+ Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5),
28447
+ isReportEditable
28429
28448
  );
28430
28449
  } else {
28431
28450
  drawDonutDataLabels();
@@ -53784,7 +53803,7 @@ const BubbleChart = ({
53784
53803
  let tempLegendEntries = legendEntries;
53785
53804
  maxLegendDimensions = calculateLegendsMaxPossibleWidth(
53786
53805
  chartFormatOptions,
53787
- tempLegendEntries,
53806
+ tempLegendEntries ?? [],
53788
53807
  "alias"
53789
53808
  );
53790
53809
  let convertedData = convertIncomingData(data);
@@ -53868,6 +53887,18 @@ const BubbleChart = ({
53868
53887
  drawReferenceLines();
53869
53888
  initLegendList();
53870
53889
  initCircles();
53890
+ setnumberOfBubbles(
53891
+ svg,
53892
+ chartFormatOptions.legends.legendPosition,
53893
+ chartFormatOptions,
53894
+ height,
53895
+ width,
53896
+ margins,
53897
+ innerHeight2,
53898
+ xTitle,
53899
+ xLabel,
53900
+ data.length
53901
+ );
53871
53902
  };
53872
53903
  const initCircles = () => {
53873
53904
  try {
@@ -54016,7 +54047,7 @@ const BubbleChart = ({
54016
54047
  formatOptions.xAxisLabel.xAxisLabelDecimalPrecision ?? "2"
54017
54048
  )
54018
54049
  ).tickSize(
54019
- chartFormatOptions.plotArea.gridLinesVisibility ? chartFormatOptions.plotArea.gridLinesVertical ? chartFormatOptions.xAxisLabel.xAxisPosition === "0" ? -innerHeight2 : chartFormatOptions.xAxisLabel.xAxisPosition === "1" ? innerHeight2 : 0 : 0 : 0
54050
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0)
54020
54051
  ).tickValues(autoLabelFlag ? void 0 : xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54021
54052
  initXaxis(
54022
54053
  chartAreaTagG,
@@ -54112,7 +54143,7 @@ const BubbleChart = ({
54112
54143
  };
54113
54144
  const initLegendList = () => {
54114
54145
  try {
54115
- let tempLegendEntries = legendEntries.map((d) => {
54146
+ let tempLegendEntries = legendEntries?.map((d) => {
54116
54147
  let modifiedProperties = {
54117
54148
  ...d,
54118
54149
  legendFontStyle: d.fontStyle,
@@ -54128,7 +54159,7 @@ const BubbleChart = ({
54128
54159
  initLegendListWithTotalValueAllowance(
54129
54160
  chartFormatOptions,
54130
54161
  svg,
54131
- tempLegendEntries,
54162
+ tempLegendEntries || [],
54132
54163
  width,
54133
54164
  height,
54134
54165
  maxLegendDimensions[0],
@@ -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;
@@ -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) {
@@ -20859,7 +20871,7 @@
20859
20871
  formatOptions.yAxisLabel.yAxisLabelVisibility ? formatOptions.yAxisLabel.yAxisBackgroundColor ? formatOptions.yAxisLabel.yAxisBackgroundColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisBackgroundColor : "none" : formatOptions.chartArea.chartAreaColor : formatOptions.chartArea.chartAreaColor
20860
20872
  );
20861
20873
  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");
20874
+ yAxisG.selectAll("line").style("shape-rendering", "crispEdges").attr("stroke", formatOptions.plotArea.gridLinesColor).attr("stroke-width", "0.05em");
20863
20875
  yAxisG.selectAll("text").style(
20864
20876
  "fill",
20865
20877
  formatOptions.yAxisLabel.yAxisLabelColor !== commonColors.white ? formatOptions.yAxisLabel.yAxisLabelColor : "none"
@@ -20929,11 +20941,11 @@
20929
20941
  logError$1(fileName$a, "initXaxis", error);
20930
20942
  }
20931
20943
  }
20932
- function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosition, chartType, width, height, svg, radius) {
20944
+ function pieFamilyAnnotation(d3Annotation2, chartData, formatOptions, getPiePosition, chartType, width, height, svg, radius, isReportEditable) {
20933
20945
  try {
20934
20946
  if (!formatOptions.annotation.annotationVisibility) return;
20935
20947
  const AnnotationType = formatOptions.plotArea.annotationType ?? "1";
20936
- const Disable = [AnnotationType === "1" ? "connector" : ""];
20948
+ const Disable = [AnnotationType === 1 ? "connector" : ""];
20937
20949
  const ConnectorType = formatOptions.plotArea.connectorType?.toLowerCase() ?? "none";
20938
20950
  const rotationAngle = formatOptions.plotArea.rotation ?? 0;
20939
20951
  const multiplicationFactor = chartType === chartTypes.PieChart ? 1.06 : 1.1;
@@ -21020,7 +21032,7 @@
21020
21032
  match.connector.points = oldA.connector?.points;
21021
21033
  }
21022
21034
  });
21023
- makeAnnotations.editMode(formatOptions.plotArea.annotationDraggable).accessors({
21035
+ makeAnnotations.editMode(formatOptions.plotArea.annotationDraggable && isReportEditable).accessors({
21024
21036
  x(d) {
21025
21037
  const r = radius;
21026
21038
  const a2 = d.midAngle + rotationAngle * Math.PI / 180;
@@ -22113,7 +22125,7 @@
22113
22125
  void 0,
22114
22126
  void 0,
22115
22127
  dataTableHeight,
22116
- "Line",
22128
+ chartType,
22117
22129
  formatOptions,
22118
22130
  yLabel,
22119
22131
  yTitle,
@@ -22651,7 +22663,7 @@
22651
22663
  void 0,
22652
22664
  void 0,
22653
22665
  dataTableHeight,
22654
- "Line",
22666
+ chartTypes.LineChart,
22655
22667
  formatOptions,
22656
22668
  yLabel,
22657
22669
  yTitle,
@@ -23179,7 +23191,7 @@
23179
23191
  void 0,
23180
23192
  void 0,
23181
23193
  dataTableHeight,
23182
- "Line",
23194
+ chartTypes.LineChart,
23183
23195
  formatOptions,
23184
23196
  yLabel,
23185
23197
  yTitle,
@@ -23399,28 +23411,32 @@
23399
23411
  innerWidth2,
23400
23412
  innerHeight2
23401
23413
  );
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
- );
23414
+ if (formatOptions.xAxisLabel.xAxisPosition != "1") {
23415
+ yAxistitle$1(
23416
+ innerHeight2,
23417
+ formatOptions,
23418
+ dataTableHeight,
23419
+ barChart,
23420
+ svg,
23421
+ margin,
23422
+ yTitle,
23423
+ yLabel,
23424
+ innerWidth2
23425
+ );
23426
+ }
23427
+ if (formatOptions.xAxisLabel.xAxisPosition == "1") {
23428
+ yAxistitleRight(
23429
+ svg,
23430
+ isSecondaryAxisDrawn,
23431
+ margin,
23432
+ formatOptions,
23433
+ dataTableHeight,
23434
+ innerHeight2,
23435
+ innerWidth2,
23436
+ secondaryYLabel,
23437
+ secondaryAxisTitleWidth
23438
+ );
23439
+ }
23424
23440
  setChartTitle(svg, formatOptions, width, chartTitleHeight);
23425
23441
  drawLegends(
23426
23442
  height,
@@ -26680,7 +26696,7 @@
26680
26696
  void 0,
26681
26697
  void 0,
26682
26698
  dataTableHeight,
26683
- "Area",
26699
+ chartType,
26684
26700
  formatOptions,
26685
26701
  yLabel,
26686
26702
  yTitle,
@@ -27951,7 +27967,7 @@
27951
27967
  }
27952
27968
  };
27953
27969
  const fileName$8 = "PieChart.tsx";
27954
- const PieChart = ({ data, formatOptions, chartId }) => {
27970
+ const PieChart = ({ data, formatOptions, chartId, isReportEditable }) => {
27955
27971
  const svgRef = require$$0$1.useRef();
27956
27972
  const seriesData = generalizedChartData(data.ChartData);
27957
27973
  let chartFormatOptions;
@@ -28018,7 +28034,8 @@
28018
28034
  width,
28019
28035
  height,
28020
28036
  chartAreaTagG,
28021
- Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5)
28037
+ Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5),
28038
+ isReportEditable
28022
28039
  );
28023
28040
  } else {
28024
28041
  drawPieDataLabels();
@@ -28358,7 +28375,8 @@
28358
28375
  const DonutChart = ({
28359
28376
  data,
28360
28377
  formatOptions,
28361
- chartId
28378
+ chartId,
28379
+ isReportEditable
28362
28380
  }) => {
28363
28381
  const svgRef = require$$0$1.useRef();
28364
28382
  const seriesData = generalizedChartData(data.ChartData);
@@ -28428,7 +28446,8 @@
28428
28446
  width,
28429
28447
  height,
28430
28448
  chartAreaTagG,
28431
- Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5)
28449
+ Math.min(innerHeight2 * 0.5, innerWidth2 * 0.5),
28450
+ isReportEditable
28432
28451
  );
28433
28452
  } else {
28434
28453
  drawDonutDataLabels();
@@ -53787,7 +53806,7 @@
53787
53806
  let tempLegendEntries = legendEntries;
53788
53807
  maxLegendDimensions = calculateLegendsMaxPossibleWidth(
53789
53808
  chartFormatOptions,
53790
- tempLegendEntries,
53809
+ tempLegendEntries ?? [],
53791
53810
  "alias"
53792
53811
  );
53793
53812
  let convertedData = convertIncomingData(data);
@@ -53871,6 +53890,18 @@
53871
53890
  drawReferenceLines();
53872
53891
  initLegendList();
53873
53892
  initCircles();
53893
+ setnumberOfBubbles(
53894
+ svg,
53895
+ chartFormatOptions.legends.legendPosition,
53896
+ chartFormatOptions,
53897
+ height,
53898
+ width,
53899
+ margins,
53900
+ innerHeight2,
53901
+ xTitle,
53902
+ xLabel,
53903
+ data.length
53904
+ );
53874
53905
  };
53875
53906
  const initCircles = () => {
53876
53907
  try {
@@ -54019,7 +54050,7 @@
54019
54050
  formatOptions.xAxisLabel.xAxisLabelDecimalPrecision ?? "2"
54020
54051
  )
54021
54052
  ).tickSize(
54022
- chartFormatOptions.plotArea.gridLinesVisibility ? chartFormatOptions.plotArea.gridLinesVertical ? chartFormatOptions.xAxisLabel.xAxisPosition === "0" ? -innerHeight2 : chartFormatOptions.xAxisLabel.xAxisPosition === "1" ? innerHeight2 : 0 : 0 : 0
54053
+ getVerticalGridLinesTickSize(formatOptions, innerHeight2, 0)
54023
54054
  ).tickValues(autoLabelFlag ? void 0 : xAxisLabelArray.length > 0 ? xAxisLabelArray : null).ticks(customTickValue).tickPadding(8).tickSizeOuter(0);
54024
54055
  initXaxis(
54025
54056
  chartAreaTagG,
@@ -54115,7 +54146,7 @@
54115
54146
  };
54116
54147
  const initLegendList = () => {
54117
54148
  try {
54118
- let tempLegendEntries = legendEntries.map((d) => {
54149
+ let tempLegendEntries = legendEntries?.map((d) => {
54119
54150
  let modifiedProperties = {
54120
54151
  ...d,
54121
54152
  legendFontStyle: d.fontStyle,
@@ -54131,7 +54162,7 @@
54131
54162
  initLegendListWithTotalValueAllowance(
54132
54163
  chartFormatOptions,
54133
54164
  svg,
54134
- tempLegendEntries,
54165
+ tempLegendEntries || [],
54135
54166
  width,
54136
54167
  height,
54137
54168
  maxLegendDimensions[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pace-chart-lib",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
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",