我的简书两月记:数据可视化
配置项如下
//data = [["2000-06-05",116],["2000-06-06",129],["2000-06-07",135],["2000-06-08",86],["2000-06-09",73],["2000-06-10",85],["2000-06-11",73],["2000-06-12",68],["2000-06-13",92],["2000-06-14",130],["2000-06-15",245],["2000-06-16",139],["2000-06-17",115],["2000-06-18",111],["2000-06-19",309],["2000-06-20",206],["2000-06-21",137],["2000-06-22",128],["2000-06-23",85],["2000-06-24",94],["2000-06-25",71],["2000-06-26",106],["2000-06-27",84],["2000-06-28",93],["2000-06-29",85],["2000-06-30",73],["2000-07-01",83],["2000-07-02",125],["2000-07-03",107],["2000-07-04",82],["2000-07-05",44],["2000-07-06",72],["2000-07-07",106],["2000-07-08",107],["2000-07-09",66],["2000-07-10",91],["2000-07-11",92],["2000-07-12",113],["2000-07-13",107],["2000-07-14",131],["2000-07-15",111],["2000-07-16",64],["2000-07-17",69],["2000-07-18",88],["2000-07-19",77],["2000-07-20",83],["2000-07-21",111],["2000-07-22",57],["2000-07-23",55],["2000-07-24",60]];
Fdata =[["07-30",0],["07-31",24],["08-01",12],["08-02",8],["08-03",2],["08-04",2], ["08-05",8],
["08-06",8],["08-07",4],["08-08",3],["08-09",1],["08-10",4],["08-11",2],
["08-13",1],["08-14",1],["08-15",3],["08-17",1],["08-18",2],["08-19",2],
["08-23",1],["08-24",3],["08-25",4],["08-26",10], ["08-27",2],
["08-28",165], ["08-29",8],["08-30",8],["08-31",3],
["09-01",4],["09-02",17],["09-03",69],["09-04",7],["09-05",15],
["09-06",7],["09-07",9],["09-08",3],["09-09",16],["09-10",11],
["09-11",4], ["09-12",2], ["09-13",7],["09-14",1], ["09-15",3],
["09-16",1],["09-18",1], ["09-19",2], ["09-20",1],["09-21",1],["09-22",5],
["09-23",11],["09-24",7],["09-25",62],["09-26",21],["09-27",11],
["09-28",63],["09-29",17],["09-30",11]
];
Ldata=[["07-30",0],["07-31",34],["08-01",8],["08-02",11],["08-03",3],
["08-05",8],["08-06",7],["08-07",4],["08-08",2],["08-09",1],["08-10",1],
["08-11",3],["08-13",1],["08-14",1],["08-15",7],["08-17",1],["08-19",1],
["08-22",2],["08-23",2],["08-24",6],["08-25",2],["08-26",10],["08-27",11],
["08-28",190],["08-29",10],["08-30",8],["08-31",4],
["09-01",8],["09-02",12],["09-03",76],["09-04",7],["09-05",13],
["09-06",9],["09-07",18],["09-08",13],["09-09",28],
["09-10",10],["09-11",8],["09-12",5],["09-13",1],
["09-15",4],["09-16",1],["09-18",1],
["09-21",1],["09-22",8],["09-23",10],["09-24",10],["09-25",111],
["09-26",31],["09-27",10],["09-28",98],["09-29",17],["09-30",22]
]
var FdateList = Fdata.map(function (item) {
return item[0];
});
var FvalueList = Fdata.map(function (item) {
return item[1];
});
var LdateList = Ldata.map(function (item) {
return item[0];
});
var LvalueList = Ldata.map(function (item) {
return item[1];
});
option = {
// Make gradient line here
visualMap: [{
show: false,
type: 'continuous',
seriesIndex: 0,
min: 0,
max: FdateList.length - 1//200
}, {
show: false,
type: 'continuous',
seriesIndex: 1,
dimension: 0,
min: 0,
max: LdateList.length - 1
}],
title: [{
left: 'center',
//text: 'Gradient along the y axis'
text: '每日涨粉数',
subtext: '20170730-20170930'
// 我的简书两月记:数据可视化
// https://zhuanlan.zhihu.com/p/29833266
}, {
top: '50%',
left: 'center',
//text: 'Gradient along the x axis'
text: '每日获赞数',
subtext: '20170730-20170930'
}],
tooltip: {
trigger: 'axis'
},
toolbox: {
feature: {
//dataView: {readOnly: false},
//restore: {},
saveAsImage: {}
}
},
xAxis: [{
data: FdateList
}, {
data: LdateList,
gridIndex: 1
}],
yAxis: [{
splitLine: {show: true},//false,}
}, {
splitLine: {show: true},//false,},
gridIndex: 1
}],
grid: [{
bottom: '60%'
}, {
top: '60%'
}],
series: [{
type: 'line',
showSymbol: true,//false,
data: FvalueList
}, {
type: 'line',
showSymbol: true,//false,
data: LvalueList,
xAxisIndex: 1,
yAxisIndex: 1
}]
};