perf[charts]: perf effect

This commit is contained in:
Pan 2017-12-25 17:26:35 +08:00
parent f8a81e0f1f
commit 67bb2d980a
6 changed files with 36 additions and 36 deletions

View File

@ -46,13 +46,14 @@ export default {
this.chart.setOption({ this.chart.setOption({
backgroundColor: '#394056', backgroundColor: '#394056',
title: { title: {
text: '请求数', top: 20,
text: 'Requests',
textStyle: { textStyle: {
fontWeight: 'normal', fontWeight: 'normal',
fontSize: 16, fontSize: 16,
color: '#F1F1F3' color: '#F1F1F3'
}, },
left: '6%' left: '1%'
}, },
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
@ -63,11 +64,12 @@ export default {
} }
}, },
legend: { legend: {
top: 20,
icon: 'rect', icon: 'rect',
itemWidth: 14, itemWidth: 14,
itemHeight: 5, itemHeight: 5,
itemGap: 13, itemGap: 13,
data: ['移动', '电信', '联通'], data: ['CMCC', 'CTCC', 'CUCC'],
right: '4%', right: '4%',
textStyle: { textStyle: {
fontSize: 12, fontSize: 12,
@ -75,9 +77,10 @@ export default {
} }
}, },
grid: { grid: {
top: 100,
left: '3%', left: '3%',
right: '4%', right: '4%',
bottom: '3%', bottom: '2%',
containLabel: true containLabel: true
}, },
xAxis: [{ xAxis: [{
@ -92,7 +95,7 @@ export default {
}], }],
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
name: '单位(%', name: '(%)',
axisTick: { axisTick: {
show: false show: false
}, },
@ -114,7 +117,7 @@ export default {
} }
}], }],
series: [{ series: [{
name: '移动', name: 'CMCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
@ -148,7 +151,7 @@ export default {
}, },
data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122] data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122]
}, { }, {
name: '电信', name: 'CTCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',
@ -182,7 +185,7 @@ export default {
}, },
data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150] data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
}, { }, {
name: '联通', name: 'CUCC',
type: 'line', type: 'line',
smooth: true, smooth: true,
symbol: 'circle', symbol: 'circle',

View File

@ -46,15 +46,16 @@ export default {
const xData = (function() { const xData = (function() {
const data = [] const data = []
for (let i = 1; i < 13; i++) { for (let i = 1; i < 13; i++) {
data.push(i + '月份') data.push(i + 'month')
} }
return data return data
}()) }())
this.chart.setOption({ this.chart.setOption({
backgroundColor: '#344b58', backgroundColor: '#344b58',
title: { title: {
text: '统计', text: 'statistics',
x: '4%', x: '20',
top: '20',
textStyle: { textStyle: {
color: '#fff', color: '#fff',
fontSize: '22' fontSize: '22'
@ -81,12 +82,12 @@ export default {
} }
}, },
legend: { legend: {
x: '15%', x: '5%',
top: '10%', top: '10%',
textStyle: { textStyle: {
color: '#90979c' color: '#90979c'
}, },
data: ['女', '男', '平均'] data: ['female', 'male', 'average']
}, },
calculable: true, calculable: true,
xAxis: [{ xAxis: [{
@ -158,9 +159,9 @@ export default {
end: 35 end: 35
}], }],
series: [{ series: [{
name: '', name: 'female',
type: 'bar', type: 'bar',
stack: '总量', stack: 'total',
barMaxWidth: 35, barMaxWidth: 35,
barGap: '10%', barGap: '10%',
itemStyle: { itemStyle: {
@ -195,9 +196,9 @@ export default {
}, },
{ {
name: '', name: 'male',
type: 'bar', type: 'bar',
stack: '总量', stack: 'total',
itemStyle: { itemStyle: {
normal: { normal: {
color: 'rgba(0,191,183,1)', color: 'rgba(0,191,183,1)',
@ -226,9 +227,9 @@ export default {
220 220
] ]
}, { }, {
name: '平均', name: 'average',
type: 'line', type: 'line',
stack: '总量', stack: 'total',
symbolSize: 10, symbolSize: 10,
symbol: 'circle', symbol: 'circle',
itemStyle: { itemStyle: {

View File

@ -20,7 +20,7 @@ export default {
backToTop: 'BackToTop', backToTop: 'BackToTop',
charts: 'Charts', charts: 'Charts',
keyboardChart: 'Keyboard Chart', keyboardChart: 'Keyboard Chart',
lineChart: 'Line chart', lineChart: 'Line Chart',
mixChart: 'Mix Chart', mixChart: 'Mix Chart',
example: 'Example', example: 'Example',
Table: 'Table', Table: 'Table',

View File

@ -1,9 +1,7 @@
<template> <template>
<div class="components-container" style='height:100vh'>
<div class='chart-container'> <div class='chart-container'>
<chart height='100%' width='100%'></chart> <chart height='100%' width='100%'></chart>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -18,8 +16,9 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding: 20px;
width: 100%; width: 100%;
height: 90%; height: 85vh;
} }
</style> </style>

View File

@ -1,9 +1,7 @@
<template> <template>
<div class="components-container" style='height:100vh'>
<div class='chart-container'> <div class='chart-container'>
<chart height='100%' width='100%'></chart> <chart height='100%' width='100%'></chart>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -18,8 +16,9 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding:20px;
width: 100%; width: 100%;
height: 80%; height:85vh;
} }
</style> </style>

View File

@ -1,9 +1,7 @@
<template> <template>
<div class="components-container" style='height:100vh'>
<div class='chart-container'> <div class='chart-container'>
<chart height='100%' width='100%'></chart> <chart height='100%' width='100%'></chart>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -18,9 +16,9 @@ export default {
<style scoped> <style scoped>
.chart-container{ .chart-container{
position: relative; position: relative;
padding: 20px;
width: 100%; width: 100%;
height: 90%; height:85vh;
padding-bottom: 40px;
} }
</style> </style>