option = { title: { // text: '热源实时流量', textStyle: { align: 'center', color: '#fff', fontSize: 20, }, top: '3%', left: '10%', }, backgroundColor: '#0B1346', grid: { top: "25%", bottom: "10%"//也可设置left和right设置距离来控制图表的大小 }, tooltip: { trigger: "axis", axisPointer: { type: "shadow", label: { show: false, //X轴的 } } }, legend: { data: ["库存", "需求"], top: "15%", textStyle: { color: "#ffffff" } }, xAxis: { data: [ "C15喷射", "C25组", "C36水泵送", "C85补偿收缩" ], // axisLine: { // show: true, //隐藏X轴轴线 // lineStyle: { // color: '#30538A' // } // }, axisLine: { show: true, symbol: ['none', 'arrow'], lineStyle: { color: '#CBDDF4' } }, axisTick: { show: true //隐藏X轴刻度 }, axisLabel: { show: true, rotate: 45, textStyle: { color: "#CBDDF4" //X轴文字颜色 } }, }, yAxis: [ { type: "value", // name: "榀", // nameTextStyle: { // color: "#BADBFB", // fontSize:15 // }, splitLine: { show: true }, axisTick: { show: false }, axisLine: { show: true, symbol: ['none', 'arrow'], lineStyle: { color: '#CBDDF4' } }, axisLabel: { show: true, textStyle: { color: "#BADBFB" }, formatter: function (value) { // 在标签后面添加百分号 return value + '11榀'; }, }, }, ], series: [{ name: "库存", type: "bar", // yAxisIndex: 1, // barGap:'100%', barWidth: 15,//使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用 smooth: true, //平滑曲线显示 showAllSymbol: true, //显示所有图形。 symbol: "circle", //标记的图形为实心圆 // color: '#FF8247', itemStyle: { normal: { color:"#6392F4" }, }, data: [1,2,3,2] }, { name: "需求", type: "line", barWidth: 15, showSymbol: true, symbolSize: 10, itemStyle: { normal: { color: "#80BD95", }, }, data: [4141, 4,4,4] } ] };