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

网站制作公司下逻辑网络设计报告

网站制作公司下,逻辑网络设计报告,拓者设计吧电脑版,行政机关网站建设在使用echarts中,当返回的(series)多条数据时, echarts渲染的是一个图表多条折现,还是(series)中每个数据单独展示成独立图表 在(series)每条数据单独展示时,echarts的鼠标移入tooltip是同时显示,还是移入当前的只显示当前echarts的tooltip e…

在使用echarts中,当返回的(series)多条数据时, echarts渲染的是一个图表多条折现,还是(series)中每个数据单独展示成独立图表

在(series)每条数据单独展示时,echarts的鼠标移入tooltip是同时显示,还是移入当前的只显示当前echarts的tooltip

echarts: 5.5.0

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>多图联动</title><script src="./js/echarts.min.js"></script>
</head>
<body>
<div><button onclick="onInitEcharts(1)">单图</button><button onclick="onInitEcharts(2)">多图</button><button onclick="onTab(1)">统一滑动</button><button onclick="onTab(2)">单独滑动</button>
</div>
<div id="app"></div>
</body><script>let displayType = 1  // 单图   2 多图let axisPointer = 1  // 1 统一 2 单独// 基本数据结构let optionlLineData = {tooltip: {trigger: 'axis'},legend: {},grid: {top: 8,left: 10,right: 10,bottom: 60,containLabel: true},xAxis: [{type: 'category',data: []}],yAxis: [{type: 'value'}],series: [{name: 'Email',type: 'line',data: []},{name: 'Union Ads',type: 'line',data: []}]}// 返回数据let option = {xAxis: [{type: "category",data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}],tooltip: {trigger: 'axis',},color: ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'],legend: {},yAxis: [{axisLabel: {formatter: " {value} "},type: "value"}],series: [{data: [820, 932, 901, 934, 1290, 1330, 1320],type: "line"},{data: [720, 832, 801, 834, 1190, 1230, 1220],type: "line"}, {data: [620, 732, 701, 734, 1090, 1130, 1120],type: "line"}, {data: [520, 632, 601, 634, 990, 1030, 1020],type: "line"}]}// 其他颜色值let colors = []let optionLine = nulllet chartArray = []let myChartList = []let fixedClass = 'chart_connect'// 单图还是多图切换function onInitEcharts(type) {displayType = typeconsole.log(chartArray);let app = document.getElementById('app')chartArray.forEach((item, index) => {let elDom = document.getElementsByClassName(fixedClass + index)[0]app.removeChild(elDom)})chartArray = []this.load()}// tooltip 解绑与绑定function onTab(type) {axisPointer = typethis.getEcharts()// if (axisPointer === 1) {//     bindAction(myChartList)// } else {//     disOffConnect(myChartList)// }}load()// 初始加载function load() {let titleList = [{targetName: 'echartsTitle',unitName: '',queryTime: ''},{targetName: 'echartsTitle',unitName: '',queryTime: ''},{targetName: 'echartsTitle',unitName: '',queryTime: ''},{targetName: 'echartsTitle',unitName: '',queryTime: ''}]optionLine = createLineData(option, optionlLineData, titleList)console.log(' this.optionLine', optionLine);let app = document.getElementById('app')// 单独展示if (displayType === 1) {chartArray = initEcharts(optionLine, [], titleList)console.log(chartArray);chartArray.forEach((item, index) => {let div = document.createElement('div')div.className = fixedClass + indexdiv.style.width = '100%'div.style.height = '300px'app.appendChild(div)})setTimeout(() => {if (chartArray.length) {getEcharts()}}, 500)} else {chartArray = [optionLine]console.log(chartArray);let div = document.createElement('div')div.className = fixedClass + 0div.style.width = '100%'div.style.height = '300px'app.appendChild(div)if (chartArray.length) {getEcharts()}}}function initEcharts(chartEcharts, gridTable, titleList) {if (Object.keys(chartEcharts).length) {const chartArray = chartEcharts.series.map((item, index) => {let queryTime = titleList[index].queryTimelet unitName = titleList[index].unitNamereturn {...chartEcharts,tooltip: {trigger: 'axis',// axisPointer: {//     type: 'shadow'// },// formatter: (params) => this.tooltipFormatter(params, queryTime, unitName),// position: function (pos, params, dom, rect, size) {//     const yPos = '20%'//     let xPos = 0//     if (pos[0] < size.viewSize[0] / 2) {//         xPos = pos[0] + 10//     } else {//         xPos = pos[0] - dom.offsetWidth - 10//     }//     return [xPos, yPos]// }},series: [Object.assign(item,{symbolSize: 0,lineStyle: {normal: {width: 3}},sampling: 'lttb'})],index: index,// table: gridTable && gridTable[index] || [],titleList: titleList[index]}})return chartArray // 所有的echarts数据}}function createLineData(data, optionlLineData, titleList) {let optionChartLine = dataconsole.log('chartData----', optionChartLine)if (optionChartLine && Object.keys(optionChartLine).length) {let colorList = optionChartLine.colorif (colors && colors.length) {colorList = colors.concat(optionChartLine && optionChartLine.color)}optionChartLine.backgroundColor = '#f4f4f4'optionChartLine.color = colorList// 边距optionChartLine.grid = optionlLineData.gridoptionChartLine.grid.top = 40optionChartLine.grid.right = 25optionChartLine.grid.bottom = 10optionChartLine.dataZoom = {show: false}optionChartLine.tooltip.trigger = 'axis'// 工具栏optionChartLine.toolbox = {show: true,right: 10,feature: {// dataZoom: {//   yAxisIndex: 'none'// },// dataView: { readOnly: false },magicType: {type: ['line', 'bar']},// restore: {},saveAsImage: {}}}// y轴optionChartLine.yAxis.forEach((y, index) => {y.splitLine = { // 坐标轴区域分割线show: true,lineStyle: {color: '#c6d4e1',width: 1,type: 'dotted'}}})// x轴optionChartLine.xAxis.forEach((x, index) => {x.splitLine = { // 坐标轴区域分割线show: true,lineStyle: {color: '#c6d4e1',width: 1,type: 'dotted'}}x.axisLabel = {interval: 'auto'// interval: x.data.length > 24 ? Math.ceil(Number(x.data.length / 24)) : 0}// x.aa = Number(x.data.length / 24)// x.bb = Math.ceil((x.data.length / 24))// x.data = x.data.sort()})let legendData = []optionChartLine.series.forEach((s, index) => {let colorIndex = this.styleVal === '1' ? index : 0// let seriesName = s.name.split('||')// legendData.push(seriesName[0])// s.name = seriesName[0]// 填充颜色// s.areaStyle = {//   color: {//线性渐变前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果 globalCoord 为 `true`,则该四个值是绝对的像素位置//     type: 'linear',//     x: 0,//     y: 1,//     x2: 0,//     y2: 0,//     colorStops: [{//       // offset: 0, color: colorRgba[index] // 0% 处的颜色//       // offset: 0, color: this.colorRgbaTransparency(colorList, '0')[colorIndex] // 0% 处的颜色//     },//       {//         // offset: 0.5, color: this.colorRgbaTransparency(colorList, '0.3')[colorIndex] // 100% 处的颜色//       },//       {//         // offset: 1, color: colorRgba[index] // 100% 处的颜色//         // offset: 1, color: 'transparent'// 100% 处的颜色//       }//     ],//     // globalCoord: false// 缺省为 false//     // shadowColor: this.colorRgbaTransparency(colorList, '0')[index],//     // shadowBlur: 10//   }// }// if (s.data.length) {//     let seriesData = s.data.map(v => {//         if (typeof v === 'number' && v === 0) {//             v = 0//         } else if (!v || (v && v === '-666666666' || v === -666666666)) {//             v = '-'//         }//         return v != '-' ? (v).toFixed(2) : '-'//     })//     s.data = seriesData// }s['dataIndex'] = index})// 图例组件optionChartLine.legend.top = 5// optionChartLine.legend.right = 150optionChartLine.legend.left = 10optionChartLine.legend.width = '80%'// optionChartLine.legend.data = legendDataconsole.log('optionChartLine', optionChartLine)return optionChartLine}}function bodyResize() {if (myChartList.length) {myChartList.forEach(item => {item.resize()})}}function getEcharts(flag) {bodyResize()chartArray.forEach((item, index) => {let elDom = document.getElementsByClassName(fixedClass + index)[0]console.log(elDom);let dom = echarts.init(elDom)dom.clear()dom.group = fixedClass + 'Echarts'dom.setOption(item, true)myChartList.push(dom)console.log(myChartList);// this.$set(myChartList, index, dom)})if (axisPointer === 1) {console.log('多表联动')// echarts.connect(this.myChartList) // 进行图表多表联动bindAction(myChartList)} else {disOffConnect(myChartList)// echarts.disConnect('chart_connectEcharts') // 解除图表多表联动}}function bindAction(chartList) {echarts.util.each(chartList, function (fromChart) {echarts.util.each(chartList, function (toChart) {if (fromChart === toChart) {return}// tooltip 联动fromChart.on('updateAxisPointer', function (params) {toChart.dispatchAction(toChart.makeActionFromEvent(params),true)})})})}function disOffConnect(chartList) {echarts.util.each(chartList, function (fromChart) {echarts.util.each(chartList, function (toChart) {if (fromChart === toChart) {return}// tooltip 解除联动fromChart.off('updateAxisPointer')})})}
</script>
</html>

文章转载自:

http://8LrAEYyy.gqddL.cn
http://E5p2zHFJ.gqddL.cn
http://trGArNBg.gqddL.cn
http://q9eZnFt1.gqddL.cn
http://2uHicDH0.gqddL.cn
http://VwR1rDjo.gqddL.cn
http://JGptz0km.gqddL.cn
http://1D8xkFgy.gqddL.cn
http://MGjp16pf.gqddL.cn
http://KVTmsKWE.gqddL.cn
http://dSQ5bZq4.gqddL.cn
http://1oDxnidC.gqddL.cn
http://LDjQzqev.gqddL.cn
http://ldflUqR5.gqddL.cn
http://NxtD39PK.gqddL.cn
http://h9Y5xndf.gqddL.cn
http://2JCvr4Nm.gqddL.cn
http://t2YTRkRj.gqddL.cn
http://0JWKLsmn.gqddL.cn
http://C01mKIqR.gqddL.cn
http://p2MYqbZB.gqddL.cn
http://QjMsxCar.gqddL.cn
http://sJxTPjCl.gqddL.cn
http://FkNDwVum.gqddL.cn
http://vtwsBEmq.gqddL.cn
http://qQlp56BW.gqddL.cn
http://EQn1ZqBA.gqddL.cn
http://Yo52GGKy.gqddL.cn
http://Hk2ZYO19.gqddL.cn
http://ObW9fkl8.gqddL.cn
http://www.dtcms.com/wzjs/768157.html

相关文章:

  • iis停止单个网站苏州推广有限公司
  • 知名高端网站建设深圳宝安区有几个镇
  • 注册网站账号违法吗百度宿迁市建设局网站
  • 个人开网站深圳网站制作的公司有哪些
  • 深圳南山区网站建设公司安装wordpress导入工具
  • php语言 电商网站建设安徽省建设工程信息网站进不了
  • 沈阳网站开发招聘提高怎样做网站的外链
  • 南京企业网站开发费用申请网站优化搜索排名
  • 交互网站设计wordpress 询价按钮
  • 揭阳网站建设公司哪个好模版网站建设步骤详解
  • 诚信企业品牌网站建设wordpress获取指定分类的图像描述
  • 网站建设专业用语wordpress 4 安装
  • 网站开发有什么好的论坛修改公司网站网页
  • 资源下载网站建设制作网站联系方式
  • 网站开发职业访谈百度seo公司哪家最好
  • 搭建网站架构是什么意思手机如何制作网页
  • 旅游网站模板免费下载网站模糊设计
  • 全国网站制作前十名国企设计公司有哪些
  • 怎样在手机上做自己的网站做网站需要那些编程语言
  • 宜兴网站优化网站建设报价流程
  • 想做一个个人网站怎么做郑州百度网站优化排名
  • 淘宝客推广网站建设百度云网站3级目录可以做导航分类么
  • 做视频网站什么平台好中国商标网商标查询官网查询
  • 甘肃省第九建设集团网站首页大连建设执业资格注册中心网站
  • 阳网站建设做网站 图片更好看
  • 做建筑看那些网站电子商务网站建设主题
  • 乌克兰网站设计推广企业网站最主要的方式
  • python做网站用什么框架网站开发朋友圈广告
  • 医院网站建设招标公告北京工商登记
  • 彩票系统网站开发成都做一个小企业网站需要多少钱