//指定图表的配置项和数据
var option ={
backgroundColor:'rgba(204,204,204,0.7 )',//背景色,默认无背景 rgba(51,255,255,0.7)
title: {
text:'各教育阶段男女人数统计',
link:'https://www.xxx.com',
target:'blank',
top:'5%',
left:'3%',
textStyle: {
color:'#fff',
fontSize:20,
}
},
legend: {//图例组件
show: true,
icon:'rect',//图例项的 icon。ECharts 提供的标记类型包括 'circle', 'rect', 'roundRect', 'triangle', 'diamond', 'pin', 'arrow'也可以通过 'image://url' 设置为图片,其中 url 为图片的链接,或者 dataURI。可以通过 'path://' 将图标设置为任意的矢量路径。
top: '40%',//图例距离顶部边距
left: '15%',//图例距离左侧边距
itemWidth: 10,//图例标记的图形宽度。[ default: 25 ]
itemHeight: 10,//图例标记的图形高度。[ default: 14 ]
itemGap: 30,//图例每项之间的间隔。[ default: 10 ]横向布局时为水平间隔,纵向布局时为纵向间隔。
orient: 'vertical',//图例列表的布局朝向,'horizontal'为横向,''为纵向.
textStyle: { //图例的公用文本样式。
fontSize: 15,
color:'#fff'},
data: [{//图例的数据数组。数组项通常为一个字符串,每一项代表一个系列的 name(如果是饼图,