import { getComVal } from "../echart-method";

/**
 * 漏斗图
 */
export class Hooper {
  /**
   * 漏斗图0
   * @returns 漏斗图0配置项
   */
  static hopper0() {
    const option = {
      color: getComVal("color_data"),
      backgroundColor: getComVal("backgroundColor"),
      grid: getComVal("grid"),
      tooltip: getComVal("tooltip"),
      legend: getComVal("legend"),

      series: [
        {
          name: "Funnel",
          type: "funnel",
          left: "10%",
          top: 60,
          bottom: 60,
          width: "80%",
          min: 0,
          max: 100,
          minSize: "0%",
          maxSize: "100%",
          sort: "descending",
          gap: 2,
          label: {
            show: true,
            position: "inside",
          },
          labelLine: {
            length: 10,
            lineStyle: {
              width: 1,
              type: "solid",
            },
          },
          itemStyle: {
            borderColor: "#fff",
            borderWidth: 1,
          },
          emphasis: {
            label: {
              fontSize: 20,
            },
          },
          data: [
            { value: 40, name: "Visit" },
            { value: 50, name: "Inquiry" },
            { value: 60, name: "Order" },
            { value: 80, name: "Click" },
            { value: 100, name: "Show" },
          ],
        },
      ],
    };
    return option;
  }
}
