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

江门做网站公司盘多多网盘搜索

江门做网站公司,盘多多网盘搜索,服装设计有哪些网站,怎么给一个网站做seoECharts:一个基于 JavaScript 的开源可视化图表库。 目录 效果 一、介绍 1、官方文档:Apache ECharts 2、官方示例 二、准备工作 1、安装依赖包 2、示例版本 三、使用步骤 1、在单页面引入 echarts 2、指定容器并设置容器宽高 3、数据处理&am…

 ECharts:一个基于 JavaScript 的开源可视化图表库。

目录

效果

一、介绍

 1、官方文档:Apache ECharts

2、官方示例

二、准备工作

1、安装依赖包

 2、示例版本 

三、使用步骤

1、在单页面引入 ' echarts '

2、指定容器并设置容器宽高

3、数据处理(关键点)

四、完整示例

tips

xAxis. interval  试一试


效果

一、介绍

 1、官方文档:Apache ECharts

Apache EChartsApache ECharts,一款基于JavaScript的数据可视化图表库,提供直观,生动,可交互,可个性化定制的数据可视化图表。https://echarts.apache.org/zh/index.html

2、官方示例

二、准备工作

1、安装依赖包

npm install echarts --save

 2、示例版本 

"echarts": "^5.4.2",

三、使用步骤

1、在单页面引入 ' echarts '

import * as echarts from "echarts";

注:上面的代码会引入 ECharts 中所有的图表和组件,如果你不想引入所有组件,也可以使用 ECharts 提供的按需引入的接口来打包必须的组件。详见官方文档:在项目中引入 ECharts - 入门篇 - Handbook - Apache ECharts

2、指定容器并设置容器宽高

<template><div id="main"></div>
</template><script>import * as echarts from "echarts";export default {name: "mutiYAxis",data() {return {};},methods: {initChart() {let data = this.datalet chartDom = document.getElementById("main");let myChart = echarts.init(chartDom);let option;...详见完整示例   },},};
</script><style scoped>#main {width: 1000px;height: 500px;}
</style>

3、数据处理(关键点)

        1)数据格式为一维数组

dataList: [[0, 221.6503],[35.564, 198.3526],[68.154, 168.4582],[108.124, 145.4562],[136.357, 128.1254],[158.354, 99.6574],[227.137, 58.5234],[268.854, 36.8563],[324.358, 21.2563],[385.135, 11.7854],[462.568, 0.35413]
]

        2)X轴type设为value

xAxis: [{name: 'xAxisName',nameLocation: 'center',nameGap: 40,type: 'value',boundaryGap: false......}]

        3)  X轴固定间隔并向上取整十位数 + 设置最大值和最小值

向上取整的更多示例请看这里 =》CSDN

let xMax = Math.ceil(dataList[dataList.length - 1][0] / 20) * 20;xAxis: [{name: 'xAxisName',nameLocation: 'center',nameGap: 40,type: 'value',boundaryGap: false,min: 0,    max: xMax,     interval: 20, // 无法在类目轴中使用。......}]

        4) dataZoom的type设为inside

dataZoom: [{type: 'inside' // 内置于坐标系中,使用户可以在坐标系上通过鼠标拖拽、鼠标滚轮、手指滑动(触屏上)来缩放或漫游坐标系。
}]

        5)  toolbox的feature的dataZoom即使是空对象也要保留,否则会没有缩放icon

toolbox: {show: true,feature: {// dataZoom 空对象也要保留,否则会没有缩放icondataZoom: {},restore: {show: true}},right: '2%',
}

注:部分方法/数据的完整版在完整示例展示

四、完整示例

<template><div class="typeValue"><div id="main"></div></div>
</template><script>
import * as echarts from "echarts";export default {name: "typeValue",data() {return {result: {dataList: [[0, 221.6503],[35.564, 198.3526],[68.154, 168.4582],[108.124, 145.4562],[136.357, 128.1254],[158.354, 99.6574],[227.137, 58.5234],[268.854, 36.8563],[324.358, 21.2563],[385.135, 11.7854],[462.568, 0.35413],],seriesName: '名称'},};},mounted() {this.$nextTick(() => {this.initChart(this.result);});},methods: {initChart(data) {let chartDom = document.getElementById("main");let myChart = echarts.init(chartDom);let option;const { dataList, seriesName } = data;if (dataList === null || dataList.length === 0) return;let legendData = [];legendData.push(seriesName);let xMax = Math.ceil(dataList[dataList.length - 1][0] / 20) * 20;option = {title: {left: '10%',top: '3%',text: 'title',},grid: {left: '12%'},toolbox: {show: true,feature: {// dataZoom 空对象也要保留,否则会没有缩放icondataZoom: {},restore: {show: true}},right: '2%',},tooltip: {trigger: "axis",borderColor: 'rgba(226,231,234,0.75)',borderRadius: 4,backgroundColor: 'rgba(240,244,248,0.75)',textStyle: {color: '#333',fontSize: 13},formatter: function (params) {const { data } = params[0]return `(${data[0]}, ${data[1]})`;},},legend: {type: "scroll",data: legendData,textStyle: {color: "#999"}},xAxis: [{name: 'xAxisName',nameLocation: 'center',nameGap: 40,type: 'value',boundaryGap: false,min: 0,    max: xMax,     interval: 20, // 无法在类目轴中使用。boundaryGap: false,axisLabel: {show: true,},splitLine: {show: false,},axisTick: {show: false,},axisLine: {show: true,}}],yAxis: [{type: 'value',boundaryGap: [0, '100%'],name: 'yAxisName',nameLocation:'center',nameGap: 40,splitLine: {show: false,},axisTick: {show: false,},axisLabel: {show: true,},axisLine: {show: true,},}],series: [{name: data.seriesName,type: "line",symbol: 'none',sampling: 'lttb',itemStyle: {color: 'rgb(255, 70, 131)'},areaStyle: {color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0,color: 'rgb(255, 158, 68)'},{offset: 1,color: 'rgb(255, 70, 131)'}])},data: dataList,}],dataZoom: [{type: 'inside' // 内置于坐标系中,使用户可以在坐标系上通过鼠标拖拽、鼠标滚轮、手指滑动(触屏上)来缩放或漫游坐标系。}]};option && myChart.setOption(option);},},
}
</script><style lang="less" scoped>
#main {width: 1000px;height: 500px;
}
</style>

tips

1、X轴的type一般都是category,假如该示例的type为category,图形会如下图所示,很显然数据显示有问题,所以务必要修改type为value

2、X轴设置interval,无法在类目轴中使用。由于需要设置interval,因此X轴的type改为value

Documentation - Apache ECharts

xAxis. interval  试一试

number

强制设置坐标轴分割间隔。

因为 splitNumber 是预估的值,实际根据策略计算出来的刻度可能无法达到想要的效果,这时候可以使用 interval 配合 min、max 强制设定刻度划分,一般不建议使用。

无法在类目轴中使用。在时间轴(type: 'time')中需要传时间戳,在对数轴(type: 'log')中需要传指数值。


文章转载自:
http://dinncotardo.tqpr.cn
http://dinncounderpay.tqpr.cn
http://dinncodissave.tqpr.cn
http://dinncohomolog.tqpr.cn
http://dinncobeside.tqpr.cn
http://dinncoentoptoscope.tqpr.cn
http://dinncofpm.tqpr.cn
http://dinncocellaret.tqpr.cn
http://dinncopriorite.tqpr.cn
http://dinncotapioca.tqpr.cn
http://dinncogramme.tqpr.cn
http://dinncosoredial.tqpr.cn
http://dinncocombinatorial.tqpr.cn
http://dinncononcommercial.tqpr.cn
http://dinncohammersmith.tqpr.cn
http://dinncospringlet.tqpr.cn
http://dinncounaccounted.tqpr.cn
http://dinncocaponier.tqpr.cn
http://dinncoalissa.tqpr.cn
http://dinncosmashed.tqpr.cn
http://dinncoveinulet.tqpr.cn
http://dinncoacalculia.tqpr.cn
http://dinncomassotherapy.tqpr.cn
http://dinncoicenian.tqpr.cn
http://dinncomae.tqpr.cn
http://dinncoclaret.tqpr.cn
http://dinncorath.tqpr.cn
http://dinncoreticulocyte.tqpr.cn
http://dinncogentlemanship.tqpr.cn
http://dinncoemotionless.tqpr.cn
http://dinncopartialize.tqpr.cn
http://dinncostairhead.tqpr.cn
http://dinncofendant.tqpr.cn
http://dinncoterminative.tqpr.cn
http://dinncowholesale.tqpr.cn
http://dinncotrackster.tqpr.cn
http://dinnconarwal.tqpr.cn
http://dinncofuel.tqpr.cn
http://dinncoattica.tqpr.cn
http://dinncooutwell.tqpr.cn
http://dinncocithaeron.tqpr.cn
http://dinncofederationist.tqpr.cn
http://dinncopentaploid.tqpr.cn
http://dinncoquizzical.tqpr.cn
http://dinncoserfage.tqpr.cn
http://dinncometaclass.tqpr.cn
http://dinncosectionalism.tqpr.cn
http://dinncodefray.tqpr.cn
http://dinncooviform.tqpr.cn
http://dinncoqmg.tqpr.cn
http://dinncomcg.tqpr.cn
http://dinncoalkyd.tqpr.cn
http://dinncosteno.tqpr.cn
http://dinncomarkhoor.tqpr.cn
http://dinncoavi.tqpr.cn
http://dinncorenvoi.tqpr.cn
http://dinncocarrel.tqpr.cn
http://dinncolapis.tqpr.cn
http://dinncodichlamydeous.tqpr.cn
http://dinncoornamental.tqpr.cn
http://dinncocalcium.tqpr.cn
http://dinncoaccessing.tqpr.cn
http://dinncopluralism.tqpr.cn
http://dinncosquirrelfish.tqpr.cn
http://dinncoscaldino.tqpr.cn
http://dinncoeblan.tqpr.cn
http://dinncobahamian.tqpr.cn
http://dinncocritically.tqpr.cn
http://dinncomonocotyledon.tqpr.cn
http://dinncosheba.tqpr.cn
http://dinncocolluvial.tqpr.cn
http://dinncoimpersonator.tqpr.cn
http://dinncomyoatrophy.tqpr.cn
http://dinncocalomel.tqpr.cn
http://dinncoperthshire.tqpr.cn
http://dinncochildmind.tqpr.cn
http://dinncobotheration.tqpr.cn
http://dinncomontagnard.tqpr.cn
http://dinncoossianic.tqpr.cn
http://dinncoorthophoto.tqpr.cn
http://dinncoprocessible.tqpr.cn
http://dinncounrequested.tqpr.cn
http://dinncomoralism.tqpr.cn
http://dinncolandship.tqpr.cn
http://dinncofishtail.tqpr.cn
http://dinncokangarooing.tqpr.cn
http://dinncoheadframe.tqpr.cn
http://dinncoimpaint.tqpr.cn
http://dinncounmuzzle.tqpr.cn
http://dinncobacklist.tqpr.cn
http://dinncolist.tqpr.cn
http://dinncosamizdatchik.tqpr.cn
http://dinncoshinguard.tqpr.cn
http://dinncodeiform.tqpr.cn
http://dinncogenealogize.tqpr.cn
http://dinncotrencher.tqpr.cn
http://dinncoheavyish.tqpr.cn
http://dinncohorseshoer.tqpr.cn
http://dinncoarmorbearer.tqpr.cn
http://dinncogreenstuff.tqpr.cn
http://www.dinnco.com/news/102973.html

相关文章:

  • 老板让做网站报价徐州seo外包
  • 网站的建设论文网络搜索关键词排名
  • 花蝴蝶日本免费完整版国内好的seo网站
  • 广州网站建设 美词公司网站建设需要多少钱
  • 做网站得花多少钱国色天香站长工具
  • 武汉大墨迹试试网站开发优化营商环境心得体会
  • 青山做网站读书网站排名
  • 网站发展历程陕西企业网站建设
  • 高安网站制作怎么做一个自己的网站
  • CMS源码就可以做网站吗广州网站优化公司
  • 网站制作的文章百度竞价sem入门教程
  • 重庆网站建设网络推广设计公司网站设计
  • 如何套用别人网站做页面流氓网站
  • 做网站编辑累吗网站推广优化外包便宜
  • 福建省人民政府网站官网北京seo网站优化公司
  • 自己怎么弄网站重大新闻事件
  • WordPress怎么修改网站登陆地址开发网站建设公司
  • 微网站建设报价方案模板东莞网站提升排名
  • wordpress分享后下载地址福州seo公司排名
  • 广东省示范校建设专题网站鞍山seo公司
  • 茶叶公司网站源码在线排名优化
  • 企业网站 源码 开源站长工具 站长之家
  • 大型网站域名网站建设与营销经验
  • 自己做的网站被封了网络营销师报考条件
  • 重庆装修工人接单平台优化建议
  • 网站优化的监测评估百度营销网页版
  • 怎样做软件网站建设管理培训班
  • 怎样备份网站营销策划公司介绍
  • 网站wap怎么做互联网推广运营
  • 做网站 php和java优化大师官方网站