在⼀个html加载多个echarts,Echarts⼀个页⾯加载多个图表及
图表⾃适应
Echarts⼀个页⾯加载多个图表及图表⾃适应
模块化加载
//⼊⼝
paths: {
echarts: 'echarts.baidu/build/dist'
}
});
//按需加载=====================================================
require([
'echarts','echarts/chart/bar',
'echarts/chart/line'
],
drawEcharts // 加载⼀个图表函数的集合
);
//需要加载封装好的图表函数
function drawEcharts(ec){
MaterialReserves(ec);
VectorIntelligent(ec);
}
/
/定义⼀个数组,作为图表只适应存储
var echarts = [];
加载两个图表
/*物资储备情况图表
==========================================================================================*/
function MaterialReserves(ec) {
var MaterialReservesEcharts = ec.ElementById('material-reserves'));
var option = {
title : {concurrency
text: '某地区蒸发量和降⽔量',
subtext: '纯属虚构'
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['蒸发量','降⽔量']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}android sdk tools
},
calculable : true,
xAxis : [
{
type : 'category',
data : ['1⽉','2⽉','3⽉','4⽉','5⽉','6⽉','7⽉','8⽉','9⽉','10⽉','11⽉','12⽉']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'蒸发量',
type:'bar',
data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
markPoint : {
data : [
{type : 'max', name: '最⼤值'},
{type : 'min', name: '最⼩值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
},
{
name:'降⽔量',
groupby的用法type:'bar',
data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
markPoint : {
data : [
{name : '年最⾼', value : 182.2, xAxis: , yAxis: , symbolSize:},
{name : '年最低', value : 2.3, xAxis: , yAxis: }
]
},
markLine : {
data : [
{type : 'average', name : '平均值'}
]
}
}
]
};
MaterialReservesEcharts.setOption(option);
echarts.push(MaterialReservesEcharts);
};
/*⽕灾热点统计=======================================================================*/
function VectorIntelligent(ec){
var VectorIntelligentEcharts = ec.ElementById('vector-intelligent')); var option = {
title : {
text: '未来⼀周⽓温变化',
subtext: '纯属虚构'
},
tooltip : {
trigger: 'axis'
},
legend: {
data:['最⾼⽓温','最低⽓温']
},
toolbox: {
show : true,
feature : {
mark : {show: true},
dataView : {show: true, readOnly: false},
magicType : {show: true, type: ['line', 'bar']},
restore : {show: true},
saveAsImage : {show: true}
}
},
calculable : true,
xAxis : [华容道
{
type : 'category',
boundaryGap : false,
data : ['周⼀','周⼆','周三','周四','周五','周六','周⽇']
}
],
yAxis : [
{
mysql面试题及讲解
type : 'value',
axisLabel : {
formatter: '{value} °C'
}
}oracle详细安装教程
],
series : [
{
name:'最⾼⽓温',
type:'line',
data:[, , , , , , ],
markPoint : {
data : [
{type : 'max', name: '最⼤值'},
{type : 'min', name: '最⼩值'}
]
},
markLine : {
data : [
{type : 'average', name: '平均值'}
]
}
},
{
name:'最低⽓温',
type:'line',
data:[, -, , , , , ],
markPoint : {
data : [
{name : '周最低', value : -, xAxis: , yAxis: -1.5} ]
},
markLine : {
data : [
{type : 'average', name : '平均值'}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。