chart.DoubleDeckBarChart = function (getIDParam, Legend, xAxisData, seriesName1, seriesName2, seriesData1, seriesData2, color1, color2) {

             require.config({paths: {echarts: '/lib/echarts'}});

             require(
[
'echarts',
'echarts/chart/bar'
],
function (ec) {
var DoubleDeckBar = ec.init(getIDParam);
var option = {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'line' // 默认为直线,可选为:'line' | 'shadow'
}
},
legend: {
data: Legend
},
grid: {
x: '40',
x2: '20',
y2: '50',
y: '38'
},
xAxis: [
{
type: 'category',
data: xAxisData,
axisLabel: {
rotate: 40
},
}
],
yAxis: [
{
type: 'value',
axisLabel: {
41 formatter: function (v) {
42 return parseInt(v)//表示整数。其他数值类型以此类推
43 }
44 }
45 //或者
46 //axisLabel: {
47 //formatter: function (v) {
48 // return v.toFixed(2); //0表示小数为0位,1表示1位小数,2表示2位小数
49 //}
50 //},
}
],
series: [
{
name: seriesName2,
type: 'bar',
stack: '广告',
data: seriesData2,
itemStyle: {
normal: {
color: color2,
}, },
},
{
name: seriesName1,
type: 'bar',
stack: '广告',
data: seriesData1,
itemStyle: {
normal: {
color: color1,
}, },
} ]
}; DoubleDeckBar.setOption(option, true);
}
);
}
05-11 08:30
查看更多