@evergis/react 4.0.106 → 4.0.107

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.
@@ -6,6 +6,7 @@ export declare const DEFAULT_BAR_PADDING = 1;
6
6
  export declare const DEFAULT_BAR_CHART_HEIGHT = 100;
7
7
  export declare const BAR_CHART_HEADER_HEIGHT = 40;
8
8
  export declare const BAR_CHART_FOOTER_MARGIN = 16;
9
+ export declare const LINE_CHART_LABEL_MARGIN = 20;
9
10
  export declare const DEFAULT_BAR_CHART_MARGINS: {
10
11
  top: number;
11
12
  left: number;
package/dist/index.js CHANGED
@@ -8313,6 +8313,7 @@ const DEFAULT_BAR_PADDING = 1;
8313
8313
  const DEFAULT_BAR_CHART_HEIGHT = 100;
8314
8314
  const BAR_CHART_HEADER_HEIGHT = 40;
8315
8315
  const BAR_CHART_FOOTER_MARGIN = 16;
8316
+ const LINE_CHART_LABEL_MARGIN = 20;
8316
8317
  const DEFAULT_BAR_CHART_MARGINS = {
8317
8318
  top: 0,
8318
8319
  left: 0,
@@ -14378,11 +14379,17 @@ const Chart = React.memo(({ config, element, elementConfig, type, renderElement
14378
14379
  .flat()
14379
14380
  .map(({ values }) => values)
14380
14381
  .flat();
14382
+ // Резервируем нижнюю полосу под подписи оси X: без неё ось прижата к нижней границе,
14383
+ // подписи (сдвинутые на +16px) вылезают за тело и режутся overflow: hidden у ChartFillMeasure.
14384
+ const lineMargin = {
14385
+ ...margin,
14386
+ bottom: Math.max(margin.bottom, LINE_CHART_LABEL_MARGIN),
14387
+ };
14381
14388
  return (jsxRuntime.jsxs(AnyChartWrapper, { height: chartHeight, children: [jsxRuntime.jsx(LineChartStyles, {}), jsxRuntime.jsx(charts.LineChart, { data: lineChartData, labels: labels, markers: markers, width: chartWidth, height: chartHeight, xAxisPadding: 15, yAxisPadding: 0, min: Math.min(...chartValues), customYAxisSelection: yAxis => {
14382
14389
  if (isHidedY) {
14383
14390
  yAxis.remove();
14384
14391
  }
14385
- }, customYAxis: yAxis => yAxis.ticks(4), renderTooltip: renderLineChartTooltip, customize: customize, dotSnapping: dotSnapping, dynamicTooltipEnable: true, stackedTooltip: true, tooltipClassName: "dashboardLineChartTooltip", drawGridX: !isHidedY, margin: margin })] }));
14392
+ }, customYAxis: yAxis => yAxis.ticks(4), renderTooltip: renderLineChartTooltip, customize: customize, dotSnapping: dotSnapping, dynamicTooltipEnable: true, stackedTooltip: true, tooltipClassName: "dashboardLineChartTooltip", drawGridX: !isHidedY, margin: lineMargin })] }));
14386
14393
  }
14387
14394
  if (isStackBar) {
14388
14395
  // Вне fill chartHeight — высота самой полосы, и обёртка честно становится выше на строку
@@ -14409,8 +14416,9 @@ const Chart = React.memo(({ config, element, elementConfig, type, renderElement
14409
14416
  ? chartHeight - margin.bottom - BAR_CHART_FOOTER_MARGIN
14410
14417
  : chartHeight;
14411
14418
  return (jsxRuntime.jsx(BarChartWrapper, { height: barBodyHeight + margin.bottom, children: jsxRuntime.jsx(BarChartContainer, { children: jsxRuntime.jsx(StyledBarChart, { data: barChartData, colors: getColorsFromFilterItems(data[0]?.items, defaultColor, formatFilterColor), minValue: getMinValueFromFilterItems(data[0]?.items), markers: markers, width: chartWidth, height: barBodyHeight, barWidth: barWidth, barPadding: padding, customYAxisLeft: customYAxisLeft, customXAxisBottom: xAxisBottom => customXAxisBottom(xAxisBottom, barChartData), customYAxis: axis => !showLabels && axis.remove(), customBars: ({ bars }) => {
14412
- bars.attr("rx", radius);
14413
- bars.attr("ry", radius);
14419
+ const barRadius = options?.cornerRadius ?? DEFAULT_BARCHART_RADIUS;
14420
+ bars.attr("rx", barRadius);
14421
+ bars.attr("ry", barRadius);
14414
14422
  }, margin: margin, xAxisPadding: 0, yAxisPadding: 0, formatTooltipValue: formatTooltipValue, formatTooltipName: formatTooltipName, hideTooltipGroupName: true, dynamicTooltipEnable: true, isBarTooltip: true, onBarClick: filterName ? item => onFilter(item.name) : undefined }) }) }));
14415
14423
  }, [
14416
14424
  customXAxisBottom,