python echarts 多图联动,创建echart多个联动的示例代码

鼠标悬浮同时触发多个echart

效果如下

b8ca3cce6b8d7fc5395723fca0e7970e.png

html代码

选择时间间隔

one second

one second
one minute
one hour
one day
one week
one month
one year

选择数据个数

5

5
10
15
20
25
30
35
确定

css代码

body {

margin: 0;

padding: 0;

background-color: #eee;

}

.contain {

padding: 10px;

}

.sel {

position: absolute;

height: 250px;

z-index: 10;

}

.sel>div {

float: left;

margin-right: 10px;

}

.top span {

display: inline-block;

width: 100px;

height: 30px;

}

.top .show {

width: 125px;

height: 25px;

float: right;

border: 1px solid #444;

padding-left: 5px;

position: relative;

}

.block {

float: right;

position: relative;

border-radius: 5px;

padding: 5px;

width: 120px;

box-shadow: 1px 1px 5px #444;

display: none;

background-color: #fff;

}

.block>div {

height: 25px;

line-height: 25px;

padding-left: 5px;

border-radius: 5px;

cursor: pointer;

}

.block>div:hover {

background-color: #D3E3E5;

}

.block>div.active {

background-color: #087C90;

color: #fff;

}

.zybtn {

width: 80px;

height: 30px;

border-radius: 5px;

background-color: #46AD08;

line-height: 30px;

text-align: center;

color: #fff;

cursor: pointer;

}

i.glyphicon {

top: 3px;

right: 5px

}

js代码

function drawchart(timearr, dataarr) {

// 基于准备好的dom,初始化echarts实例

var myChart1 = echarts.init(document.getElementById('main'));

var myChart2 = echarts.init(document.getElementById('main2'));

// 指定图表的配置项和数据

var option1 = {

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值