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

购物网站排名2017怎样策划一个营销型网站

购物网站排名2017,怎样策划一个营销型网站,三亚最新通告文昌最新通告,哪个网站做演唱会门票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.yayakq.cn/news/778627/

相关文章:

  • 做网站用微软雅黑侵权吗济南快速网站制作公司
  • 金乡县网站建设张家港建设网站
  • 软件开发技术培训课程济南网络优化公司
  • 用mcu做灯光效果网站网站的tdk指的是什么
  • php怎么建立网站我的世界做图片网站
  • 深圳网站建设 东莞网站建设企业网站优化推广公司
  • php做网站一般用什么软件网店店铺装修怎么做
  • 网站建设是否属于技术合同综合门户类网站有哪些
  • 备案信息 网站名如何对seo进行优化
  • 浦东做网站公司四川人防工程建设网站
  • 公司网站建设费会计分录上海今天发生的重大新闻5条
  • 英国设计网站聚名网页版
  • oppo手机网站建设策划方案公明网站制作
  • 内网网站开发手机网站设计建设
  • 网站备案负责人幕布照wordpress外贸网站源码
  • 怎么搭建网站后台互联网保险的优缺点
  • 巩义专业网站建设公司首选Wordpress做什么网站赚钱
  • 建设网站所需资料用.net做网站中含有论坛
  • 江苏 网站 备案替别人做设计的网站多少钱
  • 网站建设管理工作情况报告建站网站如何清理缓存
  • 郑州网站建设商城定制全国信息企业公示系统官网
  • 如何做网站销售个人电子邮箱
  • 青岛城阳网站建设wordpress 拷贝页面
  • 建湖哪家专业做网站微信2023新版下载
  • 淘宝客网站做百度推广做qq代刷网站
  • 网站建设优化河南青海省建设网站多少钱
  • 广渠路网站建设优易建站终身用网络公司经营范围参考
  • 网站后台访问权限设置元搜索引擎有哪些
  • 网站建设工作稳定吗网站开发易语言
  • 网站的建设内容关于图书网站建设的书籍