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

wordpress增肥主题seo优化上首页

wordpress增肥主题,seo优化上首页,cms监控系统电脑版,南宁网站排名优化公司哪家好【Echarts系列】水平柱状图 序示例数据格式代码 序 为了节省后续开发学习成本,这个系列将记录我工作所用到的一些echarts图表。 示例 水平柱状图如图所示: 数据格式 data [{name: 于洪区,value: 2736},{name: 新民市,value: 2844},{name: 皇姑区,…

【Echarts系列】水平柱状图

    • 示例
    • 数据格式
    • 代码

为了节省后续开发学习成本,这个系列将记录我工作所用到的一些echarts图表。

示例

水平柱状图如图所示:
在这里插入图片描述

数据格式

data = [{'name': '于洪区','value': 2736},{'name': '新民市','value': 2844},{'name': '皇姑区','value': 2889},{'name': '沈河区','value': 3143}]

代码

Vue版本以及脚本语言的选择各有不同,核心内容主要是option,重点关注该部分内容即可。

<template><div class="chart" ref="horizontalBarRef"></div>
</template><script lang="ts">
import { Component, Prop, Ref, Vue, Watch } from 'vue-property-decorator'
import echarts from 'echarts'@Component({name: 'HorizontalBar',components: {}
})
export default class HorizontalBar extends Vue {@Prop() data!: any@Prop({ default: () => ['rgba(72, 133, 201, 0.6)', 'rgba(72, 133, 201, 1)']}) colors?: any[]@Ref() horizontalBarRef!: any//此处监听是为了在有状态切换时,例如时间年份或其他条件改变时,能够让Echarts图表重新渲染@Watch('data')onDataChange() {this.createHorizontalBarChart()}private chart: any = {}createHorizontalBarChart() {this.chart = echarts.init(this.horizontalBarRef)const data = this.datalet names = []let values = []data.forEach(item => {names.push(item.name)values.push(item.value)})const option = {tooltip: {trigger: 'axis',axisPointer: {type: 'shadow'},confine: true,         //让提示框恒定在网格容器内,【针对显示不全或者被遮盖问题】},grid: {left: 20,right: 40,top: 0,bottom: 20,containLabel: true     //网格边距包含坐标标签},xAxis: {axisTick: {show: false          //是否显示X轴坐标刻度},axisLabel: {show: false		   //是否显示X轴坐标标签},axisLine: {show: false		   //是否显示X轴轴线},splitLine: {lineStyle: {type: 'dashed'	   //以虚线形式展示X轴在网格中的分隔线}}},yAxis: {type: 'category',data: names,axisTick: {show: false,alignWithLabel: true    //刻度与坐标标签对齐},axisLine: {show: true,lineStyle: {color: '#757790',     //设置Y轴轴线样式width: 2}},axisLabel: {textStyle: {color: '#757790',	 //设置Y轴坐标标签样式fontSize: 14}},splitLine: {show: false			//是否展示Y轴方向上的分隔线}},series: [{type: 'bar',barWidth: 10,itemStyle: {color: {type: 'linear',			//设置柱状条的渐变颜色x: 0,y: 0,x2: 1,y2: 0,colorStops: [{ offset: 0, color: this.colors[0] }, // 0% 处的颜色{ offset: 1, color: this.colors[1] } // 100% 处的颜色],global: false // 缺省为 false}},label: {show: true,				//展示柱状条数值信息position: 'right',color: '#12121D',fontSize: 14},data: values}]}this.chart.setOption(option)}mounted() {this.createHorizontalBarChart()window.addEventListener('resize', this.chartResize)}beforeDestroy() {if (this.chart) {window.removeEventListener('resize', this.chartResize)this.chart.dispose()}}chartResize() {if (this.chart) {this.chart.resize()}}
}
</script>
<style lang="scss" scoped>
.chart {width: 100%;height: 300px;
}
</style>
http://www.hkea.cn/news/227728/

相关文章:

  • html语言做网站石嘴山网站seo
  • 做最好的言情网站官网seo优化
  • 云南建设监理协会网站营销失败案例分析
  • 怎么样做淘宝优惠券网站搜索引擎营销的优缺点
  • wordpress动态订单seo社区
  • 网站域没到期不能续费吗google谷歌搜索
  • 厦门好的做网站公司网络营销推广方式都有哪些
  • 重庆市建设工程信息官网站自己做网站的流程
  • 网站建设公司怎么做网络营销网站推广
  • 360应用商店seo服务套餐
  • 废橡胶网站建设个人博客网页设计
  • 什么网站做一手项目好域名查询官网
  • 做日用品的要找什么网站好站长工具端口检测
  • 贵州软件开发 网站开发手机版百度一下
  • 企业网站建立答辩问题百度怎么发布广告
  • 温州快建网站地推拉新接单网
  • 濉溪县城乡建设委员会燃气办网站热狗网站排名优化外包
  • 网站能不能自己做免费的seo教程
  • 湖南的商城网站建设优化教程网下载
  • 做网站需要哪些工程师西安seo诊断
  • tp做的网站封装成app2023北京封控了
  • 增城做网站要多少钱推广普通话手抄报
  • 石家庄网站系统开发智能搜索引擎
  • 迅速网站网络营销平台推广方案
  • 学前端要逛那些网站微信引流主动被加软件
  • 韩国flash网站免费手机网站建站平台
  • 东莞做网站卓诚网络昆明长尾词seo怎么优化
  • WordPress个性萌化插件郑州seo优化哪家好
  • 专业手机移动网站建设免费的seo优化
  • 西安网站建设王永杰域名注册 万网