柱状图颜色
color: ["#2f89cf"]
修改图表大小
grid: {left: "0%",top: "10px",right: "0%",bottom: "4%",containLabel: true},
X、Y轴相关设置 xAxis
刻度标签
axisLabel: {color: "rgba(255,255,255,.6)",fontSize: "12"},
隐藏x轴
xAxis: {show: false},
轴线样式
//不显示y轴线条axisLine: {show: false},// 不显示刻度axisTick: {show: false},
文字颜色
axisLabel: {color: "#fff"},
样式不显示
axisLine: {show: false// 如果想要设置单独的线条样式// lineStyle: {// color: "rgba(255,255,255,.1)",// width: 1,// type: "solid"}}
Y轴分隔线
splitLine: {lineStyle: {color: "rgba(255,255,255,.1)"}}
坐标轴反向
inverse:true
圆柱样式
series: [{name: '直接访问',type: 'bar',barWidth: '35%',//宽度data: [200, 300, 300, 900, 1500, 1200, 600],itemStyle:{barBorderRadius: 5 //修改柱子圆角}}]
name: "条",//柱子的宽度barWidth: 10,// 柱子设为圆角itemStyle: {normal: {barBorderRadius: 20,}},柱子变为边框itemStyle: {color: "none",borderColor: "#00c1de",borderWidth: 3,barBorderRadius: 15},
图形上的文本标签
label: {normal: {show: true,// 图形内显示position: "inside",// 文字的显示格式formatter: "{c}%" //会自动解析数据 data里面的数据}},
不同柱子分别的颜色
var myColor = ["#1089E7", "#F57474", "#56D0E3", "#F8B448", "#8B78F6"];itemStyle: {color: function(params){return myColor[params.dataIndex]}},//params 传进来的柱子对象
不同坐标系柱子重叠(index)
tip:必须有多个坐标系才可以使用index
yAxisIndex: 0
柱子间距
同一系列柱子的间距
{barCategoryGap: 50,},
鼠标悬停样式
tooltip: {trigger: 'axis',axisPointer: {type: 'shadow/line' //样式为悬停或线条}}
更换数据
// x轴中更换data数据data: [ "旅游行业","教育培训", "游戏行业", "医疗行业", "电商行业", "社交行业", "金融行业" ],// series 更换数据data: [200, 300, 300, 900, 1500, 1200, 600]
