您的位置:首页 > 新闻 > 会展 > 注册新公司流程_福州自助建设网站_如何做网站平台_怎么做微信推广和宣传

注册新公司流程_福州自助建设网站_如何做网站平台_怎么做微信推广和宣传

2024/10/13 21:10:21 来源:https://blog.csdn.net/weixin_54372875/article/details/142870994  浏览:    关键词:注册新公司流程_福州自助建设网站_如何做网站平台_怎么做微信推广和宣传
注册新公司流程_福州自助建设网站_如何做网站平台_怎么做微信推广和宣传

文章目录

  • 前言
  • 代码实现
  • 实现效果
  • 总结


前言

最近项目有做数据可视化 大屏 不免再次使用些echarts应用 记录下其中echarts雷达图的实现


代码实现

先上代码

<template><div class="container"><div ref="chart" style="width: 500px; height: 500px; margin-top: 20px"></div></div>
</template><script>
export default {name: 'testDemo',data() {return {};},methods: {initChart() {this.chart = this.$echarts.init(this.$refs.chart);const option = {color: ['#FFC481', '#8EC6F8', '#56D8CD'],title: {x: 'center',y: 'center',textStyle: {fontSize: 12,rich: {a: {color: '#0066FF',fontSize: 18,align: 'center',},b: {color: '#00BBFF',fontSize: 12,height: 16,align: 'centerc',},c: {color: 'orange',fontSize: 12,height: 16,align: 'center',},},},},// 配置图例legend: {},radar: {indicator: [{name: '资本背景', max: 100, min: 0, index: 0, axisLabel: {show: true}}, //显示刻度{name: '知识产权', max: 100, min: 0, index: 1},{name: '成长性', max: 100, min: 0, index: 2},{name: '风险状况', max: 100, min: 0, index: 3},{name: '经营质量', max: 100, min: 0, index: 4},{name: '企业规模', max: 100, min: 0, index: 5},],radius: 80, //大小startAngle: 120, // 雷达图的旋转偏移量splitNumber: 5, // 分层5层,当前最大1000,可理解为每层200triggerEvent: true,name: {formatter: (value, indicator) => {// 获取对应的数值const valueAtIndex = this.radarData[indicator.index];return `{a|${value}}: {b|${valueAtIndex}}`; // 显示名称和对应的数值},rich: {a: {color: '#333',fontSize: 12,},b: {color: '#333',fontSize: 12,},},},},textStyle: {color: '#333333',},series: [{type: 'radar',areaStyle: {normal: {//添加阴影效果的配置部分color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0, color: 'rgba(255, 196, 129, 0.8)'},{offset: 1, color: 'rgba(255, 196, 129, 0.3)'},]),opacity: 0.8,},},data: [{value: [34,23,34,87,68,67],},],},],};this.chart.setOption(option);}},mounted() {// 等dom渲染后再初始化图表this.initChart()}
};
</script><style scoped>
</style>

实现效果

在这里插入图片描述


总结

initChart方法中,使用this.$echarts.init来初始化一个ECharts实例,并设置图表的配置项option。这些配置项定义了图表的标题、提示框、雷达图的指标、名称的富文本样式、全局文本样式以及系列列表等。最后,通过this.chart.setOption(option)将配置项应用到图表实例上

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com