UNPKG

@lobehub/charts

Version:

React modern charts components built on recharts

26 lines 836 B
import { useTheme } 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; var theme = useTheme(); var yAxisLabelWidth = yAxisLabel ? 24 : 0; return /*#__PURE__*/_jsx("g", { transform: "translate(".concat(align === 'left' ? yAxisLabelWidth : x + yAxisLabelWidth, ",").concat(y, ")"), children: /*#__PURE__*/_jsx("text", { dy: 4, fill: theme.colorTextDescription, fontSize: 12, textAnchor: align === 'left' ? 'start' : 'end', x: 0, y: 0, children: formatter(payload.value) }) }); }); export default CustomYAxisTick;