Vue中Echarts修改宽高
发布日期:2021-06-30 15:52:55 浏览次数:2 分类:技术文章

本文共 1057 字,大约阅读时间需要 3 分钟。

methods:{
initChartContainer(chart, w, h) {
if(chart) {
chart.style.width = w + "vw"; chart.style.height = h + "vh"; } }, initFiveChart() {
this.initChartContainer(this.$refs.publicationInfoMainChartFive); this.fiveChart = this.$echarts.init(document.getElementById("publicationInfoMainChartFive")); const _fiveChart = this.fiveChart; const option = {
xAxis: {
type: 'category', data: ['高危', '中危', '低危'] }, yAxis: {
type: 'value' }, series: [{
type: "bar", data: [ {
value: this.dataArr.恶意网络资源.恶意IP.高危数量, itemStyle: {
color: '#a90000'} }, {
value: this.dataArr.恶意网络资源.恶意IP.中危数量, itemStyle: {
color: '#f66d6d'} }, {
value: this.dataArr.恶意网络资源.恶意IP.低危数量, itemStyle: {
color: '#fcc2c2'} }], label: {
show: true, position: 'top', }, }] }; _fiveChart.setOption(option); } }

使用initChartContainer根据修改w和h调整图标宽高

转载地址:https://kaisarh.blog.csdn.net/article/details/117648597 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Django:django.db.utils.OperationalError: (1050, “Table ‘malicious_software_db‘ already exists“)
下一篇:MySQL查询日期类数据常用函数

发表评论

最新留言

网站不错 人气很旺了 加油
[***.192.178.218]2024年04月29日 02时03分45秒