|
|
@@ -33,7 +33,7 @@
|
|
|
const inst = getInstance();
|
|
|
const domWidth = inst ? inst.getWidth() : 500;
|
|
|
// 依据每一个图表配置生成图表选项
|
|
|
- const { yAxis = [], xAxis = [], legend, order, type, sortBy, series, dataZoom = [] } = props.chartConfig;
|
|
|
+ const { yAxis = [], xAxis = [], legend, order, type, sortBy, series, dataZoom = [], grid } = props.chartConfig;
|
|
|
const textStyle = {
|
|
|
color: '#fff',
|
|
|
};
|
|
|
@@ -106,6 +106,7 @@
|
|
|
top: 60,
|
|
|
right: 37,
|
|
|
bottom: 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: [
|
|
|
{
|
|
|
@@ -512,6 +513,7 @@
|
|
|
bottom: dataZoom.length ? 80 : 30,
|
|
|
left: 50, // 缩小左侧边距,增加图表宽度
|
|
|
right: 50, // 缩小右侧边距
|
|
|
+ ...grid,
|
|
|
},
|
|
|
legend: {
|
|
|
textStyle,
|
|
|
@@ -603,6 +605,7 @@
|
|
|
top: 40,
|
|
|
right: 60,
|
|
|
bottom: dataZoom.length ? 70 : 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: baseDataZoom,
|
|
|
xAxis: xAxis.map((e) => {
|
|
|
@@ -651,6 +654,7 @@
|
|
|
top: 40,
|
|
|
right: 60,
|
|
|
bottom: dataZoom.length ? 70 : 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: baseDataZoom,
|
|
|
xAxis: xAxis.map((e) => {
|
|
|
@@ -701,6 +705,7 @@
|
|
|
left: 60,
|
|
|
right: 60,
|
|
|
bottom: dataZoom.length ? 70 : 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: baseDataZoom,
|
|
|
xAxis: xAxis.map((e) => {
|
|
|
@@ -751,6 +756,7 @@
|
|
|
top: 50,
|
|
|
right: 50,
|
|
|
bottom: dataZoom.length ? 70 : 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: baseDataZoom,
|
|
|
xAxis: xAxis.map((e) => {
|
|
|
@@ -817,6 +823,7 @@
|
|
|
right: 40,
|
|
|
bottom: dataZoom.length ? 70 : 30,
|
|
|
show: false,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
dataZoom: baseDataZoom,
|
|
|
xAxis: xAxis.map((e) => {
|
|
|
@@ -854,6 +861,7 @@
|
|
|
grid: {
|
|
|
top: 50,
|
|
|
bottom: 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
legend: {
|
|
|
textStyle,
|
|
|
@@ -907,6 +915,7 @@
|
|
|
grid: {
|
|
|
top: 40,
|
|
|
bottom: 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
legend: {
|
|
|
textStyle,
|
|
|
@@ -1009,6 +1018,7 @@
|
|
|
grid: {
|
|
|
top: 40,
|
|
|
bottom: 30,
|
|
|
+ ...grid,
|
|
|
},
|
|
|
legend: {
|
|
|
textStyle,
|