//初始化echarts
var myecharts = echarts.init(document.getElementById(‘main‘));
//画柱状图
var option ={
title:{
text:‘echarts入门‘,
link:‘http://www.baidu.com‘,//主标题超链接
target:‘blank‘,//主标题超链接打开方式
textStyle:{ //设置主标题风格
Color:‘green‘,//设置主标题字体颜色
fontStyle:‘‘,//主标题文字风格
},
subtext:‘副标题‘,
sublink:‘http://www.baidu.com‘,//副标题超链接
subtarget:‘blank‘,//副标题超链接打开方式
padding:[5,10,5,5],//设置标题内边距,上,右,下,左
itemGap:10,//主副标题之间的间距
/*left:‘left‘,//组件的位置,center,left,right
top:‘top‘,//组件离上边的距离middle,top,bottom*/ //此二者的优先级高于x吗?答案:是
x:‘center‘,
backgroundColor:‘white‘,//标题背景色
borderColor:‘gray‘,//标题边框颜色
borderWidth:5,//标签线框
borderRadius:5,//边框切圆角
shadowBlur:10,//图形阴影模糊大小,该属性配合 shadowColor,shadowOffsetX(阴影水平方