kd-curve-v2 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/USAGE.md +1571 -0
  2. package/dist/index.js +21822 -0
  3. package/dist/style.css +12 -0
  4. package/package.json +46 -0
package/USAGE.md ADDED
@@ -0,0 +1,1571 @@
1
+ # kd-lane-chart-container 使用手册
2
+
3
+ ## 1. 项目介绍
4
+
5
+ kd-lane-chart-container 是一个功能强大的井深-时间曲线图表容器,主要用于石油钻探领域的数据可视化。它提供了丰富的配置选项和交互功能,支持实时数据展示、多主题切换、岩性显示等功能。
6
+
7
+ ### 主要特点
8
+
9
+ - 支持井深和时间两种曲线类型
10
+ - 实时数据和历史数据切换
11
+ - 多主题支持(白色、深色、灰色)
12
+ - 自定义工具栏配置
13
+ - 参数面板显示
14
+ - 井深-钻头-时间曲线面板
15
+ - 岩性显示和自定义tooltip
16
+ - 滚动加载数据
17
+ - 导出功能
18
+
19
+ ## 2. 安装与配置
20
+
21
+ ### 2.1 环境要求
22
+
23
+ - Vue 2.x
24
+ - ECharts
25
+ - SCSS
26
+
27
+ ### 2.2 安装依赖
28
+
29
+ ```bash
30
+ # 安装项目依赖
31
+ npm install
32
+
33
+ # 启动开发服务器
34
+ npm run serve
35
+
36
+ # 构建生产版本
37
+ npm run build
38
+ ```
39
+
40
+ ### 2.3 项目结构
41
+
42
+ ```
43
+ kd-lane-chart-container/
44
+ ├── src/
45
+ │ ├── App.vue # 主应用组件
46
+ │ ├── components/ # 组件目录
47
+ │ │ ├── frame-layout/ # 框架布局组件
48
+ │ │ ├── resizeEcharts/ # 自适应ECharts组件
49
+ │ │ └── util/ # 工具函数
50
+ │ ├── mock/ # 模拟数据
51
+ │ │ ├── convertedData.json
52
+ │ │ └── testData.js
53
+ │ └── styles/ # 样式文件
54
+ │ └── theme/ # 主题样式
55
+ └── public/ # 静态资源
56
+ ```
57
+
58
+ ## 3. 主要功能说明
59
+
60
+ ### 3.1 主题切换
61
+
62
+ 应用支持三种主题模式:白色、深色和灰色。主题切换会影响整个应用的视觉效果,包括图表颜色、背景色等。
63
+
64
+ ### 3.2 曲线类型切换
65
+
66
+ 支持两种曲线类型:
67
+
68
+ - 时间曲线(time):以时间为横轴
69
+ - 井深曲线(depth):以井深为横轴
70
+
71
+ ### 3.3 数据类型切换
72
+
73
+ 支持两种数据类型:
74
+
75
+ - 实时数据(real):通过定时器模拟实时数据更新
76
+ - 历史数据(history):静态历史数据展示
77
+
78
+ ### 3.4 工具栏功能
79
+
80
+ 工具栏提供以下功能:
81
+
82
+ - 曲线类型切换
83
+ - 数据类型切换
84
+ - 显示类型切换(表头/悬浮)
85
+ - 比例尺调整
86
+ - 时间范围选择
87
+ - 井深范围选择
88
+ - 预警定位
89
+ - 刷新
90
+ - 导出
91
+
92
+ ### 3.5 参数面板
93
+
94
+ 参数面板显示各种实时监测参数,如出口流量、温度、压力等。
95
+
96
+ ### 3.6 井深-钻头-时间曲线面板
97
+
98
+ 展示钻头位置与井深的关系,支持不同模式切换。
99
+
100
+ ### 3.7 岩性显示
101
+
102
+ 根据井深显示不同的岩性信息,包括砂岩、泥岩、粉砂岩等。
103
+
104
+ ### 3.8 数据滚动加载
105
+
106
+ 支持触顶和触底时自动加载更多数据。
107
+
108
+ ### 3.9 导出功能
109
+
110
+ 支持数据导出功能。
111
+
112
+ ## 4. 组件结构
113
+
114
+ ### 4.1 主组件
115
+
116
+ `App.vue` 是应用的主组件,包含以下核心部分:
117
+
118
+ - **模板部分**:使用 `frameLayout` 组件作为主要布局容器,包含表头槽位和内容槽位
119
+ - **脚本部分**:包含数据定义、生命周期钩子和方法
120
+ - **样式部分**:定义应用的全局样式
121
+
122
+ ### 4.2 核心组件
123
+
124
+ 1. **frameLayout**:框架布局组件,负责整体布局和事件处理
125
+ 2. **resizeEcharts**:自适应ECharts组件,用于岩性显示等图表
126
+
127
+ ## 5. 配置选项
128
+
129
+ ### 5.1 主题配置
130
+
131
+ ```javascript
132
+ themeName: "dark" // 可选值: "white", "dark", "gray"
133
+ ```
134
+
135
+ ### 5.2 井深配置
136
+
137
+ ```javascript
138
+ depthConfig: {
139
+ type: "local",
140
+ caseId: "depth",
141
+ versionCode: 5,
142
+ dataSource: {
143
+ templates: [
144
+ {
145
+ templateName: "井深",
146
+ lanes: [
147
+ {
148
+ laneName: "井深",
149
+ laneKey: "depth",
150
+ createUser: "SYSTEM_USER",
151
+ sort: 1,
152
+ },
153
+ {
154
+ laneName: "地层",
155
+ laneKey: "formation",
156
+ contentKey: "formation",
157
+ createUser: "SYSTEM_USER",
158
+ sort: 1,
159
+ },
160
+ {
161
+ sort: 2,
162
+ lines: [
163
+ {
164
+ paramId: "8008",
165
+ lineSort: 1,
166
+ min: 0,
167
+ max: 35,
168
+ lineSize: "1.5",
169
+ lineType: "solid",
170
+ isUsed: "1",
171
+ isGradient: false,
172
+ symbol: "none",
173
+ symbolSize: 0,
174
+ themeConfig: {
175
+ white: { lineColor: "#278FE6" },
176
+ dark: { lineColor: "#7EA7FF" },
177
+ gray: { lineColor: "#1C74BE" },
178
+ },
179
+ },
180
+ // 更多曲线配置...
181
+ ],
182
+ },
183
+ // 更多车道配置...
184
+ ],
185
+ },
186
+ ],
187
+ params: [
188
+ { paramId: "depth", paramName: "井深", paramUnit: "m" },
189
+ { paramId: "8008", paramName: "大钩高度", paramUnit: "m" },
190
+ // 更多参数配置...
191
+ ]
192
+ }
193
+ }
194
+ ```
195
+
196
+ ### 5.3 时间配置
197
+
198
+ ```javascript
199
+ timeConfig: {
200
+ type: "local",
201
+ caseId: "timestamp",
202
+ versionCode: 3,
203
+ dataSource: {
204
+ templates: [
205
+ {
206
+ templateName: "时间",
207
+ lanes: [
208
+ {
209
+ laneName: "时间",
210
+ laneKey: "timestamp",
211
+ createUser: "SYSTEM_USER",
212
+ sort: 1,
213
+ },
214
+ {
215
+ sort: 2,
216
+ lines: [
217
+ {
218
+ paramId: "8008",
219
+ lineSort: 1,
220
+ min: 0,
221
+ max: 35,
222
+ lineSize: "1.5",
223
+ lineType: "solid",
224
+ isUsed: "1",
225
+ isGradient: false,
226
+ symbol: "none",
227
+ symbolSize: 0,
228
+ themeConfig: {
229
+ white: { lineColor: "#278FE6" },
230
+ dark: { lineColor: "#7EA7FF" },
231
+ gray: { lineColor: "#1C74BE" },
232
+ },
233
+ },
234
+ // 更多曲线配置...
235
+ ],
236
+ },
237
+ // 更多车道配置...
238
+ ],
239
+ },
240
+ ],
241
+ params: [
242
+ { paramId: "depth", paramName: "井深", paramUnit: "m" },
243
+ { paramId: "8008", paramName: "大钩高度", paramUnit: "m" },
244
+ // 更多参数配置...
245
+ ]
246
+ }
247
+ }
248
+ ```
249
+
250
+ ### 5.4 工具栏配置
251
+
252
+ ```javascript
253
+ toolBarConfig: {
254
+ show: true,
255
+ width: 120,
256
+ dataTypeList: {
257
+ history: "history",
258
+ real: "real"
259
+ },
260
+ axisTypeList: {
261
+ time: "timestamp",
262
+ depth: "depth"
263
+ },
264
+ timeRangeList: [
265
+ { label: "5min", value: 5 },
266
+ { label: "10min", value: 10 },
267
+ { label: "30min", value: 30 },
268
+ { label: "1h", value: 60 },
269
+ { label: "12h", value: 720 },
270
+ { label: "24h", value: 1440 },
271
+ ],
272
+ depthRangeList: [
273
+ { label: "1000m", value: 1000 },
274
+ { label: "2000m", value: 2000 },
275
+ { label: "3000m", value: 3000 },
276
+ { label: "4000m", value: 4000 },
277
+ { label: "5000m", value: 5000 },
278
+ { label: "10000m", value: 10000 },
279
+ ],
280
+ scaleList: [
281
+ { label: "1:100", value: 1 },
282
+ { label: "1:200", value: 2 },
283
+ { label: "1:500", value: 5 },
284
+ { label: "1:1000", value: 10 },
285
+ { label: "10:2000", value: 20 },
286
+ ],
287
+ timeRangeBtnShow: true,
288
+ depthRangeBtnShow: true,
289
+ alertBtnShow: true,
290
+ refreshBtnShow: true,
291
+ exportBtnShow: true,
292
+ form: {
293
+ axisType: "time", // 曲线类型
294
+ dataType: "real", // 数据类型
295
+ displayType: "float", // 显示类型
296
+ scale: 5, // 比例尺
297
+ timeRange: 10, // 时间范围
298
+ depthRange: 1000 // 井深范围
299
+ }
300
+ }
301
+ ```
302
+
303
+ ### 5.5 参数面板配置
304
+
305
+ ```javascript
306
+ parameterPanelConfig: {
307
+ show: true,
308
+ columns: 1, // 设置单行显示个数
309
+ width: 140,
310
+ data: [
311
+ { label: "出口流量(L/s)", value: 231.7 },
312
+ { label: "入口温度(℃)", value: 12.3 },
313
+ { label: "出口温度(℃)", value: 20.2 },
314
+ { label: "入口电导率(S/m)", value: 12.7 },
315
+ { label: "出口电导率(S/m)", value: 53.1 },
316
+ { label: "旋转时间(s)", value: 1231.9 },
317
+ { label: "入口压力(kPa)", value: 101.3 },
318
+ { label: "出口压力(kPa)", value: 98.6 },
319
+ { label: "流速(m/s)", value: 3.25 },
320
+ { label: "管道直径(mm)", value: 250 },
321
+ { label: "液位高度(m)", value: 12.8 },
322
+ { label: "泵转速(r/min)", value: 1450 },
323
+ { label: "电机功率(kW)", value: 75 },
324
+ { label: "系统效率(%)", value: 87.5 },
325
+ { label: "累计运行时间(h)", value: 5320 },
326
+ { label: "瞬时能耗(kWh)", value: 18.6 },
327
+ ]
328
+ }
329
+ ```
330
+
331
+ ### 5.6 井深-钻头-时间曲线面板配置
332
+
333
+ ```javascript
334
+ WellBitDepthTimePlotConfig: {
335
+ show: true,
336
+ width: 280,
337
+ data: [
338
+ {
339
+ mode: "wellBitDepthTime",
340
+ modeName: "钻头位置-井深",
341
+ axisType: "time",
342
+ datas: [
343
+ {
344
+ xName: "时间",
345
+ yName: "井深",
346
+ data: convertedData, // 具体数据
347
+ },
348
+ {
349
+ xName: "时间",
350
+ yName: "钻头位置",
351
+ data: convertedData, // 具体数据
352
+ },
353
+ ],
354
+ },
355
+ {
356
+ mode: "depthTime",
357
+ axisType: "time",
358
+ modeName: "时间-井深",
359
+ datas: [
360
+ {
361
+ xName: "时间",
362
+ yName: "井深",
363
+ data: convertedData, // 具体数据
364
+ },
365
+ ],
366
+ },
367
+ {
368
+ mode: "depthTime",
369
+ modeName: "时间-井深",
370
+ axisType: "depth",
371
+ datas: [
372
+ {
373
+ xName: "时间",
374
+ yName: "井深",
375
+ data: [], // 具体数据
376
+ },
377
+ ],
378
+ },
379
+ ]
380
+ }
381
+ ```
382
+
383
+ ### 5.7 曲线数据配置
384
+
385
+ ```javascript
386
+ // 整体替换数据
387
+ curveDatas: {
388
+ type: "replace",
389
+ data: testDatas, // 数据数组
390
+ dataType: "history" // 可选,数据类型
391
+ }
392
+
393
+ // 追加数据
394
+ curveDatas: {
395
+ type: "append",
396
+ data: generator(), // 数据数组或单个数据对象
397
+ dataType: "real" // 可选,数据类型
398
+ }
399
+ ```
400
+
401
+ ## 6. API说明
402
+
403
+ ### 6.1 事件处理
404
+
405
+ #### 6.1.1 自定义菜单点击
406
+
407
+ **事件**:`@onCustomMenuClicked="onCustomMenuClicked"`
408
+
409
+ **描述**:当用户点击自定义菜单时触发
410
+
411
+ **参数**:无
412
+
413
+ **示例**:
414
+
415
+ ```javascript
416
+ onCustomMenuClicked() {
417
+ // 处理自定义菜单点击事件
418
+ }
419
+ ```
420
+
421
+ #### 6.1.2 模板变更
422
+
423
+ **事件**:`@template-change="templateChange"`
424
+
425
+ **描述**:当模板发生变更时触发
426
+
427
+ **参数**:
428
+
429
+ - `data`:包含变更后的模板信息,结构如下:
430
+ ```javascript
431
+ {
432
+ lanes: [
433
+ {
434
+ laneId: Number, // 车道ID
435
+ laneName: String, // 车道名称
436
+ laneKey: String, // 车道键
437
+ contentKey: String, // 内容键(可选)
438
+ // 其他属性...
439
+ },
440
+ // 更多车道...
441
+ ]
442
+ }
443
+ ```
444
+
445
+ **示例**:
446
+
447
+ ```javascript
448
+ templateChange(data) {
449
+ const { lanes } = data;
450
+ lanes.forEach((item) => {
451
+ if (Object.prototype.hasOwnProperty.call(item, "laneKey")) {
452
+ if (!this.headerSlotName.some((lane) => lane.laneKey == item.laneKey)) {
453
+ this.headerSlotName.push({
454
+ laneId: `lane${item.laneId}`,
455
+ laneKey: item.laneKey,
456
+ laneName: item.laneName,
457
+ });
458
+ } else {
459
+ let index = this.headerSlotName.findIndex((lane) => lane.laneKey == item.laneKey);
460
+ this.headerSlotName[index].laneId = `lane${item.laneId}`;
461
+ }
462
+ }
463
+ if (Object.prototype.hasOwnProperty.call(item, "contentKey")) {
464
+ if (!this.contentSlotName.some((lane) => lane.contentKey == item.contentKey)) {
465
+ this.contentSlotName.push({
466
+ laneId: `content${item.laneId}`,
467
+ contentKey: item.contentKey,
468
+ laneName: item.laneName,
469
+ });
470
+ } else {
471
+ let index = this.contentSlotName.findIndex((lane) => lane.contentKey == item.contentKey);
472
+ this.contentSlotName[index].laneId = `content${item.laneId}`;
473
+ }
474
+ }
475
+ });
476
+ this.lanes = lanes;
477
+ }
478
+ ```
479
+
480
+ #### 6.1.3 曲线变更
481
+
482
+ **事件**:`@line-change="lineChange"`
483
+
484
+ **描述**:当曲线配置发生变更时触发
485
+
486
+ **参数**:
487
+
488
+ - `line`:变更后的曲线配置信息
489
+
490
+ **示例**:
491
+
492
+ ```javascript
493
+ lineChange(line) {
494
+ console.log(line);
495
+ // 处理曲线变更事件
496
+ }
497
+ ```
498
+
499
+ #### 6.1.4 图表滚动
500
+
501
+ **事件**:`@chart-scroll="chartScroll"`
502
+
503
+ **描述**:当图表滚动时触发,用于实现滚动加载数据
504
+
505
+ **参数**:
506
+
507
+ - `data`:包含滚动方向和当前数据信息,结构如下:
508
+ ```javascript
509
+ {
510
+ direction: String, // 滚动方向:"top" 或 "bottom"
511
+ currentData: {} // 当前数据
512
+ }
513
+ ```
514
+
515
+ **示例**:
516
+
517
+ ```javascript
518
+ chartScroll(data) {
519
+ if (data.direction == "top") {
520
+ console.log("触顶", data);
521
+ } else if (data.direction == "bottom") {
522
+ console.log("触底", data);
523
+ }
524
+ }
525
+ ```
526
+
527
+ #### 6.1.5 设置更新
528
+
529
+ **事件**:`@updateSettings="updateSettings"`
530
+
531
+ **描述**:当设置发生变更时触发
532
+
533
+ **参数**:
534
+
535
+ - `data`:包含变更的设置信息,结构如下:
536
+ ```javascript
537
+ {
538
+ key: String, // 设置键名,如 "axisType"、"dataType"
539
+ value: String, // 新的设置值
540
+ settings: Object, // 完整的设置对象
541
+ }
542
+ ```
543
+
544
+ **示例**:
545
+
546
+ ```javascript
547
+ updateSettings(data) {
548
+ clearInterval(this.timeId);
549
+ this.timeId = null;
550
+
551
+ if (data.key == "axisType") {
552
+ // 切换曲线类型时,重置曲线数据
553
+ this.curveDatas = {
554
+ type: "replace",
555
+ data: testDatas,
556
+ };
557
+ // 判断如果是实时数据,则开始获取实时数据,否则清除定时器
558
+ if (data.settings.dataType == "real") {
559
+ this.getRealTimeData();
560
+ }
561
+ }
562
+ if (data.key == "dataType") {
563
+ // 切换数据类型时,重置曲线数据
564
+ this.curveDatas = {
565
+ type: "replace",
566
+ data: testDatas,
567
+ };
568
+ // 判断如果是实时数据,则开始获取实时数据,否则清除定时器
569
+ if (data.value == "real") {
570
+ this.getRealTimeData();
571
+ }
572
+ }
573
+ }
574
+ ```
575
+
576
+ #### 6.1.6 可见数据变更
577
+
578
+ **事件**:`@visibleDataChange="visibleDataChange"`
579
+
580
+ **描述**:当可见数据范围发生变更时触发,用于更新岩性显示等插入的图表
581
+
582
+ **参数**:
583
+
584
+ - `data`:包含可见数据范围信息,结构如下:
585
+ ```javascript
586
+ {
587
+ firstValue: Number, // 起始值
588
+ lastValue: Number, // 结束值
589
+ }
590
+ ```
591
+
592
+ **示例**:
593
+
594
+ ```javascript
595
+ async visibleDataChange(data) {
596
+ const depths = [];
597
+ for (let i = data.firstValue; i <= data.lastValue; i++) {
598
+ depths.push(i.toString());
599
+ }
600
+
601
+ const formations = this.generateFormations();
602
+
603
+ const seriesData = depths.map((d) => {
604
+ const depth = Number(d);
605
+
606
+ const layer = formations.find((f) => depth >= f.start && depth < f.end);
607
+
608
+ return {
609
+ value: 10,
610
+ name: layer?.name || "",
611
+ startDepth: layer?.start,
612
+ endDepth: layer?.end,
613
+ itemStyle: {
614
+ borderWidth: 0,
615
+ borderColor: "transparent",
616
+ color: layer?.color || "#000",
617
+ },
618
+ };
619
+ });
620
+
621
+ this.contentSlotOptions = {
622
+ formation: {
623
+ // ECharts配置...
624
+ },
625
+ };
626
+
627
+ this.$forceUpdate();
628
+ }
629
+ ```
630
+
631
+ #### 6.1.7 弹窗功能
632
+
633
+ **事件**:`@dialogFunction="dialogFunction"`
634
+
635
+ **描述**:当需要显示弹窗时触发,如井深段选择、时间段选择、导出等
636
+
637
+ **参数**:
638
+
639
+ - `data`:包含弹窗类型和相关信息,结构如下:
640
+ ```javascript
641
+ {
642
+ type: Number, // 弹窗类型:1-井深段,2-时间段,3-导出
643
+ start: Number, // 起始值(井深或时间戳)
644
+ end: Number, // 结束值(井深或时间戳)
645
+ }
646
+ ```
647
+
648
+ **示例**:
649
+
650
+ ```javascript
651
+ dialogFunction(data) {
652
+ console.log(data);
653
+ // type 1.井深段 depth 2.时间段 time 3.导出 export
654
+ if (data.type === 1) {
655
+ } else if (data.type === 2) {
656
+ } else if (data.type === 3) {
657
+ }
658
+ }
659
+ ```
660
+
661
+ #### 6.1.8 刷新
662
+
663
+ **事件**:`@refresh="refresh"`
664
+
665
+ **描述**:当用户点击刷新按钮时触发
666
+
667
+ **参数**:无
668
+
669
+ **示例**:
670
+
671
+ ```javascript
672
+ refresh() {
673
+ // 关闭定时器,然后如果初始化为实时数据,重启定时器
674
+ clearInterval(this.timeId);
675
+ this.timeId = null;
676
+ }
677
+ ```
678
+
679
+ ### 6.2 方法
680
+
681
+ #### 6.2.1 主题切换
682
+
683
+ **方法**:`changeTheme(themeName)`
684
+
685
+ **描述**:切换应用主题
686
+
687
+ **参数**:
688
+
689
+ - `themeName`:主题名称,可选值:"white"、"dark"、"gray"
690
+
691
+ **示例**:
692
+
693
+ ```javascript
694
+ changeTheme(themeName) {
695
+ this.themeName = themeName;
696
+ document.body.setAttribute("data-theme", themeName);
697
+ }
698
+ ```
699
+
700
+ #### 6.2.2 获取实时数据
701
+
702
+ **方法**:`getRealTimeData()`
703
+
704
+ **描述**:获取实时数据并定时更新
705
+
706
+ **参数**:无
707
+
708
+ **示例**:
709
+
710
+ ```javascript
711
+ getRealTimeData() {
712
+ const generator = createMockDataGenerator(this.dataSource, {
713
+ startDepth: 2199,
714
+ depthStep: 5,
715
+ startTime: 1769074462,
716
+ timeStep: 10,
717
+ });
718
+ this.timeId = setInterval(() => {
719
+ this.curveDatas = {
720
+ type: "append",
721
+ data: generator(),
722
+ };
723
+ }, 1000);
724
+ }
725
+ ```
726
+
727
+ #### 6.2.3 生成岩性数据
728
+
729
+ **方法**:`generateFormations()`
730
+
731
+ **描述**:生成岩性数据,用于岩性显示
732
+
733
+ **参数**:无
734
+
735
+ **返回值**:岩性数据数组,结构如下:
736
+
737
+ ```javascript
738
+ [
739
+ {
740
+ start: Number, // 起始深度
741
+ end: Number, // 结束深度
742
+ name: String, // 岩性名称
743
+ color: String, // 岩性颜色
744
+ },
745
+ // 更多岩性...
746
+ ]
747
+ ```
748
+
749
+ **示例**:
750
+
751
+ ```javascript
752
+ generateFormations() {
753
+ const rockTypes = [
754
+ { name: "砂岩", color: "#f4c542" },
755
+ { name: "泥岩", color: "#eb5757" },
756
+ { name: "粉砂岩", color: "#f2994a" },
757
+ { name: "砂质泥岩", color: "#6fcf97" },
758
+ { name: "灰岩", color: "#9e9e9e" },
759
+ { name: "白云岩", color: "#56ccf2" },
760
+ ];
761
+
762
+ const formations = [];
763
+ let depth = 0;
764
+ let i = 0;
765
+
766
+ while (depth < 5000) {
767
+ const thickness = 50 + Math.floor(20 * Math.sin(i * 0.8));
768
+ const rock = rockTypes[i % rockTypes.length];
769
+
770
+ formations.push({
771
+ start: depth,
772
+ end: Math.min(depth + thickness, 5000),
773
+ name: rock.name,
774
+ color: rock.color,
775
+ });
776
+
777
+ depth += thickness;
778
+ i++;
779
+ }
780
+
781
+ return formations;
782
+ }
783
+ ```
784
+
785
+ #### 6.2.4 获取顶部数据
786
+
787
+ **方法**:`getTopData(content)`
788
+
789
+ **描述**:获取顶部数据,用于滚动加载
790
+
791
+ **参数**:
792
+
793
+ - `content`:包含当前数据信息,结构如下:
794
+ ```javascript
795
+ {
796
+ depth: Number, // 当前深度
797
+ timestamp: Number, // 当前时间戳
798
+ }
799
+ ```
800
+
801
+ **示例**:
802
+
803
+ ```javascript
804
+ getTopData(content) {
805
+ const generator = createMockDataGenerator(this.dataSource, {
806
+ startDepth: content.depth - 250,
807
+ depthStep: 5,
808
+ startTime: content.timestamp - 500,
809
+ timeStep: 10,
810
+ });
811
+ let curveDatas = [];
812
+ for (let i = 0; i < 50; i++) {
813
+ curveDatas.push(generator());
814
+ }
815
+
816
+ this.curveDatas = {
817
+ type: "append",
818
+ data: curveDatas,
819
+ };
820
+ }
821
+ ```
822
+
823
+ #### 6.2.5 获取底部数据
824
+
825
+ **方法**:`getBottomData(content)`
826
+
827
+ **描述**:获取底部数据,用于滚动加载
828
+
829
+ **参数**:
830
+
831
+ - `content`:包含当前数据信息,结构如下:
832
+ ```javascript
833
+ {
834
+ depth: Number, // 当前深度
835
+ timestamp: Number, // 当前时间戳
836
+ }
837
+ ```
838
+
839
+ **示例**:
840
+
841
+ ```javascript
842
+ getBottomData(content) {
843
+ const generator = createMockDataGenerator(this.dataSource, {
844
+ startDepth: content?.depth || 0,
845
+ depthStep: 5,
846
+ startTime: content?.timestamp || 0,
847
+ timeStep: 10,
848
+ });
849
+ let curveDatas = [];
850
+ for (let i = 0; i < 50; i++) {
851
+ curveDatas.push(generator());
852
+ }
853
+ this.curveDatas = {
854
+ type: "append",
855
+ data: curveDatas,
856
+ };
857
+ }
858
+ ```
859
+
860
+ #### 6.2.6 自定义tooltip格式化
861
+
862
+ **方法**:`customTooltipFormatter({series})`
863
+
864
+ **描述**:自定义tooltip格式化函数
865
+
866
+ **参数**:
867
+
868
+ - `series`:数据系列数组,每个元素包含系列名称、颜色、值等信息
869
+ - `mousePositionData`:鼠标位置数据,包含当前鼠标位置的深度和时间戳
870
+ ```javascript
871
+ {
872
+ depth: Number, // 当前深度
873
+ timestamp: Number, // 当前时间戳
874
+ }
875
+ ```
876
+
877
+ **返回值**:HTML元素,用于显示tooltip内容
878
+
879
+ **示例**:
880
+
881
+ ```javascript
882
+ customTooltipFormatter({series, mousePositionData}) {
883
+ // 创建一个容器div
884
+ const outerDiv = document.createElement("div");
885
+
886
+ // 设置容器样式
887
+ outerDiv.style.padding = "10px";
888
+ outerDiv.style.fontFamily = "Arial, sans-serif";
889
+
890
+ // 添加标题
891
+ const titleDiv = document.createElement("div");
892
+ titleDiv.style.fontWeight = "bold";
893
+ titleDiv.style.marginBottom = "8px";
894
+ titleDiv.style.color = "#fff";
895
+ titleDiv.innerText = "自定义数据信息";
896
+ outerDiv.appendChild(titleDiv);
897
+
898
+ // 处理每个数据系列
899
+ series.forEach((item) => {
900
+ // 创建数据行
901
+ const dataDiv = document.createElement("div");
902
+ dataDiv.style.display = "flex";
903
+ dataDiv.style.alignItems = "center";
904
+ dataDiv.style.marginBottom = "4px";
905
+
906
+ // 创建颜色标记
907
+ const markerDiv = document.createElement("div");
908
+ markerDiv.style.width = "12px";
909
+ markerDiv.style.height = "12px";
910
+ markerDiv.style.borderRadius = "50%";
911
+ markerDiv.style.backgroundColor = item.color;
912
+ markerDiv.style.marginRight = "8px";
913
+ dataDiv.appendChild(markerDiv);
914
+
915
+ // 创建数据文本
916
+ const textSpan = document.createElement("span");
917
+ textSpan.style.fontSize = "12px";
918
+ textSpan.style.color = "#fff";
919
+
920
+ // 处理不同类型的值
921
+ let displayValue = item.value;
922
+ if (Array.isArray(item.value)) {
923
+ // 对于数组类型的值(如[x, y]格式)
924
+ displayValue = item.value[0];
925
+ }
926
+
927
+ // 格式化显示内容
928
+ textSpan.innerText = `${item.seriesName}: ${displayValue}`;
929
+ dataDiv.appendChild(textSpan);
930
+
931
+ // 添加到容器
932
+ outerDiv.appendChild(dataDiv);
933
+ });
934
+
935
+ // 可以添加额外的自定义内容
936
+ const extraDiv = document.createElement("div");
937
+ extraDiv.style.marginTop = "8px";
938
+ extraDiv.style.fontSize = "11px";
939
+ outerDiv.appendChild(extraDiv);
940
+
941
+ return outerDiv;
942
+ }
943
+ ```
944
+
945
+ ## 7. 示例代码
946
+
947
+ ### 7.1 基本使用
948
+
949
+ ```vue
950
+ <template>
951
+ <div id="app" ref="targetDom">
952
+ <frameLayout
953
+ class="container"
954
+ ref="frameLayout"
955
+ :warningData="warningData"
956
+ :timeConfig="timeConfig"
957
+ :depthConfig="depthConfig"
958
+ :customMenuList="customMenuList"
959
+ @onCustomMenuClicked="onCustomMenuClicked"
960
+ @template-change="templateChange"
961
+ @line-change="lineChange"
962
+ @chart-scroll="chartScroll"
963
+ @updateSettings="updateSettings"
964
+ @visibleDataChange="visibleDataChange"
965
+ @dialogFunction="dialogFunction"
966
+ @refresh="refresh"
967
+ :curveDatas="curveDatas"
968
+ :themeName="themeName"
969
+ :headerSlotName="headerSlotName"
970
+ :contentSlotName="contentSlotName"
971
+ :toolBarConfig="toolBarConfig"
972
+ :parameterPanelConfig="parameterPanelConfig"
973
+ :WellBitDepthTimePlotConfig="WellBitDepthTimePlotConfig"
974
+ >
975
+ <template v-for="lane in headerSlotName" :slot="lane.laneId">
976
+ <div class="header-slot" :style="{ minWidth: lane.laneKey == 'formation' ? '40px ' : '' }" v-if="true" :key="lane.laneId">
977
+ {{ lane.laneName }}
978
+ </div>
979
+ </template>
980
+ <template v-for="lane in contentSlotName" :slot="lane.laneId">
981
+ <div class="content-slot" v-if="true" :key="lane.laneId">
982
+ <resizeEcharts ref="resizeEcharts" autoresize :options="contentSlotOptions[lane.contentKey]"></resizeEcharts>
983
+ </div>
984
+ </template>
985
+ </frameLayout>
986
+ </div>
987
+ </template>
988
+
989
+ <script>
990
+ import convertedData from "@/mock/convertedData.json";
991
+ import { testDatas } from "@/mock/testData";
992
+ import Vue from "vue";
993
+ import frameLayout from "./components/frame-layout/index.js";
994
+ import resizeEcharts from "./components/resizeEcharts/index.vue";
995
+ import { colorToRGBA, createMockDataGenerator, getCssVariable } from "./components/util/index.js";
996
+ Vue.use(frameLayout);
997
+ export default {
998
+ name: "App",
999
+ components: {
1000
+ resizeEcharts,
1001
+ },
1002
+ data() {
1003
+ return {
1004
+ themeName: "dark",
1005
+ depthConfig: {
1006
+ type: "local",
1007
+ caseId: "depth",
1008
+ versionCode: 5,
1009
+ dataSource: {
1010
+ templates: [
1011
+ {
1012
+ templateName: "井深",
1013
+ lanes: [
1014
+ {
1015
+ laneName: "井深",
1016
+ laneKey: "depth",
1017
+ createUser: "SYSTEM_USER",
1018
+ sort: 1,
1019
+ },
1020
+ {
1021
+ laneName: "地层",
1022
+ laneKey: "formation",
1023
+ contentKey: "formation",
1024
+ createUser: "SYSTEM_USER",
1025
+ sort: 1,
1026
+ },
1027
+ // 更多车道配置...
1028
+ ],
1029
+ },
1030
+ ],
1031
+ params: [
1032
+ { paramId: "depth", paramName: "井深", paramUnit: "m" },
1033
+ // 更多参数配置...
1034
+ ]
1035
+ }
1036
+ },
1037
+ timeConfig: {
1038
+ type: "local",
1039
+ caseId: "timestamp",
1040
+ versionCode: 3,
1041
+ dataSource: {
1042
+ templates: [
1043
+ {
1044
+ templateName: "时间",
1045
+ lanes: [
1046
+ {
1047
+ laneName: "时间",
1048
+ laneKey: "timestamp",
1049
+ createUser: "SYSTEM_USER",
1050
+ sort: 1,
1051
+ },
1052
+ // 更多车道配置...
1053
+ ],
1054
+ },
1055
+ ],
1056
+ params: [
1057
+ { paramId: "depth", paramName: "井深", paramUnit: "m" },
1058
+ // 更多参数配置...
1059
+ ]
1060
+ }
1061
+ },
1062
+ dataSource: {
1063
+ templates: [
1064
+ {
1065
+ templateName: "井深",
1066
+ lanes: [
1067
+ {
1068
+ laneName: "井深",
1069
+ laneKey: "depth",
1070
+ createUser: "SYSTEM_USER",
1071
+ sort: 1,
1072
+ },
1073
+ // 更多车道配置...
1074
+ ],
1075
+ },
1076
+ ],
1077
+ params: [
1078
+ { paramId: "depth", paramName: "井深", paramUnit: "m" },
1079
+ // 更多参数配置...
1080
+ ],
1081
+ },
1082
+ warningData: [2024],
1083
+ headerSlotName: [],
1084
+ contentSlotName: [],
1085
+ contentSlotOptions: {},
1086
+ customMenuList: [],
1087
+ lanes: [],
1088
+ toolBarConfig: {
1089
+ show: true,
1090
+ width: 120,
1091
+ dataTypeList: {
1092
+ history: "history",
1093
+ real: "real"
1094
+ },
1095
+ axisTypeList: {
1096
+ time: "timestamp",
1097
+ depth: "depth"
1098
+ },
1099
+ timeRangeList: [
1100
+ { label: "5min", value: 5 },
1101
+ { label: "10min", value: 10 },
1102
+ { label: "30min", value: 30 },
1103
+ { label: "1h", value: 60 },
1104
+ { label: "12h", value: 720 },
1105
+ { label: "24h", value: 1440 },
1106
+ ],
1107
+ depthRangeList: [
1108
+ { label: "1000m", value: 1000 },
1109
+ { label: "2000m", value: 2000 },
1110
+ { label: "3000m", value: 3000 },
1111
+ { label: "4000m", value: 4000 },
1112
+ { label: "5000m", value: 5000 },
1113
+ { label: "10000m", value: 10000 },
1114
+ ],
1115
+ scaleList: [
1116
+ { label: "1:100", value: 1 },
1117
+ { label: "1:200", value: 2 },
1118
+ { label: "1:500", value: 5 },
1119
+ { label: "1:1000", value: 10 },
1120
+ { label: "10:2000", value: 20 },
1121
+ ],
1122
+ timeRangeBtnShow: true,
1123
+ depthRangeBtnShow: true,
1124
+ alertBtnShow: true,
1125
+ refreshBtnShow: true,
1126
+ exportBtnShow: true,
1127
+ form: {
1128
+ axisType: "time",
1129
+ dataType: "real",
1130
+ displayType: "float",
1131
+ scale: 5,
1132
+ timeRange: 10,
1133
+ depthRange: 1000,
1134
+ },
1135
+ },
1136
+ parameterPanelConfig: {
1137
+ show: true,
1138
+ width: 140,
1139
+ data: [
1140
+ { label: "出口流量(L/s)", value: 231.7 },
1141
+ { label: "入口温度(℃)", value: 12.3 },
1142
+ // 更多参数...
1143
+ ],
1144
+ },
1145
+ WellBitDepthTimePlotConfig: {
1146
+ show: true,
1147
+ width: 280,
1148
+ data: [
1149
+ {
1150
+ mode: "wellBitDepthTime",
1151
+ modeName: "钻头位置-井深",
1152
+ axisType: "time",
1153
+ datas: [
1154
+ {
1155
+ xName: "时间",
1156
+ yName: "井深",
1157
+ data: convertedData,
1158
+ },
1159
+ {
1160
+ xName: "时间",
1161
+ yName: "钻头位置",
1162
+ data: convertedData,
1163
+ },
1164
+ ],
1165
+ },
1166
+ // 更多模式...
1167
+ ],
1168
+ },
1169
+ timeId: null,
1170
+ curveDatas: {},
1171
+ };
1172
+ },
1173
+ mounted() {
1174
+ this.changeTheme(this.themeName);
1175
+ this.curveDatas = {
1176
+ type: "replace",
1177
+ data: testDatas,
1178
+ };
1179
+ // this.getRealTimeData();
1180
+ },
1181
+ beforeDestroy() {
1182
+ clearInterval(this.timeId);
1183
+ this.timeId = null;
1184
+ },
1185
+ methods: {
1186
+ // 自定义tooltip格式化函数
1187
+ customTooltipFormatter({series}) {
1188
+ // 实现自定义tooltip
1189
+ },
1190
+ // 弹窗处理
1191
+ dialogFunction(data) {
1192
+ // 处理弹窗事件
1193
+ },
1194
+ // 生成岩性数据
1195
+ generateFormations() {
1196
+ // 生成岩性数据
1197
+ },
1198
+ // 可见数据变更
1199
+ visibleDataChange(data) {
1200
+ // 处理可见数据变更
1201
+ },
1202
+ // 刷新
1203
+ refresh() {
1204
+ // 处理刷新事件
1205
+ },
1206
+ // 设置更新
1207
+ updateSettings(data) {
1208
+ // 处理设置更新
1209
+ },
1210
+ // 获取实时数据
1211
+ getRealTimeData() {
1212
+ // 获取实时数据
1213
+ },
1214
+ // 获取顶部数据
1215
+ getTopData(content) {
1216
+ // 获取顶部数据
1217
+ },
1218
+ // 获取底部数据
1219
+ getBottomData(content) {
1220
+ // 获取底部数据
1221
+ },
1222
+ // 图表滚动
1223
+ chartScroll(data) {
1224
+ // 处理图表滚动
1225
+ },
1226
+ // 曲线变更
1227
+ lineChange(line) {
1228
+ // 处理曲线变更
1229
+ },
1230
+ // 模板变更
1231
+ templateChange(data) {
1232
+ // 处理模板变更
1233
+ },
1234
+ // 主题切换
1235
+ changeTheme(themeName) {
1236
+ // 切换主题
1237
+ },
1238
+ // 自定义菜单点击
1239
+ onCustomMenuClicked() {
1240
+ // 处理自定义菜单点击
1241
+ },
1242
+ },
1243
+ };
1244
+ </script>
1245
+
1246
+ <style lang="scss">
1247
+ @import "@/styles/theme/index.scss";
1248
+ #app {
1249
+ font-family: Avenir, Helvetica, Arial, sans-serif;
1250
+ -webkit-font-smoothing: antialiased;
1251
+ -moz-osx-font-smoothing: grayscale;
1252
+ color: #2c3e50;
1253
+ width: 100%;
1254
+ height: 100vh;
1255
+ position: relative;
1256
+ background: var(--app-background-color);
1257
+ overflow: hidden;
1258
+
1259
+ .container {
1260
+ height: 100%;
1261
+ width: 100%;
1262
+ overflow: hidden;
1263
+ }
1264
+
1265
+ .header-slot {
1266
+ min-width: 60px;
1267
+ text-align: center;
1268
+ font-size: 12px;
1269
+ }
1270
+ .content-slot {
1271
+ width: 100%;
1272
+ height: 100%;
1273
+ overflow: hidden;
1274
+ }
1275
+ .draw-slot {
1276
+ display: flex;
1277
+ height: 100%;
1278
+ width: 100%;
1279
+ }
1280
+ .lane-div {
1281
+ flex: 1;
1282
+ height: 100%;
1283
+ }
1284
+ }
1285
+
1286
+ /* 全局设置 box-sizing 为 border-box */
1287
+ *,
1288
+ *::before,
1289
+ *::after {
1290
+ box-sizing: border-box;
1291
+ margin: 0;
1292
+ padding: 0;
1293
+ }
1294
+ </style>
1295
+ ```
1296
+
1297
+ ### 7.2 主题切换示例
1298
+
1299
+ ```javascript
1300
+ // 切换到白色主题
1301
+ this.changeTheme('white');
1302
+
1303
+ // 切换到深色主题
1304
+ this.changeTheme('dark');
1305
+
1306
+ // 切换到灰色主题
1307
+ this.changeTheme('gray');
1308
+ ```
1309
+
1310
+ ### 7.3 数据传递示例
1311
+
1312
+ #### 7.3.1 初始化数据
1313
+
1314
+ ```javascript
1315
+ // 初始化时设置曲线数据
1316
+ mounted() {
1317
+ this.changeTheme(this.themeName);
1318
+ this.curveDatas = {
1319
+ type: "replace",
1320
+ data: testDatas, // 初始数据
1321
+ };
1322
+ // 启动实时数据(如果需要)
1323
+ // this.getRealTimeData();
1324
+ }
1325
+ ```
1326
+
1327
+ #### 7.3.2 实时数据更新
1328
+
1329
+ ```javascript
1330
+ // 获取实时数据并定时更新
1331
+ getRealTimeData() {
1332
+ const generator = createMockDataGenerator(this.dataSource, {
1333
+ startDepth: 2199,
1334
+ depthStep: 5,
1335
+ startTime: 1769074462,
1336
+ timeStep: 10,
1337
+ });
1338
+ this.timeId = setInterval(() => {
1339
+ this.curveDatas = {
1340
+ type: "append",
1341
+ data: generator(), // 生成的实时数据
1342
+ };
1343
+ }, 1000);
1344
+ }
1345
+ ```
1346
+
1347
+ #### 7.3.3 滚动加载数据
1348
+
1349
+ ```javascript
1350
+ // 触顶加载数据
1351
+ chartScroll(data) {
1352
+ if (data.direction == "top") {
1353
+ console.log("触顶", data);
1354
+ this.getTopData(data.currentData);
1355
+ } else if (data.direction == "bottom") {
1356
+ console.log("触底", data);
1357
+ this.getBottomData(data.currentData);
1358
+ }
1359
+ }
1360
+
1361
+ // 获取顶部数据
1362
+ getTopData(content) {
1363
+ const generator = createMockDataGenerator(this.dataSource, {
1364
+ startDepth: content.depth - 250,
1365
+ depthStep: 5,
1366
+ startTime: content.timestamp - 500,
1367
+ timeStep: 10,
1368
+ });
1369
+ let curveDatas = [];
1370
+ for (let i = 0; i < 50; i++) {
1371
+ curveDatas.push(generator());
1372
+ }
1373
+
1374
+ this.curveDatas = {
1375
+ type: "append",
1376
+ data: curveDatas, // 顶部数据
1377
+ };
1378
+ }
1379
+
1380
+ // 获取底部数据
1381
+ getBottomData(content) {
1382
+ const generator = createMockDataGenerator(this.dataSource, {
1383
+ startDepth: content?.depth || 0,
1384
+ depthStep: 5,
1385
+ startTime: content?.timestamp || 0,
1386
+ timeStep: 10,
1387
+ });
1388
+ let curveDatas = [];
1389
+ for (let i = 0; i < 50; i++) {
1390
+ curveDatas.push(generator());
1391
+ }
1392
+ this.curveDatas = {
1393
+ type: "append",
1394
+ data: curveDatas, // 底部数据
1395
+ };
1396
+ }
1397
+ ```
1398
+
1399
+ #### 7.3.4 设置变更时的数据处理
1400
+
1401
+ ```javascript
1402
+ // 设置更新时的数据处理
1403
+ updateSettings(data) {
1404
+ clearInterval(this.timeId);
1405
+ this.timeId = null;
1406
+
1407
+ if (data.key == "axisType") {
1408
+ // 切换曲线类型时,重置曲线数据
1409
+ this.curveDatas = {
1410
+ type: "replace",
1411
+ data: testDatas, // 重置数据
1412
+ };
1413
+ // 判断如果是实时数据,则开始获取实时数据,否则清除定时器
1414
+ if (data.settings.dataType == "real") {
1415
+ this.getRealTimeData();
1416
+ }
1417
+ }
1418
+ if (data.key == "dataType") {
1419
+ // 切换数据类型时,重置曲线数据
1420
+ this.curveDatas = {
1421
+ type: "replace",
1422
+ data: testDatas, // 重置数据
1423
+ };
1424
+ // 判断如果是实时数据,则开始获取实时数据,否则清除定时器
1425
+ if (data.value == "real") {
1426
+ this.getRealTimeData();
1427
+ }
1428
+ }
1429
+ }
1430
+ ```
1431
+
1432
+ ### 7.4 岩性显示示例
1433
+
1434
+ ```javascript
1435
+ // 生成岩性数据
1436
+ generateFormations() {
1437
+ const rockTypes = [
1438
+ { name: "砂岩", color: "#f4c542" },
1439
+ { name: "泥岩", color: "#eb5757" },
1440
+ { name: "粉砂岩", color: "#f2994a" },
1441
+ { name: "砂质泥岩", color: "#6fcf97" },
1442
+ { name: "灰岩", color: "#9e9e9e" },
1443
+ { name: "白云岩", color: "#56ccf2" },
1444
+ ];
1445
+
1446
+ const formations = [];
1447
+ let depth = 0;
1448
+ let i = 0;
1449
+
1450
+ while (depth < 5000) {
1451
+ const thickness = 50 + Math.floor(20 * Math.sin(i * 0.8));
1452
+ const rock = rockTypes[i % rockTypes.length];
1453
+
1454
+ formations.push({
1455
+ start: depth,
1456
+ end: Math.min(depth + thickness, 5000),
1457
+ name: rock.name,
1458
+ color: rock.color,
1459
+ });
1460
+
1461
+ depth += thickness;
1462
+ i++;
1463
+ }
1464
+
1465
+ return formations;
1466
+ }
1467
+
1468
+ // 可见数据变更时更新岩性显示
1469
+ async visibleDataChange(data) {
1470
+ const depths = [];
1471
+ for (let i = data.firstValue; i <= data.lastValue; i++) {
1472
+ depths.push(i.toString());
1473
+ }
1474
+
1475
+ const formations = this.generateFormations();
1476
+
1477
+ const seriesData = depths.map((d) => {
1478
+ const depth = Number(d);
1479
+
1480
+ const layer = formations.find((f) => depth >= f.start && depth < f.end);
1481
+
1482
+ return {
1483
+ value: 10,
1484
+ name: layer?.name || "",
1485
+ startDepth: layer?.start,
1486
+ endDepth: layer?.end,
1487
+ itemStyle: {
1488
+ borderWidth: 0,
1489
+ borderColor: "transparent",
1490
+ color: layer?.color || "#000",
1491
+ },
1492
+ };
1493
+ });
1494
+
1495
+ this.contentSlotOptions = {
1496
+ formation: {
1497
+ animation: false,
1498
+ backgroundColor: getCssVariable("--bg-color"),
1499
+
1500
+ tooltip: {
1501
+ trigger: "item",
1502
+ appendTo: this.$refs.targetDom,
1503
+ confine: true,
1504
+ backgroundColor: colorToRGBA(getCssVariable("--bg-color"), 0.8),
1505
+ borderWidth: 0,
1506
+ textStyle: {
1507
+ color: getCssVariable("--default-text-color"),
1508
+ },
1509
+ formatter: (params) => {
1510
+ const outerDiv = document.createElement("div");
1511
+ const d = params.data;
1512
+ const innerDiv = document.createElement("div");
1513
+ innerDiv.style = "display: flex; align-items: center;";
1514
+ const markerDiv = document.createElement("div");
1515
+ markerDiv.style = `height: 10px; width:10px;font-size:10px; border-radius:8px; gap: 5px; background-color:${d.itemStyle.color}`;
1516
+ const textSpan = document.createElement("span");
1517
+ textSpan.innerText = `岩性:${d.name}\n 深度:${d.startDepth} - ${d.endDepth} m`;
1518
+ textSpan.style = `margin-left:8px;font-size:12px;color:${getCssVariable("--default-text-color")};`;
1519
+ innerDiv.appendChild(markerDiv);
1520
+ innerDiv.appendChild(textSpan);
1521
+
1522
+ outerDiv.appendChild(innerDiv);
1523
+ return outerDiv;
1524
+ },
1525
+ },
1526
+
1527
+ grid: {
1528
+ left: 0,
1529
+ right: 0,
1530
+ top: 0,
1531
+ bottom: 0,
1532
+ },
1533
+
1534
+ xAxis: {
1535
+ type: "value",
1536
+ min: 0,
1537
+ max: 10,
1538
+ show: false,
1539
+ },
1540
+
1541
+ yAxis: {
1542
+ show: false,
1543
+ type: "category",
1544
+ inverse: true,
1545
+ data: depths,
1546
+ axisLabel: { show: false },
1547
+ axisLine: { show: false },
1548
+ axisTick: { show: false },
1549
+ },
1550
+
1551
+ series: [
1552
+ {
1553
+ type: "bar",
1554
+ data: seriesData,
1555
+ barWidth: "200%",
1556
+ barGap: "0%",
1557
+ barCategoryGap: "0%",
1558
+ emphasis: {
1559
+ disabled: true,
1560
+ },
1561
+ silent: false,
1562
+ animation: false,
1563
+ },
1564
+ ],
1565
+ },
1566
+ };
1567
+
1568
+ this.$forceUpdate();
1569
+ }
1570
+ ```
1571
+