调整首页图表

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

View File

@@ -2,8 +2,8 @@
"name" : "链商星球", "name" : "链商星球",
"appid" : "__UNI__1F65101", "appid" : "__UNI__1F65101",
"description" : "安徽星煌,链商星球商家工具", "description" : "安徽星煌,链商星球商家工具",
"versionName" : "1.2.0", "versionName" : "1.2.1",
"versionCode" : 120, "versionCode" : 121,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -115,7 +115,7 @@
</view> </view>
<!-- 平台累计盈利通证 --> <!-- 平台累计盈利通证 -->
<view class="chart"> <view class="chart">
<view class="title">累计盈利和通证价值走势图</view> <view class="title">通证价值走势图</view>
<view class="chart-f2"> <view class="chart-f2">
<l-f2 ref="chartChange"></l-f2> <l-f2 ref="chartChange"></l-f2>
</view> </view>
@@ -356,42 +356,37 @@
}) })
}, },
// 绘制图表 // 绘制图表
showCartc(data) { showCartc(dataInfo) {
// 图表信息 // 图表信息
this.$refs.chartChange.init(config => { this.$refs.chartChange.init(config => {
config.appendPadding = [10, 30, 10, 15] config.appendPadding = [8, 30, 10, 15]
const chart = new F2.Chart(config); const chart = new F2.Chart(config)
chart.source(data, { chart.source(dataInfo, {
date: { date: {
range: [0, 1], type: 'timeCat',
type: 'timeCat', mask: 'MM/DD',
mask: 'MM-DD' tickCount: 7,
}, range: [ 0, 1 ]
value: { },
tickCount: 0 value: {
} tickCount: 7,
}); alias: '通证价值'
chart.legend({ }
position: 'bottom', });
offsetY: 0, chart.tooltip({
offsetX: 30 showCrosshairs: true,
}); crosshairsStyle: {
chart.area() stroke: 'rgba(255, 255, 255, 0.25)',
.position('date*value') lineWidth: 1
.color('name', ['#5881d3', '#ca66e0']) },
.shape('smooth') tooltipMarkerStyle: {
chart.line() fill: '#fff'
.position('date*value') }
.color('name', ['#5881d3', '#ca66e0']) });
.shape('smooth', name => { chart.line().position('date*value').shape('smooth').color('#ca66e0');
if (name === '预期收益率') { chart.point().position('date*value').shape('smooth').color('#ca66e0').style({stroke: '#fff', lineWidth: 1 });
return 'line'; chart.area().position('date*value').color('#ca66e0').shape('smooth')
} chart.render();
if (name === '实际收益率') {
return 'line';
}
});
chart.render();
return chart; return chart;
}) })
}, },

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();

File diff suppressed because one or more lines are too long