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

dedecms网站栏目管理wordpress 高性能

dedecms网站栏目管理,wordpress 高性能,WordPress主题(模板)制作教程,微信怎么开店实现思路 借助echarts.min.js 搭配l-echart进行配置 废话不多说上代码后自己百度了解配置项的意思就好 下面代码是折线图的 &#xff0c;柱状图和它一摸一样&#xff0c;只需要把line换成bar就好 <template><l-echart ref"chart"></l-echart> …

实现思路

借助echarts.min.js 搭配l-echart进行配置

废话不多说上代码后自己百度了解配置项的意思就好

下面代码是折线图的 ,柱状图和它一摸一样,只需要把line换成bar就好

<template><l-echart ref="chart"></l-echart>
</template>
<script>
import * as echarts from '@/uni_modules/lime-echart/static/echarts.min.js'
export default {props: {// 以下注释部分是从父组件传递过来的options 这仅仅是一个示例 可以很好的展示ui效果options: {type: Object,default: () => {return null}}},data() {return {chart: null}},mounted() {this.$nextTick(() => {this.initChart()})},watch: {options: {handler(n) {if (n) {this.$nextTick(() => {this.initChart()})}},deep: true}},methods: {initChart() {const {labelX,data1,data2,legends,tipLegends,legendIcon,legendWidth,legendColor,gridLeft,gridRight,axisColor,splitColor,lineColor1,lineColor2,formatterAfterTextArr// labels} = this.optionsconst series = [{type: 'line',name: (legends && legends[0].name) || tipLegends,data: data1,symbolSize: 6,smooth: true,areaStyle: {color: 'rgba(' + (lineColor1 || '60, 127, 252') + ', 0.2)'},lineStyle: {color: 'rgba(' + (lineColor1 || '60, 127, 252') + ', 1)'},itemStyle: {color: 'rgba(' + (lineColor1 || '60, 127, 252') + ', 1)'}}]if (data2) {series.push({type: 'line',name: legends && legends[1].name,data: data2,symbolSize: 6,smooth: true,areaStyle: {color: 'rgba(' + (lineColor2 || '254, 189, 145') + ', 0.2)'},lineStyle: {color: 'rgba(' + (lineColor2 || '254, 189, 145') + ', 1)'},itemStyle: {color: 'rgba(' + (lineColor2 || '254, 189, 145') + ', 1)'}})}this.$refs.chart.init(echarts, (chart) => {this.chart = chartthis.chart.setOption({animation: false,tooltip: {trigger: 'axis',// 使用mousemove时,左右滑动会导致图表消失triggerOn: 'click',formatter:formatterAfterTextArr && formatterAfterTextArr.length > 0? function (params) {// x轴文字var result = params[0].axisValue + '\n'params.forEach(function (item) {/*** marker:图例样式;* seriesName:series中每一项的name;* value:data数据中value字段* formatterAfterTextArr: value之后需要补充的文字,数组格式* seriesIndex: series数据索引,当有多条series数据时,会自动获取当前选中索引*/result += `${item.marker}${item.seriesName}:${item.value}${formatterAfterTextArr[item.seriesIndex]}`})return result}: null},legend: legends && {top: '5%', // 控制 板块控制器的位置right: 'center',data: legends,icon: legendIcon || 'roundRect',itemWidth: legendWidth || 14,itemHeight: 8,itemGap: 24, //设置两个legend之间的间距textStyle: {fontSize: 12,color: legendColor || '#69748A',padding: [3, 0, 0, 0],rich: {}}},grid: {left: gridLeft || '5%',top: legends ? '20%' : '10%',right: gridRight || '8%',bottom: '5%',containLabel: true},xAxis: [{type: 'category',boundaryGap: false, // 两端空白axisTick: {show: false},axisLine: {show: false},axisLabel: {color: axisColor || '#333333',fontSize: 12,margin: 10},data: labelX || ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],}],yAxis: [{type: 'value',minInterval: 1,axisTick: {show: false},axisLabel: {color: axisColor || '#333333',fontSize: 12,margin: 10},axisLine: {show: false},splitLine: {lineStyle: {type: 'dashed',dashOffset: 20, // 设置虚线的起始偏移量gap: 20, // 设置虚线间的距离color: [splitColor || '#ccc']},},splitArea: { show: false }}],series: series})})}}
}
</script>

饼图和柱状图也基本一样 稍微改改就好,很简单。大家可以自己搜索,我这里放的是四个之中相对复杂的,也是摸索了一整子,下面附上效果图,希望能帮到大家。

http://www.yayakq.cn/news/510833/

相关文章:

  • 免费大数据网站承德微网站建设
  • 婚庆企业网站建设网站文字编辑怎么做
  • 网站建设 深路互动互联网行业都有哪些专业
  • 信用泰安网站顺网网页游戏大厅
  • 网站建设维护要加班吗需要品牌网站建设
  • 网页设计公司企业文化山西seo优化
  • discuz网站ip中国能建官网
  • 河北建设官方网站梧州论坛最新主题
  • 网站后台无法审核合肥网站建设公司 招聘
  • 做网站一定要注册域名吗淘宝如何刷关键词增加权重
  • 做wap网站动漫设计与制作是什么
  • 河南省做网站的企业需要网站建设
  • 长寿做网站的电话橙色在网站中的应用
  • 免费国外医疗静态网站模板下载长沙网站公司
  • 建设门户公司网站做优惠券网站如何引流
  • 网页建站要多久服务器怎么设置ip做网站
  • 柯林wap建站程序个人版大连公司网站建设
  • 石家庄网站建设诚荐优度网络wordpress后台添加logo
  • 迅速百度网站自然排名如何快速找到做网站的客户
  • 浙江省建设工程监理协会网站教育网站建设 培训网站建设
  • 闽侯县网站建设wordpress登录攻击
  • 做网站需知cad软件
  • 网站名称图标如何做才能显示那有网页设计培训机构
  • 可以把网站生成软件品牌传播推广方案
  • 乐清网站改版公司深圳做网页
  • 网站开发前端跟后端的区别如何重新编辑wordpress
  • 门户网站开发合同自建网站公司
  • 企业商城网站建设方案网站pv统计方法
  • 建设电子商务网站的意义域名注册的流程
  • 主机屋网站搭建设置百度云虚拟主机