日历热力图

描述:当前是关于Echarts图表中的 热力图 示例。
 
            var chartData = [
   [
      "2023-06-01",
      3
   ],
   [
      "2023-06-02",
      3
   ],
   [
      "2023-06-03",
      3
   ],
   [
      "2023-06-04",
      3
   ],
   [
      "2023-06-05",
      3
   ],
   [
      "2023-06-06",
      3
   ],
   [
      "2023-06-07",
      3
   ],
   [
      "2023-06-08",
      3
   ],
   [
      "2023-06-09",
      3
   ],
   [
      "2023-06-10",
      3
   ],
   [
      "2023-06-11",
      3
   ],
   [
      "2023-06-12",
      3
   ],
   [
      "2023-06-13",
      3
   ],
   [
      "2023-06-14",
      4
   ],
   [
      "2023-06-15",
      4
   ],
   [
      "2023-06-16",
      4
   ],
   [
      "2023-06-17",
      4
   ],
   [
      "2023-06-18",
      3
   ],
   [
      "2023-06-19",
      3
   ],
   [
      "2023-06-20",
      3
   ],
   [
      "2023-06-21",
      3
   ],
   [
      "2023-06-22",
      3
   ],
   [
      "2023-06-23",
      3
   ],
   [
      "2023-06-24",
      3
   ],
   [
      "2023-06-25",
      3
   ],
   [
      "2023-06-26",
      3
   ],
   [
      "2023-06-27",
      3
   ],
   [
      "2023-06-28",
      3
   ],
   [
      "2023-06-29",
      3
   ],
   [
      "2023-06-30",
      3
   ],
]
option = {
   //你的代码

   tooltip: {
      backgroundColor: '#3A5B90',
      textStyle: {
         color: '#A7E4FD',
         fontSize: 18
      },
      formatter: function (params) {
         console.log(params);
         return params.value[0] + ':' + params.value[1];
         // return '入场车辆数: ' + params.value[1];
      },
   },
   calendar: [
      {
         "left": "10%",
         "right": "10%",
         "range": '2023-06',
         // "yearLabel": {
         //    "show": true
         // },
         orient: 'vertical',
         "dayLabel": {
            show: true,
            "firstDay": 1,
            "color": "#333",
            "nameMap": "cn"
         },
         splitLine: {
            show: false,
            lineStyle: {
            }
         },
         itemStyle: {
            borderColor: '#000',
         },
         cellSize: [40, 40],
         "monthLabel": {
            "color": "#333",
            "nameMap": "cn"
         }
      },
   ],
   grid: {
      "left": "5%",
      "right": "5%",
      "bottom": "5%",
      "top": 0,
      "containLabel": true
   },
   visualMap: {
      type: 'piecewise',
      "show": false,
      "calculable": true,
      "orient": "horizontal",
      "left": "center",
      "top": "top",
      "textStyle": {
         "color": "#333",
         "fontSize": 14
      },
      "categories": [
         "0",
         "1",
         "2",
         "3",
         "4",
         "5",
         "6"
      ],
      "inRange": {
         "color": [
            "#FFFFFF",
            "#CCFFFF",
            "#00CCFF",
            "#00FF00",
            "#FFFF00",
            "#FF9B00",
            "#FF0000"
         ]
      }
   },
   series: [
      {
         type: 'scatter',
         coordinateSystem: 'calendar',
         symbolSize: 1,
         label: {
            normal: {
               show: true,
               formatter: function (params) {
                  var d = echarts.number.parseDate(params.value[0]);
                  return d.getDate();
               },
               textStyle: {
                  color: '#000',
                  fontSize: 14,
                  textShadowColor: '#0B1131',
                  textShadowBlur: 0,
                  textShadowOffsetX: 1,
                  textShadowOffsetY: 1
               },
            },
         },
         data: chartData,
      },
      {
         "type": "heatmap",
         "coordinateSystem": "calendar",
         "calendarIndex": 0,
         "data": chartData,
         "label": {
            "normal": {
               "show": false,
               "textStyle": {
                  "color": "#333",
                  "fontSize": 12
               }
            }
         }
      },
   ]
};