提交 9587448d authored 作者: coderBryanFu's avatar coderBryanFu

update

上级 6a02483e
...@@ -64,7 +64,7 @@ const routes = [ ...@@ -64,7 +64,7 @@ const routes = [
{ {
path: '/', path: '/',
redirect: '/overView' redirect: '/billHome'
}, },
// 中美博弈概览页面路由 // 中美博弈概览页面路由
......
...@@ -328,6 +328,7 @@ ...@@ -328,6 +328,7 @@
/> />
</el-select> </el-select>
</div> </div>
<div class="box7-main" id="box7Chart"></div>
</div> </div>
<div class="box8"> <div class="box8">
<div class="box8-header"> <div class="box8-header">
...@@ -529,6 +530,7 @@ import headerIcon5 from "./assets/icons/header-icon5.png"; ...@@ -529,6 +530,7 @@ import headerIcon5 from "./assets/icons/header-icon5.png";
import getMultiLineChart from "./utils/multiLineChart"; import getMultiLineChart from "./utils/multiLineChart";
import getWordCloudChart from "./utils/worldCloudChart"; import getWordCloudChart from "./utils/worldCloudChart";
import getPieChart from "./utils/piechart"; import getPieChart from "./utils/piechart";
import getDoublePieChart from "./utils/doublePieChart";
import bill1 from "./assets/images/bill1.png"; import bill1 from "./assets/images/bill1.png";
import bill2 from "./assets/images/bill2.png"; import bill2 from "./assets/images/bill2.png";
...@@ -1068,6 +1070,83 @@ const box9ChartData = ref([ ...@@ -1068,6 +1070,83 @@ const box9ChartData = ref([
} }
]); ]);
const box7Data = ref([
[
{
name: '众议院',
value: 298
},
{
name: '参议院',
value: 149
}
],
[
{
name: '拨款委员会',
value: 50,
type: '众议院'
},
{
name: '筹款委员会',
value: 50,
type: '众议院'
},
{
name: '外交事务委员会',
value: 46,
type: '众议院'
},
{
name: '国土安全委员会',
value: 40,
type: '众议院'
},
{
name: '司法委员会',
value: 40,
type: '众议院'
},
{
name: '军事委员会',
value: 40,
type: '众议院'
},
{
name: '能源和商业委员会',
value: 32,
type: '众议院'
},
{
name: '拨款委员会1',
value: 32,
type: '参议院'
},
{
name: '财政委员会',
value: 31,
type: '参议院'
},
{
name: '能源',
value: 30,
type: '参议院'
},
{
name: '能源1',
value: 30,
type: '参议院'
},
{
name: '其他',
value: 24,
type: '参议院'
}
]
])
const box8Data = ref([ const box8Data = ref([
{ {
name: "汤姆·科顿", name: "汤姆·科顿",
...@@ -1124,6 +1203,9 @@ onMounted(async () => { ...@@ -1124,6 +1203,9 @@ onMounted(async () => {
const wordCloudChart = getWordCloudChart(wordCloudData.value); const wordCloudChart = getWordCloudChart(wordCloudData.value);
setChart(wordCloudChart, "wordCloudChart"); setChart(wordCloudChart, "wordCloudChart");
const box7Chart = getDoublePieChart(box7Data.value[0], box7Data.value[1])
setChart(box7Chart, 'box7Chart')
const box9Chart = getPieChart(box9ChartData.value, box9ChartColorList.value); const box9Chart = getPieChart(box9ChartData.value, box9ChartColorList.value);
setChart(box9Chart, "box9Chart"); setChart(box9Chart, "box9Chart");
}); });
...@@ -2253,6 +2335,9 @@ onMounted(async () => { ...@@ -2253,6 +2335,9 @@ onMounted(async () => {
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
} }
.box7-main{
height: 340px;
}
} }
.box8 { .box8 {
width: 527px; width: 527px;
......
const getDoublePieChart = (data) => {
const colorList = ['#8AC4FF','#FFD591'] const getDoublePieChart = (data1, data2) => {
const colorList1 = ['#055FC2','#FFA940'] const colorList = ['#8AC4FF', '#FFD591']
const colorList1 = ['#055FC2', '#FFA940']
let option = { let option = {
series: [ series: [
{ {
type: 'pie', type: 'pie',
radius: [70, 100], radius: [25, 68],
height: '100%', // height: '100%',
left: 'center', left: 'center',
width: '100%', // width: '100%',
itemStyle: { itemStyle: {
borderColor: '#fff', borderColor: '#fff',
borderWidth: 1 borderWidth: 1
}, },
label: { label: {
alignTo: 'edge', position: 'inside',
formatter: '{name|{b}}\n{time|{c} 条 {d}%}', textStyle: {
minMargin: 5, fontSize: '16px',
edgeDistance: 10, fontWeight: 700,
lineHeight: 15, // color: '#333'
rich: {
time: {
fontSize: 10,
color: '#999'
} }
} },
}, data: data1.map(item => {
labelLine: { return {
length: 15, name: item.name,
length2: 0, value: item.value,
maxSurfaceAngle: 80 itemStyle: {
}, color: item.name === '参议院' ? '#055FC2' : '#FFA940'
labelLayout: function (params) { }
const isLeft = params.labelRect.x < 556 / 2; }
const points = params.labelLinePoints; })
// Update the end point.
points[2][0] = isLeft
? params.labelRect.x
: params.labelRect.x + params.labelRect.width;
return {
labelLinePoints: points
};
}, },
data: data {
}] type: 'pie',
radius: [70, 100],
height: '100%',
left: 'center',
width: '80%',
itemStyle: {
borderColor: '#fff',
borderWidth: 1
},
label: {
alignTo: 'edge',
formatter: '{name|{b}}\n{time|{c} 条 {d}%}',
minMargin: 5,
edgeDistance: 10,
lineHeight: 15,
rich: {
time: {
fontSize: 10,
color: '#999'
}
}
},
labelLine: {
length: 15,
length2: 0,
maxSurfaceAngle: 80
},
labelLayout: function (params) {
const isLeft = params.labelRect.x < 556 / 2;
const points = params.labelLinePoints;
// Update the end point.
points[2][0] = isLeft
? params.labelRect.x
: params.labelRect.x + params.labelRect.width;
return {
labelLinePoints: points
};
},
data: data2.map(item => {
return {
name: item.name,
value: item.value,
itemStyle: {
color: item.type === '参议院' ? '#8AC4FF' : '#FFD591'
}
}
})
}
]
} }
return option return option
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论