import {
    Chart,
    Interval,
    Legend
} from '@antv/f2';

import {
    jsx as _jsx
} from "@antv/f2/jsx-runtime";
import {
    jsxs as _jsxs
} from "@antv/f2/jsx-runtime";

export default (({
    data
}) => {
    return _jsxs(Chart, {
        data,
        coord: {
            transposed: true
        },
        scale: {
            percent: {
                min: 0,
            },
            action: {
                range: [1, 0],
            },
        },
        children: [
            _jsx(Interval, {
                x: "action",
                y: "percent",
                adjust: "symmetric",
                shape: "funnel",
                color: {
                    field: 'action',
                    range: ['#6E94F3', '#6CD2A1', '#687695', '#ECB937', '#7367F2', '#5FB3E3'],
                },
                style: {
                    stroke: '#fff',
                    lineWidth: 2,
                },
                showLabel: true,
                labelCfg: {
                    offsetX: 0,
                    guide: (data) => {
                        return {
                            text: data.action,
                            fill: '#fff',
                        };
                    },
                }
            }),
            _jsx(Legend, {}),
        ]
    });
});