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