调整首页图表

This commit is contained in:
唐明明
2021-11-22 16:35:33 +08:00
parent a5688f6ff8
commit a683d8effc
4 changed files with 1534 additions and 1505 deletions

34
pages/index/new_file.js Normal file
View File

@@ -0,0 +1,34 @@
config.appendPadding = [10, 30, 10, 15]
const chart = new F2.Chart(config);
chart.source(data, {
date: {
range: [0, 1],
type: 'timeCat',
mask: 'MM-DD'
},
value: {
tickCount: 0
}
});
chart.legend({
position: 'bottom',
offsetY: 0,
offsetX: 30
});
chart.area()
.position('date*value')
.color('name', ['#5881d3', '#ca66e0'])
.shape('smooth')
chart.line()
.position('date*value')
.color('name', ['#5881d3', '#ca66e0'])
.shape('smooth', name => {
if (name === '预期收益率') {
return 'line';
}
if (name === '实际收益率') {
return 'line';
}
});
chart.render();