...
|
...
|
@@ -352,7 +352,7 @@ |
352
|
352
|
*/
|
353
|
353
|
Sidebar.prototype.initChartInstance = function (graph) {
|
354
|
354
|
const basicAttr = this.enumCellBasicAttribute
|
355
|
|
- const allCell = graph.getDefaultParent().children || []
|
|
355
|
+ const allCell = Object.entries(graph?.getModel()?.cells || {}).map(([_, item]) => item) || []
|
356
|
356
|
const domIdMapping = new Map()
|
357
|
357
|
for (const cell of allCell) {
|
358
|
358
|
const chartInstanceId = graph.getAttributeForCell(cell, basicAttr.CHART_INSTANCE_ID)
|
...
|
...
|
@@ -363,6 +363,7 @@ |
363
|
363
|
domIdMapping.set(chartInstanceId, { width, height, chartType })
|
364
|
364
|
}
|
365
|
365
|
}
|
|
366
|
+
|
366
|
367
|
const chartsDomList = document.querySelectorAll(`.${enumConst.CHART_CONTAINER_CLS}`)
|
367
|
368
|
for (const chartDom of chartsDomList) {
|
368
|
369
|
const id = chartDom.getAttribute('id')
|
...
|
...
|
@@ -421,17 +422,26 @@ |
421
|
422
|
// }
|
422
|
423
|
// }
|
423
|
424
|
function getLineChartDefaultOption() {
|
|
425
|
+ var isLightBox = !!(urlParams || {})['lightbox']
|
424
|
426
|
return {
|
|
427
|
+ title: isLightBox ? {
|
|
428
|
+ text: '暂无数据',
|
|
429
|
+ x: 'center',
|
|
430
|
+ y: 'center',
|
|
431
|
+ subtextStyle: {
|
|
432
|
+ fontSize: 16
|
|
433
|
+ }
|
|
434
|
+ } : {},
|
425
|
435
|
xAxis: {
|
426
|
436
|
type: 'category',
|
427
|
|
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
437
|
+ data: isLightBox ? [] : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
428
|
438
|
},
|
429
|
439
|
yAxis: {
|
430
|
440
|
type: 'value',
|
431
|
441
|
},
|
432
|
442
|
series: [
|
433
|
443
|
{
|
434
|
|
- data: [150, 230, 224, 218, 135, 147, 260],
|
|
444
|
+ data: isLightBox ? [] : [150, 230, 224, 218, 135, 147, 260],
|
435
|
445
|
type: 'line',
|
436
|
446
|
},
|
437
|
447
|
],
|
...
|
...
|
@@ -439,17 +449,26 @@ |
439
|
449
|
}
|
440
|
450
|
|
441
|
451
|
function getBarChartDefaultOption() {
|
|
452
|
+ var isLightBox = !!(urlParams || {})['lightbox']
|
442
|
453
|
return {
|
|
454
|
+ title: isLightBox ? {
|
|
455
|
+ text: '暂无数据',
|
|
456
|
+ x: 'center',
|
|
457
|
+ y: 'center',
|
|
458
|
+ subtextStyle: {
|
|
459
|
+ fontSize: 16
|
|
460
|
+ }
|
|
461
|
+ } : {},
|
443
|
462
|
xAxis: {
|
444
|
463
|
type: 'category',
|
445
|
|
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
|
464
|
+ data: isLightBox ? [] : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
446
|
465
|
},
|
447
|
466
|
yAxis: {
|
448
|
467
|
type: 'value',
|
449
|
468
|
},
|
450
|
469
|
series: [
|
451
|
470
|
{
|
452
|
|
- data: [120, 200, 150, 80, 70, 110, 130],
|
|
471
|
+ data: isLightBox ? [] : [120, 200, 150, 80, 70, 110, 130],
|
453
|
472
|
type: 'bar',
|
454
|
473
|
showBackground: true,
|
455
|
474
|
backgroundStyle: {
|
...
|
...
|
|