|
|
@@ -62,6 +62,11 @@ export default function(viewType, data, chartConfig, themeName, styleConfig, dri
|
|
|
}
|
|
|
|
|
|
function barOption(data, barConfig, themeConfig, styleConfig, drillDown) {
|
|
|
+ if(!data) {
|
|
|
+ return {
|
|
|
+ drillDown
|
|
|
+ };
|
|
|
+ }
|
|
|
const { xAxis, yAxis, groupBy } = barConfig;
|
|
|
const { barMaxWidth, barMinHeight, barGap, stack, labelVisible, labelPosition, labelDistance,
|
|
|
labelRotate, xNameLocation, xNameGap, xNameRotate, xLabelHiddenCover, xLabelRotate, dataZoomVisible,
|
|
|
@@ -76,9 +81,11 @@ function barOption(data, barConfig, themeConfig, styleConfig, drillDown) {
|
|
|
//钻取逻辑
|
|
|
if(drillDown){
|
|
|
let curDrillDown = drillDown.slice(-1)[0];
|
|
|
- xTitle = xAxis?`${curDrillDown.label}`:null
|
|
|
+ xTitle = xAxis?`${curDrillDown.label}`:null;
|
|
|
if(curDrillDown.type==='time'){
|
|
|
xGranularityV = curDrillDown.showDataType
|
|
|
+ }else {
|
|
|
+ xGranularityV = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -175,6 +182,11 @@ function barOption(data, barConfig, themeConfig, styleConfig, drillDown) {
|
|
|
}
|
|
|
|
|
|
function lineOption(data, lineConfig, themeConfig, styleConfig, drillDown) {
|
|
|
+ if(!data) {
|
|
|
+ return {
|
|
|
+ drillDown
|
|
|
+ };
|
|
|
+ }
|
|
|
const { labelSymbol, xNameLocation, xNameGap, xNameRotate, xLabelRotate, xLabelMargin, xLabelHiddenCover,
|
|
|
yNameLocation, yNameGap, yNameRotate, stack, labelVisible, labelPosition, labelDistance, labelRotate,
|
|
|
lineSmooth, labelSymbolSize, dataZoomVisible } = styleConfig;
|
|
|
@@ -192,6 +204,8 @@ function lineOption(data, lineConfig, themeConfig, styleConfig, drillDown) {
|
|
|
xTitle = xAxis?`${curDrillDown.label}`:null
|
|
|
if(curDrillDown.type==='time'){
|
|
|
xGranularityV = curDrillDown.showDataType
|
|
|
+ }else {
|
|
|
+ xGranularityV = null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -285,6 +299,11 @@ function lineOption(data, lineConfig, themeConfig, styleConfig, drillDown) {
|
|
|
}
|
|
|
|
|
|
function pieOption(data, pieConfig, themeConfig, styleConfig, drillDown) {
|
|
|
+ if(!data) {
|
|
|
+ return {
|
|
|
+ drillDown
|
|
|
+ };
|
|
|
+ }
|
|
|
let { labelHidden } = styleConfig;
|
|
|
let { xAxis, yAxis } = pieConfig;
|
|
|
let { tooMany } = data;
|
|
|
@@ -297,6 +316,8 @@ function pieOption(data, pieConfig, themeConfig, styleConfig, drillDown) {
|
|
|
let curDrillDown = drillDown.slice(-1)[0];
|
|
|
if(curDrillDown.type==='time'){
|
|
|
xGranularityV = curDrillDown.showDataType
|
|
|
+ }else {
|
|
|
+ xGranularityV = null;
|
|
|
}
|
|
|
}
|
|
|
|