Commit c6825883 by crushh

update: dist

parent 9799818d
......@@ -27,7 +27,7 @@
<el-table-column minWidth="180" prop="memberId" label="链接信息">
<template slot-scope="{ row }">
<p class="overFlow">{{ row.name }}</p>
<p class="tips">{{ row.shortCode }}</p>
<p class="tips">code:{{ row.shortCode }}</p>
</template>
</el-table-column>
<el-table-column width="110" prop="linkType" label="链接类型">
......
......@@ -14,7 +14,6 @@
</template>
<script>
// import G2 from '@antv/g2';
import * as G2 from '@antv/g2';
export default {
data() {
......@@ -52,9 +51,35 @@ export default {
container: this.id,
autoFit: true,
forceFit: true,
padding: [20, 40, 40, 20]
height: 359,
width: 1400,
padding: [70, 60, 40, 70]
});
this.chart.source(this.charData, {
value: {
type: 'linear',
tickInterval: 50
}
});
this.chart.tooltip({
showMarkers: false,
shared: true
});
this.chart.scale({
bizDate: {
dataKey: 'date',
type: 'cat'
},
clickTimes: {
min: 0
},
clickNum: {
min: 0
},
addNum: {
min: 0
}
});
this.chart.data(this.charData);
// 图例
this.chart.legend({
custom: true,
......@@ -65,7 +90,24 @@ export default {
{ name: '今日点击人数', value: 'clickNum', marker: { symbol: 'line', style: { stroke: '#14C9C9', lineWidth: 12, lineHeight: 8 } } }
]
});
const lineConfig = {
this.chart.axis('clickTimes', {
grid: {
line: {
type: 'line',
style: {
stroke: '#E4E7ED',
lineDash: [3, 3]
}
}
},
label: {
formatter: text => {
let num = Number(text);
return num + '人次';
}
}
});
this.chart.axis('addNum', {
grid: {
line: {
type: 'line',
......@@ -76,20 +118,14 @@ export default {
}
},
label: {
style: {
fill: '#606266'
},
formatter: val => {
// 格式化参数值
return val;
formatter: text => {
let num = Number(text);
return num + '人';
}
}
};
//坐标轴配置(法一配置)
this.chart.axis('bizDate', lineConfig);
this.chart.axis('addNum', lineConfig);
this.chart.axis('clickTimes', lineConfig);
this.chart.axis('clickNum', lineConfig);
});
this.chart.axis('clickNum', false);
this.chart.tooltip({
showCrosshairs: true,
shared: true,
......
......@@ -79,31 +79,7 @@ export default {
data() {
return {
loading: false,
dateList: [
// { bizDate: '2018/8/1', 新增人数: 4623 }
// { bizDate: '2018/8/2', 新增人数: 6145 },
// { bizDate: '2018/8/3', 新增人数: 508 },
// { bizDate: '2018/8/4', 新增人数: 289 },
// { bizDate: '2018/8/5', 新增人数: 289 },
// { bizDate: '2018/8/6', 新增人数: 289 },
// { bizDate: '2018/8/7', 新增人数: 289 },
// { bizDate: '2018/8/8', 新增人数: 289 },
// { bizDate: '2018/8/9', 新增人数: 289 },
// { bizDate: '2018/8/10', 新增人数: 289 },
// { bizDate: '2018/8/11', 新增人数: 289 },
// { bizDate: '2018/8/12', 新增人数: 289 },
// { bizDate: '2018/8/13', 新增人数: 2589 },
// { bizDate: '2018/8/14', 新增人数: 289 },
// { bizDate: '2018/8/15', 新增人数: 289 },
// { bizDate: '2018/8/16', 新增人数: 29 },
// { bizDate: '2018/8/17', 新增人数: 289 },
// { bizDate: '2018/8/18', 新增人数: 9 },
// { bizDate: '2018/8/19', 新增人数: 2189 },
// { bizDate: '2018/8/20', 新增人数: 289 },
// { bizDate: '2018/8/21', 新增人数: 2869 },
// { bizDate: '2018/8/22', 新增人数: 289 },
// { bizDate: '2018/8/23', 新增人数: 2809 }
],
overViewData: { addNumT: 0, addNum: 0, dateList: [] }
};
},
......
......@@ -34,11 +34,7 @@ export default {
return []; //{ bizDate: '2018/8/1', 新增人数: 4623 }
}
},
id: String,
width: {
type: Number,
default: 1192
}
id: String
},
mounted() {
setTimeout(() => {
......@@ -59,10 +55,11 @@ export default {
if (!this.charData.length) return;
this.chart = new G2.Chart({
container: this.id,
height: 359,
autoFit: true,
forceFit: true,
width: this.width,
padding: [20, 40, 80, 80]
height: 359,
width: 1400,
padding: [70, 60, 40, 70]
});
//装载数据
......@@ -109,9 +106,9 @@ export default {
style: {
fill: '#606266'
},
formatter: val => {
// 格式化参数值
return val;
formatter: text => {
let num = Number(text);
return num + '人';
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment