ECharts配置项之title(标题)

1.标题居中

//left的值为'left', 'center', 'right'
title:{
    left:'center'
}

2.主副标题之间的间距

title:{
    //默认为10
     itemGap:20   
}

3.标题文本样式

复制代码
title:{
     text:'标题文本',
     textStyle:{
        //文字颜色
        color:'#ccc',
        //字体风格,'normal','italic','oblique'
        fontStyle:'normal',
        //字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
        fontWeight:'bold',
        //字体系列
        fontFamily:'sans-serif'
//字体大小
     fontSize:18
    }
}
复制代码

4.副标题

title:{
    subtext:'副标题',
  //副标题文本样式
  subtextStyle:{}
}

5.grid组件离容器左侧的距离。

title:{
    // left 的值可以是像 20 这样的具体像素值,可以是像 '20%' 这样相对于容器高宽的百分比,也可以是 'left', 'center', 'right'。
    //如果 left 的值为'left', 'center', 'right',组件会根据相应的位置自动对齐。
   left:'center'      
}

同理,top,right,bottom用法同left.

来源:https://www.cnblogs.com/ytwanzi/p/6640935.html

猜你喜欢

转载自www.cnblogs.com/youmingkuang/p/9165676.html