从上到下
0,0,0,1 ,上浅下深
0,1,0,0,下浅上深
0,0,1,0,左浅右深
1,0, 0, 0, 左深右浅
new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: "rgba(95,115,250,0.2)"
},
{
offset: 0.5,
color: "rgba(95,115,250,0.5)"
},
{
offset: 1,
color: "#5F73FA"
}
]),
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
// Use axis to trigger tooltip
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
}
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'value'
},
yAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
series: [
{
name: 'Direct',
type: 'bar',
stack: 'total',
barWidth: 30,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "rgba(255,166,111,0.2)"
},
{
offset: 0.5,
color: "rgba(255,166,111,0.5)"
},
{
offset: 1,
color: "#FFA66F"
}
]),
label: {
show: true,
color: "#FFA66F"
},
itemStyle:{
borderColor: 'rgba(255,166,111,0.3)',
borderWidth: 1,
borderRadius: [0,4,4,0]
},
emphasis: {
focus: 'series'
},
data: [320, 302, 301, 334, 390, 330, 320]
},
{
name: 'Search Engine',
type: 'bar',
stack: 'total',
barWidth: 30,
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [{
offset: 0,
color: "rgba(95,115,250,0.2)"
},
{
offset: 0.5,
color: "rgba(95,115,250,0.5)"
},
{
offset: 1,
color: "#5F73FA"
}
]),
label: {
show: true,
color: "#5F73FA"
},
itemStyle:{
borderColor: 'rgba(95,115,250,0.3)',
borderWidth: 1,
borderRadius: [0,8,8,0]
},
emphasis: {
focus: 'series'
},
data: [820, 832, 901, 934, 1290, 1330, 1320]
}
]
};
浙公网安备 33010602011771号