UNPKG

@lobehub/charts

Version:

React modern charts components built on recharts

27 lines 930 B
import { cssVar } from 'antd-style'; import React, { memo } from 'react'; import { jsx as _jsx } from "react/jsx-runtime"; var CustomYAxisTick = /*#__PURE__*/memo(function (_ref) { var yAxisLabel = _ref.yAxisLabel, x = _ref.x, y = _ref.y, payload = _ref.payload, align = _ref.align, formatter = _ref.formatter, anchor = _ref.anchor; var yAxisLabelWidth = yAxisLabel ? 24 : 0; var resolvedTextAnchor = anchor !== null && anchor !== void 0 ? anchor : align === 'left' ? 'start' : 'end'; return /*#__PURE__*/_jsx("g", { transform: "translate(".concat(align === 'left' ? yAxisLabelWidth : x + yAxisLabelWidth, ",").concat(y, ")"), children: /*#__PURE__*/_jsx("text", { dy: 4, fill: cssVar.colorTextDescription, fontSize: 12, textAnchor: resolvedTextAnchor, x: 0, y: 0, children: formatter(payload.value) }) }); }); export default CustomYAxisTick;