版权声明:本文为博主原创文章,未经博主允许不可转载。转载请注明出处 https://blog.csdn.net/qq_32442967/article/details/81740648
echarts 基本配置项记录
//图表自适应宽高
window.onresize = function(){
myChart.resize();
};
//title主标题
title:{
show:true,
text:'标题',
link:'www.baidu.com', //主标题文本超链接
textStyle:{
color:'#333',
fontSize:18,
align:'left', //文字水平对齐方式,默认自动。 left center right
verticalAlign:'top' //文字垂直对齐方式,默认自动。 top middle bottom
},
subtext:'副标题', //支持使用 \n 换行。
sublink:'超链接', //副标题超文本链接
padding:5, //内边距 5 /上下5左右10 padding:[5,10] /padding:[5,10,5,10] 上右下左
}
//图例组件
legend: {
show:true,
data:['数据1', '数据2', '数据3'],
right:'5%', //位置离右侧距离 也可px left/top/bottom
orient:'visualMap', //图例列表的布局朝向.纵向 横向orient:'horizontal'
align:'left', //图例标记和文本的对齐 左右位置
},
//xAxis X轴
xAxis:{
show:true, //是否显示
position:bottom, //x轴位置 top/bottom
nameLocation:'end', //坐标轴名称显示位置 start/end/middle/center
nameTextStyle:{
color:'',
fontFamily:'',
fontSize:12,
align:'left' //坐标轴名称文字水平对齐方式
},
}
//textStyle 全局的字体样式
textStyle:{
color:'#fff',
fontFamily:'宋体',
fontsize:12
}