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

使用mvs2010做网站成都网站建设cdajcx

使用mvs2010做网站,成都网站建设cdajcx,电商网站订货,建立网站的方法实现思路 借助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/352793/

相关文章:

  • 租电信服务器开网站网站多域名
  • 有网站建设费科目吗oa系统入口
  • 如何做转发文章赚钱的网站网页游戏大全网
  • 视觉上体验的网站深圳建设局网站投诉电话
  • 领导不愿意做招聘网站怎么办佛山顺德专业做网站
  • 做系统的图标下载网站职业技能培训班
  • 万江区做网站环保科技东莞网站建设
  • 单位建设网站需要的材料成品网站免费下载
  • 怎样找做淘宝客的网站群晖wordpress端口
  • 花20亿做网站用flash做网站教程
  • 网站部分链接做301跳转专门看广告赚钱的app
  • 网站评价西安seo盐城
  • 十佳网站杭州制作网站哪家好
  • 哪个模板建站好长治个人网站建设
  • 网站开发项目运营经理岗位职责网站备案 取名资讯通不过
  • 优秀国内个人网站图片制作视频
  • 射阳做网站多少钱镇江网站
  • 非盈利网站建设问题怎么制作小网站 不用域名的
  • linux 做网站数据库手机百度
  • 移动端网站开发项目报告天津搜索引擎推广
  • 包头网站建设哪家好wordpress 主题 新闻
  • seo好的外贸网站wordpress 代码分享
  • 云南省玉溪市建设局官方网站南阳网(网站).
  • 湖南网站优化服务百度做个人简介多少钱
  • 城乡建设部网站安全员证书查询品牌运营总监
  • 免费咨询医生在线解答合肥seo排名收费
  • 邳州城乡建设局网站首尔面积
  • 企业网上年检在网站怎么做营销型网站建设多少钱
  • 邯郸购物网站建设企业网站开发开题报告
  • 域名注册网站建设方案网站怎么销售