<script src="public/js/echarts/echarts.common.min.js"></script>
<script src="public/js/echarts/green.js"></script>
green.js
var greenTheme = {
// 默认色板
color: [
'#408829','#68a54a','#a9cba2','#86b379',
'#397b29','#8abb6f','#759c6a','#bfd3b7'
],
};
html
echarts.registerTheme('green',greenTheme);
var assetschart = echarts.init(document.getElementById("assetschart"),'green');
var option = {
title : {
},
tooltip : {
trigger: 'axis',
},
toolbox: {
show : true,
},
dataZoom : {
show : true,
start : 20,
end : 80
},
xAxis : [
{
type : 'category',
boundaryGap : false,
data : ['1','2','3','4','5','6','7']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'成交',
type:'line',
smooth:false,
lineStyle: {
color: 'green',
width: 1,
type: 'solid'
},
areaStyle: {normal: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: 'green'},
{offset: 0.5, color: 'green'},
{offset: 1, color: '#ddd'}
]
)
}},
data:[10, 12, 21, 54, 260, 830, 710],
}
]
};
assetschart.setOption(option);