diff --git a/package-lock.json b/package-lock.json index 2bb4f8a..3f507de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,6 +31,7 @@ "@types/signalr": "^2.4.3", "@types/three": "^0.162.0", "ag-grid-angular": "^31.0.2", + "autofit.js": "^3.1.0", "echarts": "^5.5.0", "moment": "^2.30.1", "mqtt": "^5.3.6", @@ -5615,6 +5616,11 @@ "dev": true, "license": "MIT" }, + "node_modules/autofit.js": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/autofit.js/-/autofit.js-3.1.0.tgz", + "integrity": "sha512-zX/2VbpxdDcgDDCT1A0psuF8Phs8QbmFXstvLkqrrOcv33LQttCh2J6GVs84585+LfMAfacemxRXIidrFXu02g==" + }, "node_modules/autoprefixer": { "version": "10.4.16", "resolved": "https://registry.npmmirror.com/autoprefixer/-/autoprefixer-10.4.16.tgz", diff --git a/package.json b/package.json index 1c6198c..afb20ac 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "@types/signalr": "^2.4.3", "@types/three": "^0.162.0", "ag-grid-angular": "^31.0.2", + "autofit.js": "^3.1.0", "echarts": "^5.5.0", "moment": "^2.30.1", "mqtt": "^5.3.6", diff --git a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.css b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.css index 266fdf7..e257242 100644 --- a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.css +++ b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.css @@ -15,8 +15,8 @@ .chart-button { - width: 175px; -height: 51px; + width: 17rem; + height: 5; margin: 5px; font-size: 28px; line-height: 22px; @@ -29,4 +29,10 @@ height: 51px; background-size: contain; /* 或者可以使用 'contain' 根据你的需要 */ border-width: 0; } + + .chart-container { + width: 10rem; + height: 10rem; + } + \ No newline at end of file diff --git a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.html b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.html index adf5b20..0917fe1 100644 --- a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.html +++ b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.html @@ -1,6 +1,6 @@
{{ text }}
diff --git a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.ts b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.ts index 89e1aa2..c5a2e03 100644 --- a/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.ts +++ b/src/app/routes/data-v/lj-text-dashboard/lj-text-dashboard.component.ts @@ -2,7 +2,9 @@ import { CommonModule } from '@angular/common'; import { Component, Input, OnInit, ViewChild, inject } from '@angular/core'; import { ModalHelper, _HttpClient } from '@delon/theme'; import { SHARED_IMPORTS } from '@shared'; +import autofit from 'autofit.js'; import * as echarts from 'echarts'; + @Component({ selector: 'app-data-v-lj-text-dashboard', standalone: true, @@ -16,6 +18,13 @@ export class DataVLjTextDashboardComponent implements OnInit { ngOnInit(): void { // 使用 setTimeout 确保视图已经初始化 setTimeout(() => this.initCharts(), 0); + // autofit.init(); + // autofit.init({ + // dh: 1080, + // dw: 1920, + // el: 'body', + // resize: true + // }); } initCharts(): void { diff --git a/src/app/routes/data-v/second1/second1.component.html b/src/app/routes/data-v/second1/second1.component.html index 1e9b299..e489c6a 100644 --- a/src/app/routes/data-v/second1/second1.component.html +++ b/src/app/routes/data-v/second1/second1.component.html @@ -1,5 +1,5 @@