1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
   | <div id="chart" style="width: 100%; height: 400px"></div> <script>   let chartsInstance = ECharts.init(document.getElementById("chart"));   let option = {     legend: {       show: true,        data: [{ name: "成本" }, { name: "收入" }],       bottom: "0%",       right: "0%",     },     tooltip: {       show: true,      },     grid: {       left: "20%",       top: "20%",       right: "0%",       bottom: "0%",       containLabel: true,      },     xAxis: {       show: true,        boundaryGap: true,        type: "category",       data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],       axisPointer: {         show: true,          type: "shadow",          label: {           show: true,                     },         lineStyle: {                    },         shadowStyle: {                    },       },       axisLine: {         show: true,          lineStyle: {           color: "yellow",            width: 3,            opacity: 0.5,            type: "dashed",          },       },       axisTick: {         show: true,          alignWithLabel: true,          inside: false,          length: 10,          lineStyle: {           color: "green",            width: 5,            opacity: 1,            type: "solid",          },       },       axisLabel: {         show: true,          color: "gold",          fontSize: 16,          rotate: 45,          formatter: (value, index) => `${value}-d${index}`,       },       splitLine: {         show: true,          lineStyle: {           color: "white",            width: 1,            opacity: 1,            type: "dashed",          },       },       splitArea: {         show: true,          areaStyle: {           color: ["red", "green", "blue"],           opacity: 0.1,         },       },     },     yAxis: {       type: "value",       show: true,        axisPointer: {         show: true,          type: "line",          label: {           show: true,                     },         lineStyle: {                    },         shadowStyle: {                    },       },       axisLine: {         show: true,          lineStyle: {           color: "blue",            width: 3,            opacity: 0.5,            type: "dotted",          },       },       axisTick: {         show: true,          alignWithLabel: true,          inside: false,          length: 10,          lineStyle: {           color: "orange",            width: 5,            opacity: 1,            type: "solid",          },       },       axisLabel: {         show: true,          color: "black",          fontSize: 14,          rotate: 45,          formatter: (value, index) => `${value}-i${index}`,       },       splitLine: {         show: true,          lineStyle: {           color: "black",            width: 2,            opacity: 1,            type: "dotted",          },       },       splitArea: {         show: true,          areaStyle: {           color: ["black", "white"],           opacity: 0.2,         },       },     },     series: [       {         name: "成本",          data: [120, 200, 150, 80, 70, 110, 130],         type: "bar",         label: {           show: true,            position: "inside",           color: "#ddd",            fontSize: 20,            fontWeight: "normal",         },         itemStyle: {           color: "cyan",            opacity: 0.8,         },       },       {         name: "收入",          data: [34, 231, 45, 23, 68, 34, 65],         type: "line",         label: {           show: true,            position: "outside",           color: "green",            fontSize: 14,            fontWeight: "bold",         },         itemStyle: {                      color: "yellow",           opacity: 1,         },         lineStyle: {                      color: "red",           opacity: 0.6,         },         areaStyle: {                      color: "orange",           opacity: 0.5,         },       },     ],   };   chartsInstance.setOption(option); </script>
   |