import { globalConfig } from './global';

export const buildDefaultLegend = (option) => {
  const { title } = option;

  let paddingRight = 0;
  if (title && title.show) paddingRight = 80; // 给标题留够空间

  return {
    show: true,
    right: 20,
    top: 20,
    icon: 'rect',
    itemWidth: 14,
    itemHeight: 8,
    itemGap: 20,
    padding: [0, 0, 0, paddingRight],
    textStyle: {
      padding: [0, 0, 0, 4],
      color: '#2d2d2d',
    },
  };
};
