From 3fbe48a9dcaa112c447b41f3d6bafacf74408178 Mon Sep 17 00:00:00 2001 From: WX <1377869194@qq.com> Date: 星期五, 15 九月 2023 17:13:30 +0800 Subject: [PATCH] 1 --- src/components/BarGraph.vue | 47 ++++++++++++++++++++++++++++++----------------- 1 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/components/BarGraph.vue b/src/components/BarGraph.vue index 10dfe43..6041010 100644 --- a/src/components/BarGraph.vue +++ b/src/components/BarGraph.vue @@ -1,4 +1,7 @@ <template> + <div class="title"> + {{ layerData.layerName }} + </div> <div :id="`myEcharts${chartsId}`" :style="{ width: width, height: height }" @@ -119,22 +122,22 @@ "purple-passion" ); chart.setOption({ - title: { - text: props.layerData.layerName, - left: "center", - textStyle: { - //鏂囧瓧棰滆壊 - color: "#fff", - // //瀛椾綋椋庢牸,'normal','italic','oblique' - // fontStyle: "normal", - // //瀛椾綋绮楃粏 'normal','bold','bolder','lighter',100 | 200 | 300 | 400... - // fontWeight: "bold", - // //瀛椾綋绯诲垪 - // fontFamily: "sans-serif", - // //瀛椾綋澶у皬 - // fontSize: 18, - }, - }, + // title: { + // text: props.layerData.layerName, + // left: "center", + // textStyle: { + // //鏂囧瓧棰滆壊 + // color: "#fff", + // // //瀛椾綋椋庢牸,'normal','italic','oblique' + // // fontStyle: "normal", + // // //瀛椾綋绮楃粏 'normal','bold','bolder','lighter',100 | 200 | 300 | 400... + // // fontWeight: "bold", + // // //瀛椾綋绯诲垪 + // // fontFamily: "sans-serif", + // // //瀛椾綋澶у皬 + // fontSize: 14, + // }, + // }, legend: { // data: xAxisData.value, }, @@ -191,4 +194,14 @@ }; } </script> -<style lang="less" scoped></style> +<style lang="less" scoped> +.title { + width: 100%; + word-wrap: break-word; + text-align: center; + color: #fff; + font-size: 14px; + padding: 0 20px; + box-sizing: border-box; +} +</style> -- Gitblit v1.9.3