import { LineType, state } from "../enum";

interface comKeys {
  [key: string]: any;
}

interface comObj extends comKeys {
  /** 颜色组 */
  colorData: string[];
  /** 图表背景颜色 */
  backgroundColor: string;
  /** 是否显示x轴分割线 */
  splitLine_x_show: state;
  /** x轴分割线颜色 */
  splitLine_x_color: string;
  /** x轴分割线宽度 */
  splitLine_x_width: number;
  /** x轴分割线类型 */
  splitLine_x_type: LineType;
  /** 是否显示y轴分割线 */
  splitLine_y_show: state;
  /** y轴分割线颜色 */
  splitLine_y_color: string;
  /** y轴分割线宽度 */
  splitLine_y_width: number;
  /** y轴分割线类型 */
  splitLine_y_type: LineType;
  /** 图表位置 */
  grid: any;
  /** 字体颜色 */
  fontColor: string;
  /** 标签 */
  label: any;
  /** x轴坐标名称 */
  xAxisName: string[];
  /** 提示框 */
  tooltip: any;
  /** 图例 */
  legend: any;
}

/** 公共配置 */
export const com: comObj = {
  colorData: ["#000000", "#FA255E"],
  backgroundColor: "#FFF",
  splitLine_x_show: state.hide,
  splitLine_x_color: "#FA255E",
  splitLine_x_width: 1,
  splitLine_x_type: LineType.solid,
  splitLine_y_show: state.show,
  splitLine_y_color: "#87c4e1",
  splitLine_y_width: 1,
  splitLine_y_type: LineType.solid,
  grid: {
    left: "10%",
    right: "10%",
    bottom: "10%",
    top: "15%",
    containLabel: true,
  },
  fontColor: "#000000",
  label: { show: true },
  xAxisName: ["one", "two", "three", "four", "five", "six", "seven"],
  assist_color: ["#425468"],
  tooltip: {
    trigger: "axis",
  },
  legend: {
    show: true,
    top: "5%",
  },
};
