提交 d7580a3f 编写于 作者: N Nicky Chan 提交者: daminglu

Expand Chart should have same padding as non expand chart otherwise t… (#324)

上级 90e31230
...@@ -89,10 +89,10 @@ export default { ...@@ -89,10 +89,10 @@ export default {
setChartOptions(visData, tag, chartType) { setChartOptions(visData, tag, chartType) {
let grid = { let grid = {
left: '15%', left: 45,
top: '15%', top: 60,
right: '10%', right: 40,
bottom: '8%' bottom: 36
}; };
let title = { let title = {
text: tag, text: tag,
...@@ -185,9 +185,9 @@ export default { ...@@ -185,9 +185,9 @@ export default {
let ecChart = this.myChart; let ecChart = this.myChart;
let maxStep = -Infinity; let maxStep = -Infinity;
let minStep = Infinity; let minStep = Infinity;
grid.top = '42%'; grid.top = 126;
grid.left = '4%'; grid.left = 16;
grid.right = '10%'; grid.right = 40;
chartData.forEach(function (dataItem) { chartData.forEach(function (dataItem) {
let lineData = []; let lineData = [];
maxStep = Math.max(dataItem.step, maxStep); maxStep = Math.max(dataItem.step, maxStep);
......
...@@ -220,19 +220,20 @@ export default { ...@@ -220,19 +220,20 @@ export default {
}, },
legend: { legend: {
data: legendOptions, data: legendOptions,
top: '13%' top: 39
}, },
grid: { grid: {
left: '12%', left: 48,
top: '25%', top: 75,
right: '10%', right: 40,
bottom: '12%' bottom: 36
}, },
xAxis: { xAxis: {
type: 'value', type: 'value',
axisLabel: { axisLabel: {
fontSize: '11' fontSize: '11'
} },
splitNumber: this.isExpand ? 10 : 5
}, },
yAxis: { yAxis: {
type: 'value', type: 'value',
...@@ -427,19 +428,30 @@ export default { ...@@ -427,19 +428,30 @@ export default {
let horizontalToxAxisOptions = { let horizontalToxAxisOptions = {
step: { step: {
xAxis: { xAxis: {
type: 'value' type: 'value',
axisLabel: {
fontSize: '11'
},
splitNumber: this.isExpand ? 10 : 5
}, },
series: stepSeries series: stepSeries
}, },
relative: { relative: {
xAxis: { xAxis: {
type: 'value' type: 'value',
axisLabel: {
fontSize: '11'
},
splitNumber: this.isExpand ? 10 : 5
}, },
series: relativeSeries series: relativeSeries
}, },
wall: { wall: {
xAxis: { xAxis: {
type: 'time' type: 'time',
axisLabel: {
fontSize: '11'
},
}, },
series: wallSeries series: wallSeries
} }
...@@ -468,6 +480,12 @@ export default { ...@@ -468,6 +480,12 @@ export default {
height: 300 height: 300
}); });
} }
this.myChart.setOption({
xAxis: {
splitNumber: this.isExpand ? 10 : 5
}
});
}, },
toggleSelectZoom(enable) { toggleSelectZoom(enable) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册