未验证 提交 e2b7bfde 编写于 作者: N Nicky Chan 提交者: GitHub

Polish scalar and histogram chart UI, reorganize chart tools, add pinch zoom in support (#303)

上级 71236d3d
...@@ -56,7 +56,7 @@ export default { ...@@ -56,7 +56,7 @@ export default {
border solid 1px $-left-border-color border solid 1px $-left-border-color
background $-left-border-color background $-left-border-color
min-height 300px min-height 300px
padding 2% padding 2% 0% 2% 2%
box-sizing border-box box-sizing border-box
.right .right
overflow scroll overflow scroll
......
...@@ -43,6 +43,7 @@ export default { ...@@ -43,6 +43,7 @@ export default {
line-height 50px line-height 50px
height 50px height 50px
padding 0 20px padding 0 20px
margin-right 2%
cursor pointer cursor pointer
position relative position relative
.visual-dl-expand-head-info .visual-dl-expand-head-info
...@@ -54,8 +55,6 @@ export default { ...@@ -54,8 +55,6 @@ export default {
line-height 20px line-height 20px
font-size 12px font-size 12px
font-weight normal font-weight normal
.visual-dl-expand-panel-content
padding 0 20px
.visual-dl-expand-panel-content:after .visual-dl-expand-panel-content:after
content: ""; content: "";
clear: both; clear: both;
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
</div> </div>
<div class="visual-dl-page-right"> <div class="visual-dl-page-right">
<div class="visual-dl-page-config-container"> <div class="visual-dl-page-config-container">
Config
<ui-config <ui-config
:runsItems="runsItems" :runsItems="runsItems"
:config="config" :config="config"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div class="visual-dl-histogram-charts"> <div class="visual-dl-histogram-charts">
<div class="visual-dl-chart-box" ref="visual_dl_chart_box"> <div class="visual-dl-chart-box" ref="visual_dl_chart_box">
</div> </div>
<div class="visual-dl-chart-actions"> <div>
<v-btn flat class="sm-button" @click="expandArea"> <v-btn flat @click="expandArea">
<v-icon size="20">settings_overscan</v-icon> <v-icon size="20">settings_overscan</v-icon>
</v-btn> </v-btn>
</div> </div>
...@@ -94,7 +94,7 @@ export default { ...@@ -94,7 +94,7 @@ export default {
text: tag, text: tag,
textStyle: { textStyle: {
fontSize: '12', fontSize: '12',
fontFamily: 'Merriweather Sans' fontWeight: 'normal'
} }
}; };
if (chartType === 'overlay') { if (chartType === 'overlay') {
...@@ -183,7 +183,7 @@ export default { ...@@ -183,7 +183,7 @@ export default {
let minStep = Infinity; let minStep = Infinity;
grid.top = '42%'; grid.top = '42%';
grid.left = '4%'; grid.left = '4%';
grid.right = '15%'; grid.right = '10%';
chartData.forEach(function (dataItem) { chartData.forEach(function (dataItem) {
let lineData = []; let lineData = [];
maxStep = Math.max(dataItem.step, maxStep); maxStep = Math.max(dataItem.step, maxStep);
...@@ -197,6 +197,9 @@ export default { ...@@ -197,6 +197,9 @@ export default {
}); });
let option = { let option = {
textStyle: {
fontFamily: 'Merriweather Sans'
},
title, title,
color: ['#006069'], color: ['#006069'],
visualMap: { visualMap: {
...@@ -216,6 +219,7 @@ export default { ...@@ -216,6 +219,7 @@ export default {
onZero: false onZero: false
}, },
axisLabel: { axisLabel: {
fontSize: '11',
formatter: function (value) { formatter: function (value) {
return Math.round(value * 100) / 100; return Math.round(value * 100) / 100;
} }
...@@ -232,6 +236,9 @@ export default { ...@@ -232,6 +236,9 @@ export default {
inverse: true, inverse: true,
splitLine: { splitLine: {
show: false show: false
},
axisLabel: {
fontSize: '11'
} }
}, },
grid, grid,
...@@ -355,6 +362,7 @@ export default { ...@@ -355,6 +362,7 @@ export default {
zrDrawElement.tooltip = new echarts.graphic.Text({ zrDrawElement.tooltip = new echarts.graphic.Text({
position: [e.offsetX + 30, e.offsetY - 50], position: [e.offsetX + 30, e.offsetY - 50],
style: { style: {
fontFamily: 'Merriweather Sans',
text: yValueFormat(hoveredItem.items[nearestIndex.binIndex][3]), text: yValueFormat(hoveredItem.items[nearestIndex.binIndex][3]),
textFill: '#000', textFill: '#000',
fontSize: 14, fontSize: 14,
...@@ -375,6 +383,7 @@ export default { ...@@ -375,6 +383,7 @@ export default {
gridRect.y + gridRect.height gridRect.y + gridRect.height
], ],
style: { style: {
fontFamily: 'Merriweather Sans',
text: Math.round(hoveredItem.items[nearestIndex.binIndex][2] * 1000) / 1000, text: Math.round(hoveredItem.items[nearestIndex.binIndex][2] * 1000) / 1000,
textFill: '#fff', textFill: '#fff',
textAlign: 'center', textAlign: 'center',
...@@ -394,6 +403,7 @@ export default { ...@@ -394,6 +403,7 @@ export default {
linePoints[linePoints.length - 1][1] linePoints[linePoints.length - 1][1]
], ],
style: { style: {
fontFamily: 'Merriweather Sans',
text: hoveredItem.step, text: hoveredItem.step,
textFill: '#fff', textFill: '#fff',
textVerticalAlign: 'middle', textVerticalAlign: 'middle',
...@@ -498,28 +508,12 @@ export default { ...@@ -498,28 +508,12 @@ export default {
<style lang="stylus"> <style lang="stylus">
.visual-dl-histogram-charts .visual-dl-histogram-charts
float left float left
margin-bottom 20px margin 2% 2% 0 0
margin 20px 30px 10px 0
background #fff background #fff
padding 10px padding 10px
.visual-dl-chart-box .visual-dl-chart-box
float left float left
width 400px width 400px
height 300px height 300px
.visual-dl-chart-actions
height 50px
margin-left 10%
.sm-form-item
float left
width 100px
margin-top 0px
display block
.sm-button
float left
display block
height 20px
line-height 20px
margin-top 10px
padding 0 10px
</style> </style>
...@@ -85,4 +85,5 @@ export default { ...@@ -85,4 +85,5 @@ export default {
content: ""; content: "";
clear: both; clear: both;
display: block; display: block;
padding-bottom: 2%
</style> </style>
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
<div class="visual-dl-page-right"> <div class="visual-dl-page-right">
<div class="visual-dl-page-config-container"> <div class="visual-dl-page-config-container">
<ui-config :runsItems="runsItems" <ui-config
:runsItems="runsItems"
:config="config" :config="config"
></ui-config> ></ui-config>
</div> </div>
......
...@@ -164,9 +164,12 @@ export default { ...@@ -164,9 +164,12 @@ export default {
let legendOptions = tagList.map(item => item.run); let legendOptions = tagList.map(item => item.run);
let instance = this; let instance = this;
let option = { let option = {
textStyle: {
fontFamily: 'Merriweather Sans'
},
color: [ color: [
'#008c99',
'#c23531', '#c23531',
'#61a0a8',
'#d48265', '#d48265',
'#91c7ae', '#91c7ae',
'#749f83', '#749f83',
...@@ -179,15 +182,21 @@ export default { ...@@ -179,15 +182,21 @@ export default {
title: { title: {
text: tag, text: tag,
textStyle: { textStyle: {
fontSize: '12', fontSize: 13,
fontFamily: 'Merriweather Sans' fontWeight: 'normal'
} }
}, },
dataZoom: [{
type: 'inside'
}],
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
animation: true animation: true
}, },
textStyle: {
fontSize: '13',
},
position: ['10%', '90%'], position: ['10%', '90%'],
formatter(params, ticket, callback) { formatter(params, ticket, callback) {
let data = instance.getFormatterPoints(params[0].data); let data = instance.getFormatterPoints(params[0].data);
...@@ -201,26 +210,28 @@ export default { ...@@ -201,26 +210,28 @@ export default {
dataZoom: {}, dataZoom: {},
restore: {}, restore: {},
saveAsImage: {} saveAsImage: {}
}, }
left: '10%',
top: '90%'
}, },
legend: { legend: {
data: legendOptions, data: legendOptions,
top: '10%' top: '13%'
}, },
grid: { grid: {
left: '10%', left: '12%',
top: '20%', top: '25%',
right: '10%', right: '10%',
bottom: '20%' bottom: '8%'
}, },
xAxis: { xAxis: {
type: 'value' type: 'value',
axisLabel: {
fontSize: '11'
}
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
fontSize: '11',
formatter(value) { formatter(value) {
return value.toString().slice(0, 5); return value.toString().slice(0, 5);
} }
...@@ -522,11 +533,11 @@ export default { ...@@ -522,11 +533,11 @@ export default {
}; };
let widthPropMap = { let widthPropMap = {
Run: 40, Run: 40,
Time: 90, Time: 120,
Step: 40, Step: 40,
Value: 50, Value: 50,
Smoothed: 50, Smoothed: 60,
Relative: 40 Relative: 60
}; };
let transformedData = data.map(item => { let transformedData = data.map(item => {
let data = item.item; let data = item.item;
...@@ -567,7 +578,7 @@ export default { ...@@ -567,7 +578,7 @@ export default {
<style lang="stylus"> <style lang="stylus">
.visual-dl-page-charts .visual-dl-page-charts
float left float left
margin 20px 30px 10px 0 margin 2% 2% 0 0
background: #fff; background: #fff;
padding: 10px; padding: 10px;
.visual-dl-chart-actions .visual-dl-chart-actions
......
...@@ -78,6 +78,7 @@ export default { ...@@ -78,6 +78,7 @@ export default {
content: ""; content: "";
clear: both; clear: both;
display: block; display: block;
padding-bottom: 2%
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册