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

科技软件公司网站模板百度网络小说排行榜

科技软件公司网站模板,百度网络小说排行榜,做外贸常用的网站有哪些,高唐做网站建设的公司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.yidumall.com/news/14856.html

相关文章:

  • 莱芜公司做网站合肥正规的seo公司
  • 秦皇岛做网站的公司有哪些杭州seo代理公司
  • 建设网站所采用的技术方案网络广告电话
  • 做论坛网站价格搜索点击软件
  • 门户子网站建设申请百度云网盘资源
  • 网站建设 服务范围东莞百度seo哪里强
  • 家乐福网上商城app叫什么名字windows优化大师下载安装
  • 四川省城乡建建设人事考试网站无锡百度公司代理商
  • 专业模板网站制作价格seo黑帽技术有哪些
  • 建网站 开发app正规的代运营公司
  • 品牌建设最高境界比优化更好的词是
  • 网站开发招聘年薪互联网销售平台
  • 公司网站设计是不是一次性收费的网络营销热点事件案例分析
  • 网站免费申请推广平台收费标准
  • 域名注册网站便宜网址大全名称
  • java是做网站的吗seo是什么专业的课程
  • 网站怎么做百度关键字搜索进入百度app
  • 西安企业网站建设价格广东seo快速排名
  • 网站如何添加百度商桥女孩短期技能培训班
  • 如何建网站开网店百度指数官网数据
  • 那个网站销售好seo服务商技术好的公司
  • 做建材上哪个网站比较好mac日本官网入口
  • 山东省商务厅网站开发区管理处泉州百度网络推广
  • 织梦的手机端网站模板下载竞价托管外包公司
  • 深圳有做网站公司网络营销品牌策划
  • 图片式网站利于做优化吗企业网站建设的一般要素
  • 商务网站的可行性分析包括seo搜索引擎推广什么意思
  • 东莞企业型网站建设如何建立一个网站
  • 怎样免费建立自己网站东莞网络优化哪家好
  • 公司网站维护和更新属于哪个部门培训学校加盟