import { isFunction } from '@antv/util';
import { jsx } from '../../jsx';
const Marker = ({ type, color }) => {
if (type === 'square') {
return (
);
}
return (
);
};
export default (props) => {
const {
items,
itemWidth,
itemFormatter,
style,
marker = 'circle', // 图例标记默认为 circle
nameStyle,
valueStyle,
valuePrefix
} = props;
const formatValue = (value, valuePrefix = ": ") => {
return `${valuePrefix}${value}`;
};
return (
{items.map((item) => {
const { color, name, value, filtered, tickValue } = item;
const valueText = isFunction(itemFormatter) ? itemFormatter(value, tickValue) : value;
return (
{ valueText ? (
) : null}
);
})}
);
};