|
|
@@ -9,6 +9,7 @@ import { deepAssign } from '../utils/baseUtils'
|
|
|
* | A | B | C
|
|
|
* 0 +----+----+---
|
|
|
* 0 500 1000
|
|
|
+ *
|
|
|
*/
|
|
|
export default function(chartType, legendVisible, dataZoomVisible, assignConfig) {
|
|
|
if(chartType === 'bar' || chartType === 'line' || chartType === 'scatter') {
|
|
|
@@ -28,24 +29,51 @@ export default function(chartType, legendVisible, dataZoomVisible, assignConfig)
|
|
|
option: deepAssign({ legend: { type: 'scroll', top: 50, right: 50, bottom: 100, orient: 'vertical', width: '35%' }, grid: { right: '16%' } }, assignConfig)
|
|
|
}, {
|
|
|
query: { maxWidth: 1000, maxHeight: 1000 }, // E
|
|
|
- option: !dataZoomVisible ? deepAssign({ legend: { type: 'scroll', right: 'center', bottom: 50, orient: 'horizontal', width: '90%' }, grid: { bottom: 100 } }, assignConfig) :
|
|
|
+ option: !dataZoomVisible ? deepAssign({
|
|
|
+ legend: { type: 'scroll', right: 'center', bottom: 50, orient: 'horizontal', width: '90%' },
|
|
|
+ grid: { bottom: 50 }
|
|
|
+ }, assignConfig) :
|
|
|
deepAssign({ legend: { type: 'scroll', right: 'center', top: 50, orient: 'horizontal', width: '90%' }, grid: { top: 100 } }, assignConfig)
|
|
|
}, {
|
|
|
query: { maxWidth: 500, maxHeight: 1000 }, // D
|
|
|
- option: !dataZoomVisible ? deepAssign({ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' }, grid: { bottom: 50 } }, assignConfig) :
|
|
|
+ option: !dataZoomVisible ? deepAssign({
|
|
|
+ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' },
|
|
|
+ grid: { left: 100, right: 100, bottom: 50 }
|
|
|
+ }, assignConfig) :
|
|
|
deepAssign({ legend: { type: 'scroll', right: 'center', top: 0, orient: 'horizontal', width: '90%' }, }, assignConfig)
|
|
|
}, {
|
|
|
query: { minWidth: 1000, maxHeight: 500 }, // C
|
|
|
option: deepAssign({ legend: { type: 'scroll', top: 50, right: 50, orient: 'vertical', height: '80%', width: '35%' }, grid: { right: '20%'} }, assignConfig)
|
|
|
}, {
|
|
|
query: { maxWidth: 1000, maxHeight: 500 }, // B
|
|
|
- option: !dataZoomVisible ? deepAssign({ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' }, grid: { top: 50, left: 80, right: 80, bottom: 50 } }, assignConfig) :
|
|
|
+ option: !dataZoomVisible ? deepAssign({
|
|
|
+ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' },
|
|
|
+ grid: { top: 50, left: 80, right: 80, bottom: 50 }
|
|
|
+ }, assignConfig) :
|
|
|
deepAssign({ legend: { type: 'scroll', right: 'center', top: 20, orient: 'horizontal', width: '90%' }, grid: { top: 80, left: 80, right: 80 } }, assignConfig)
|
|
|
}, {
|
|
|
query: { maxWidth: 500, maxHeight: 500 }, // A
|
|
|
- option: !dataZoomVisible ? deepAssign({ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' }, grid: { top: 50, left: 80, right: 80 } }, assignConfig) :
|
|
|
+ option: !dataZoomVisible ? deepAssign({
|
|
|
+ legend: { type: 'scroll', right: 'center', bottom: 0, orient: 'horizontal', width: '90%' },
|
|
|
+ grid: { top: 50, left: 80, right: 80, bottom: 50 }
|
|
|
+ }, assignConfig) :
|
|
|
deepAssign({ legend: { type: 'scroll', right: 'center', top: 20, orient: 'horizontal', width: '90%' }, grid: { top: 80, left: 80, right: 80 } }, assignConfig)
|
|
|
- }] : []
|
|
|
+ }]
|
|
|
+ :
|
|
|
+ [{
|
|
|
+ query: { minWidth: 1000 }, // CFI
|
|
|
+ option: deepAssign({}, assignConfig)
|
|
|
+ }, {
|
|
|
+ query: { maxWidth: 1000 }, // BEH
|
|
|
+ option: deepAssign({
|
|
|
+ grid: { right: 50 }
|
|
|
+ }, assignConfig)
|
|
|
+ }, {
|
|
|
+ query: { maxWidth: 500 }, // ADG
|
|
|
+ option: deepAssign({
|
|
|
+ grid: { right: 50 }
|
|
|
+ }, assignConfig)
|
|
|
+ }]
|
|
|
}else if(chartType === 'pie') {
|
|
|
return [{
|
|
|
query: { minWidth: 1000, minHeight: 1000 }, // I
|