• echart双柱状图


    1.效果
    在这里插入图片描述
    2.代码

    const option = {
    		baseOption: {
    			// backgroundColor: '#0e2147',
    			timeline: {
    				show: false,
    			},
    			color: ['#f14f75', '#2c7efa'],
    			title: {
    				text: `自动派单使用情况分析`,
    				textStyle: {
    					rich: {
    						a: {
    							fontSize: 16,
    							fontWeight: 600,
    						},
    					},
    				},
    				subtext: "2023~2024",
    				top: '3%',
    				left: 'center',
    				itemGap: 20,
    				subtextStyle: {
    					color: "#6C7B8A",
    					fontSize: 16,
    					fontWeight: 600,
    				},
    			},
    			tooltip: {
    				show: true,
    				trigger: 'axis',
    				//formatter: '{b}
    {a}: {c}人',
    axisPointer: { type: 'shadow', }, }, grid: [ { show: false, left: '0%', top: 160, bottom: 60, containLabel: true, width: '45%', }, { show: false, left: '50.5%', top: 160, bottom: 60, width: '0', }, { show: false, left: '50.5%', top: 180, bottom: 40, width: '0', }, { show: false, right: '0%', top: 160, bottom: 60, containLabel: true, width: '45%', }, ], xAxis: [ { max: function (value) { return value.max * 2 - 20; }, type: 'value', triggerEvent: true, inverse: true, axisLine: { show: false, }, axisTick: { show: false, }, position: 'top', axisLabel: { show: false, }, splitLine: { show: false, }, }, { gridIndex: 1, show: false, }, { gridIndex: 2, show: false, }, { max: function (value) { return value.max * 2 - 20; }, gridIndex: 3, type: 'value', axisLine: { show: false, }, axisTick: { show: false, }, position: 'top', axisLabel: { show: false, }, splitLine: { show: false, }, }, ], yAxis: [ { type: 'category', name: 'WEB端', nameLocation: 'start', inverse: true, position: 'right', axisLine: { show: false, }, axisTick: { show: false, }, nameTextStyle: { fontSize: 12, fontWeight: 600, }, axisLabel: { show: false, margin: 8, textStyle: { // color: '#fff', fontSize: 12, }, }, data: ['勘测-待确认', '勘测-待勘察', '勘察-勘察中', '安装-安装中', '安装-待确认', '安装-待确认', '安装-待确认'], }, { gridIndex: 1,//中间显示显示数据!!!! type: 'category', name: '阶段名称', nameLocation: 'start', inverse: true, position: 'left', axisLine: { show: false, }, nameTextStyle: { fontSize: 12, fontWeight: 600, }, axisTick: { show: false, }, axisLabel: { show: true, textStyle: { // color: '#ffffff', fontSize: 13, }, }, data: ['勘测-待确认', '勘测-待勘察', '勘察-勘察中', '安装-安装中', '安装-待确认', '安装-待确认', '安装-待确认'].map(function (value) { return { value: value, textStyle: { align: 'center', }, }; }), }, { gridIndex: 2,//中间显示显示总量!!! type: 'category', nameLocation: 'start', inverse: true, position: 'left', axisLine: { show: false, }, nameTextStyle: { fontSize: 12, fontWeight: 600, }, axisTick: { show: false, }, axisLabel: { show: true, textStyle: { // color: '#ffffff', fontSize: 13, }, }, data: [100, 500, 600, 700, 800, 900, 1000].map(function (value) { return { value: value, textStyle: { align: 'center', }, }; }), }, { gridIndex: 3, type: 'category', name: 'APP端', nameLocation: 'start', inverse: true, position: 'left', nameTextStyle: { fontSize: 12, fontWeight: 600, }, axisLine: { show: false, }, axisTick: { show: false, }, axisLabel: { show: false, }, data: ['勘测-待确认', '勘测-待勘察', '勘察-勘察中', '安装-安装中', '安装-待确认', '安装-待确认', '安装-待确认'], }, ], series: [ { name: 'WEB端', type: 'bar', stack: 'one', barGap: 15, barWidth: 30, label: { normal: { show: true, position: 'insideLeft', textStyle: { color: '#fff', fontSize: 12, }, }, emphasis: { show: true, position: 'left', offset: [0, 0], textStyle: { color: '#F76B1C', fontSize: 14, fontWeight: 600, }, }, }, itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ offset: 0, color: '#F76B1C' }, { offset: 1, color: '#FAD961' } ]), barBorderRadius: 4, }, emphasis: { opacity: 1, }, }, data: [389, 259, 262, 324, 232, 176, 196], }, { name: 'APP端', stack: 'right', type: 'bar', barGap: 15, barWidth: 30, xAxisIndex: 3, yAxisIndex: 3, label: { normal: { show: true, position: 'insideRight', textStyle: { color: '#fff', fontSize: 12, }, }, emphasis: { show: true, position: 'right', offset: [0, 0], textStyle: { color: '#1171C9', fontSize: 14, fontWeight: 600, }, }, }, itemStyle: { normal: { color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{ offset: 1, color: '#1171C9' }, { offset: 0, color: '#61C4FA' } ]), barBorderRadius: 4, }, emphasis: { opacity: 1, }, }, data: [389, 259, 262, 324, 232, 176, 196], }, ], }, };
    • 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
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
  • 相关阅读:
    网贷大数据黑名单要多久才能变正常?
    【面试经典150 | 哈希表】有效的字母异位词
    Networkx绘图和常用库函数坐标绘图
    17:00面试,17:04就出来了 ,问的实在是太...
    【Redis实战】有MQ为啥不用?用Redis作消息队列!?Redis作消息队列使用方法及底层原理高级进阶
    Web网页实现多路播放RTSP视频流(使用WebRTC)
    机器视觉技术的演进:YOLO系列与Halcon的深度对比
    Real-Time Rendering——8.2.3 Color Grading颜色分级
    javafx简单介绍
    Java版工程行业管理系统源码-专业的工程管理软件-提供一站式服务
  • 原文地址:https://blog.csdn.net/weixin_44705979/article/details/133750876