@@ -31,6 +31,7 @@ import ChartDataSetDTO, {
3131import {
3232 getAutoFunnelTopPosition ,
3333 getColumnRenderName ,
34+ getDrillableRows ,
3435 getExtraSeriesDataFormat ,
3536 getExtraSeriesRowData ,
3637 getGridStyle ,
@@ -42,6 +43,7 @@ import {
4243import { init } from 'echarts' ;
4344import isEmpty from 'lodash/isEmpty' ;
4445import Chart from '../../../models/Chart' ;
46+ import { ChartDrillOption } from '../../../models/ChartDrillOption' ;
4547import Config from './config' ;
4648import { Series , SeriesData } from './types' ;
4749
@@ -86,7 +88,11 @@ class BasicFunnelChart extends Chart {
8688 if ( ! this . isMatchRequirement ( props . config ) ) {
8789 return ;
8890 }
89- const newOptions = this . getOptions ( props . dataset , props . config ) ;
91+ const newOptions = this . getOptions (
92+ props . dataset ,
93+ props . config ,
94+ props . drillOption ,
95+ ) ;
9096 this . chart ?. setOption ( Object . assign ( { } , newOptions ) , true ) ;
9197 }
9298
@@ -98,12 +104,17 @@ class BasicFunnelChart extends Chart {
98104 this . chart ?. resize ( { width : context ?. width , height : context ?. height } ) ;
99105 }
100106
101- private getOptions ( dataset : ChartDataSetDTO , config : ChartConfig ) {
107+ private getOptions (
108+ dataset : ChartDataSetDTO ,
109+ config : ChartConfig ,
110+ drillOption : ChartDrillOption ,
111+ ) {
102112 const styleConfigs = config . styles || [ ] ;
103113 const dataConfigs = config . datas || [ ] ;
104- const groupConfigs = dataConfigs
105- . filter ( c => c . type === ChartDataSectionType . GROUP )
106- . flatMap ( config => config . rows || [ ] ) ;
114+ const groupConfigs : ChartDataSectionField [ ] = getDrillableRows (
115+ dataConfigs ,
116+ drillOption ,
117+ ) ;
107118 const aggregateConfigs = dataConfigs
108119 . filter ( c => c . type === ChartDataSectionType . AGGREGATE )
109120 . flatMap ( config => config . rows || [ ] ) ;
0 commit comments