当前位置: 首页 > news >正文

科技软件公司网站模板南京百度竞价推广公司排名

科技软件公司网站模板,南京百度竞价推广公司排名,centos7是怎么做网站的,梵克雅宝官网四叶草手链1 前言 本章主要对常用的echars图表展示进行基本的组件封装。使用该组件前需要在项目中引入echarts。官网:Apache ECharts npm install echarts --save 2 图表组件 2.1 折线图组件 组件属性:chartId,指定图表挂载div的id,注意不…

1 前言

        本章主要对常用的echars图表展示进行基本的组件封装。使用该组件前需要在项目中引入echarts。官网:Apache ECharts

npm install echarts --save

2 图表组件

2.1 折线图组件

        组件属性:chartId,指定图表挂载div的id,注意不要出现重复。当获取到数据后,在父组件中调用该组件的initChart() 方法,初始化图表。方法参数格式范例:

{"xAxis":['项1', '项2', '项3'], "yAxis":[12, 11, 122]    
}
  • xAxis:横坐标名称
  • yAxis:每项对应的数据量

        组件代码:

<script setup lang="ts">
import * as echarts from 'echarts'const props = defineProps<{chartId: string
}>()const initChart = (data: any) => {const chartDom = document.getElementById(props.chartId);var myChart = echarts.init(chartDom);var option;option = {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},xAxis: {type: 'category',data: data.xAxis,},yAxis: {type: 'value'},series: [{data: data.yAxis,type: 'line'}]};option && myChart.setOption(option);
}defineExpose({ initChart })
</script><template><div :id="chartId" style="width: 100%; height: 100%"></div>
</template><style scoped></style>

 2.2 柱状图组件

        组件属性:chartId,指定图表挂载div的id,注意不要出现重复。当获取到数据后,在父组件中调用该组件的initChart() 方法,初始化图表。方法参数格式范例:

{"xAxis":['项1', '项2', '项3'], "yAxis":[12, 11, 122]    
}
  • xAxis:横坐标名称
  • yAxis:每项对应的数据量

        组件代码:

<script setup lang="ts">
import * as echarts from 'echarts'const props = defineProps<{chartId: string
}>()const initChart = (data: any) => {const chartDom = document.getElementById(props.chartId);var myChart = echarts.init(chartDom);var option;option = {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'}},xAxis: {type: 'category',data: data.xAxis,},yAxis: {type: 'value'},series: [{data: data.yAxis,type: 'bar'}]};option && myChart.setOption(option);
}defineExpose({ initChart })
</script><template><div :id="chartId" style="width: 100%; height: 100%"></div>
</template><style scoped></style>

 

2.3 饼图组件

        组件属性:chartId,指定图表挂载div的id,注意不要出现重复。当获取到数据后,在父组件中调用该组件的initChart() 方法,初始化图表。方法参数格式范例:

[{ value: 1048, name: '数据项1' },{ value: 735, name: '数据项2' },{ value: 580, name: '数据项3' },{ value: 484, name: '数据项4' },{ value: 300, name: '数据项5' }]

        组件代码:

<script setup lang="ts">
import * as echarts from 'echarts'const props = defineProps<{chartId: string
}>()const initChart = (data: any) => {type EChartsOption = echarts.EChartsOption;const chartDom = document.getElementById(props.chartId)!const myChart = echarts.init(chartDom)let option: EChartsOptionoption = {tooltip: {trigger: 'item'},legend: {top: '5%',left: 'center'},series: [{name: '数据量',type: 'pie',radius: ['40%', '70%'],avoidLabelOverlap: false,itemStyle: {borderRadius: 10,borderColor: '#fff',borderWidth: 2},label: {show: false,position: 'center'},emphasis: {label: {show: true,fontSize: 20,fontWeight: 'bold'}},labelLine: {show: false},data: data}]}option && myChart.setOption(option)
}defineExpose({ initChart })
</script><template><div :id="chartId" style="width: 100%; height: 100%"></div>
</template><style scoped></style>

http://www.dt0577.cn/news/12621.html

相关文章:

  • 临沂网站设计网络运营需要学什么
  • 校园网站建设情况统计表外贸推广建站
  • 网页特效管理系统信息流优化师培训
  • 临汾市住房城乡建设局网站推广网站平台
  • wordpress更新php版本号宁波seo公司网站推广
  • 免费网站制作教程南宁网络优化seo费用
  • 做360手机网站优化厦门人才网唯一官网招聘
  • 修改wordpress 字体太原百度seo排名软件
  • 政府网站集约化建设通知百度左侧排名
  • 网站qq 微信分享怎么做的找资源最好的是哪个软件
  • 郴州网站建设手机端关键词排名优化
  • idc 网站备案限制百度账户代运营
  • 京东seo搜索优化seo点击软件手机
  • 网站做外链的技巧2022年十大网络流行语发布
  • 杭州建设网站网址申请注册
  • 济南专门做网站的公司百度经验首页官网
  • 资阳做网站1+x网店运营推广
  • 网站首页页脚设计培训课程网站
  • cco网站素材电脑版百度网盘
  • bl 做视频网站有哪些免费网站可以发布广告
  • 北京市网站制作设计谷歌google地图
  • 福州网站制作设计拉新项目官方一手平台
  • 网站分析总结重庆店铺整站优化
  • 企业网站代码模板安卓优化软件
  • 孝感网站建设孝感搜收录网
  • wordpress 仿小米优化大师官网登录入口
  • 厦门做网站个人推广文案范例
  • 网站里面的链接怎么做的yande搜索引擎官网入口
  • 网站建设易网宣seo北京公司
  • 全国城市雕塑建设指导委员会网站头条站长平台