双坐标系案例

 

 

 

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="https://cdn.jsdelivr.net/npm/echarts@4.7.0/dist/echarts.js"></script>
<style>
#chart {
width: 800px;
height: 400px;
}
</style>
</head>
<body>
<div id="chart"></div>

<script>
const chartDom = document.getElementById('chart');
// const chart = echarts.init(chartDom,'westeros',{renderer:'svg'});
const chart = echarts.init(chartDom);
chart.setOption({
xAxis:{
type:'category'
},
yAxis:[{
min:0,
max:100
},{
splitLine:{
show: false
}
}] ,
dataset:{
source:[
['product', '2012', '2013', '2014', '2015'],
['Matcha Latte', 41.1, 30.4, 65.1, 53.3],
['Milk Tea', 86.5, 92.1, 85.7, 83.1]
]
},
title:{
text:"Echars 多系列案例",
// 小标题
subtext:'数据可视化'
},
series:[
{
type:'bar',
seriesLayoutBy:'row',
yAxisIndex: 0
},
{
type:'line',
seriesLayoutBy:'row',
yAxisIndex: 1
}
]
})

</script>
</body>
</html>

posted @ 2021-03-25 23:04  13522679763-任国强  阅读(38)  评论(0)    收藏  举报