Browse Source

图表样式调整

release_0.0.1
‘lijianhao’ 3 years ago
parent
commit
3188d2dd39
  1. 43
      web/client/src/sections/quanju/containers/footer/conserve/chart/pie-chart.js
  2. 2
      web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js
  3. 2
      web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js

43
web/client/src/sections/quanju/containers/footer/conserve/chart/pie-chart.js

@ -4,7 +4,7 @@ import * as echarts from 'echarts';
const PieChart = (props) => { const PieChart = (props) => {
const { width, height, data, colorList, underColorList, total, text } = props const { width, height, data, colorList, underColorList, total, text, textLeft,numLeft } = props
const chartRef = useRef(null); const chartRef = useRef(null);
let name = [], emptyName = [] let name = [], emptyName = []
// const name = data?.map(d) // const name = data?.map(d)
@ -43,13 +43,13 @@ const PieChart = (props) => {
a: { a: {
color: '#E9F7FF', color: '#E9F7FF',
fontSize: 14, fontSize: 14,
padding:[0,2] padding: [0, 2]
}, },
b: { b: {
fontSize: 16, fontSize: 16,
fontFamily: 'YouSheBiaoTiHei', fontFamily: 'YouSheBiaoTiHei',
color: '#fff', color: '#fff',
padding:[0,0,0,10] padding: [0, 0, 0, 10]
}, },
} }
} }
@ -57,40 +57,17 @@ const PieChart = (props) => {
grid: { grid: {
left: '10%' left: '10%'
}, },
// title: [
// {
// text: text,
// top: "58%",
// left: '16%',
// textStyle: {
// color: "#E9F7FF",
// fontSize: 14,
// },
// },
// {
// text: total,
// top: "40%",
// left: '10%',
// textStyle: {
// fontSize: "30",
// color: "#FFFFFF",
// fontFamily: "YouSheBiaoTiHei",
// },
// },
// ],
graphic: { graphic: {
elements: [ elements: [
{ {
type: 'image', type: 'image',
style: { style: {
image: 'assets/images/quanju/chart-circle.png', image: 'assets/images/quanju/chart-circle.png',
width: 120, width: 110,
height: 120, height: 110,
align: 'center', align: 'center',
// x:90,
// y:100
}, },
left: '14%', left: '12.8%',
top: 'center', top: 'center',
bounding: 'raw' bounding: 'raw'
@ -104,8 +81,8 @@ const PieChart = (props) => {
fill: '#fff', fill: '#fff',
font: '12px "YouSheBiaoTiHei", sans-serif', font: '12px "YouSheBiaoTiHei", sans-serif',
}, },
left: '17%', left: textLeft,
top: '55%', top: '58%',
}, },
{ {
type: 'text', type: 'text',
@ -115,7 +92,7 @@ const PieChart = (props) => {
fill: '#fff', fill: '#fff',
font: '20px "YouSheBiaoTiHei", sans-serif', font: '20px "YouSheBiaoTiHei", sans-serif',
}, },
left: '18.5%', left: numLeft,
top: 'center', top: 'center',
}, },
], ],
@ -142,7 +119,7 @@ const PieChart = (props) => {
data: emptyName, data: emptyName,
}, },
{ {
name: "已绿化里程统计", name: text,
type: "pie", type: "pie",
radius: ["65%", "75%"], radius: ["65%", "75%"],
center: ['25%', '50%'], center: ['25%', '50%'],

2
web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js

@ -36,6 +36,8 @@ const LeftBottom = (props) => {
text='已绿化里程' text='已绿化里程'
total={totalData?.toFixed(3) || 0} total={totalData?.toFixed(3) || 0}
colorList={colorList} colorList={colorList}
textLeft={'20%'}
numLeft={'16%'}
underColorList={underColorList} underColorList={underColorList}
/> />
</Module> </Module>

2
web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js

@ -56,6 +56,8 @@ const RightBottom = (props) => {
width='100%' width='100%'
height='100%' height='100%'
text='养护总数' text='养护总数'
textLeft={'21%'}
numLeft={'23%'}
total={totalData || 0} total={totalData || 0}
colorList={colorList} colorList={colorList}
underColorList={underColorList} underColorList={underColorList}

Loading…
Cancel
Save