Browse Source

fix: 图表不清晰和变形的问题

master
guoapeng 3 weeks ago
parent
commit
64e96e6252
  1. 2
      server/index.js
  2. 4
      src/components/seal/DashboardChart.vue

2
server/index.js

@ -3,7 +3,7 @@ import express from 'express'
const app = express() const app = express()
const PORT = 8080 // 可根据需要更改端口号
const PORT = 8088 // 可根据需要更改端口号
app.listen(PORT, () => { app.listen(PORT, () => {
console.log(`服务器已启动,正在监听端口 ${PORT}`) console.log(`服务器已启动,正在监听端口 ${PORT}`)
}) })

4
src/components/seal/DashboardChart.vue

@ -27,7 +27,7 @@ const initChart = () => {
if (!chartRef.value) { if (!chartRef.value) {
return return
} }
myChart = echarts.init(chartRef.value)
myChart = echarts.init(chartRef.value, null, { renderer: 'svg' })
const option = { const option = {
tooltip: { tooltip: {
formatter: '{a} <br/>{b} : {c}%', formatter: '{a} <br/>{b} : {c}%',
@ -70,7 +70,7 @@ onUnmounted(() => {
</script> </script>
<template> <template>
<div ref="chartRef" style="width: 40vw; height: 30vw" />
<div ref="chartRef" style="width: 100%; height: 100%" />
</template> </template>
<style> <style>

Loading…
Cancel
Save