


const getCalendarHeatChart = (data) => {
  const option = {
    title: {
      top: 30,
      left: 'center',
      text: `日历热力图`,
      show: false
    },
    tooltip: {
      position: 'top',
      formatter: function (params) {
        const date = new Date(params.data[0]);
        return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')}<br/>数值: ${params.data[1]}`;
      }
    },
    visualMap: {
      show: false,
      min: 0,
      max: 20,
      calculable: true,
      orient: 'horizontal',
      left: 'center',
      top: 65,
      inRange: {
        color: ['rgb(231, 243, 255)', 'rgb(137, 193, 255)', 'rgb(5, 95, 194)']
      },
      textStyle: {
        color: 'rgba(95, 101, 108, 1)'
      }
    },
    calendar: {
      top: 24,
      left: 30,
      right: 30,
      cellSize: ['auto', 20],
      range: '2026',
      splitLine: {
        show:false
      },
      itemStyle: {
        borderWidth: 0.5,
        borderColor: '#ccc'
      },
      yearLabel: { show: true },
      monthLabel: {
        nameMap: 'cn'
      },
      dayLabel: {
        nameMap: ['日', '一', '二', '三', '四', '五', '六'],
        show: false,
        
      }
    },
    series: {
      type: 'heatmap',
      coordinateSystem: 'calendar',
      data: data
    }
  };
  return option
}

export default getCalendarHeatChart