@@ -8,6 +8,7 @@ import {BarLineResponseType} from '../../../types/response/bar-line-response.typ
88import { VisualizationType } from '../../../types/visualization.type' ;
99import { ChartBuildInterface } from '../chart-build.interface' ;
1010import { ChartOption } from '../chart-option' ;
11+ import { ChartBuilderQueryLanguageEnum } from "../../../../enums/chart-builder-query-language.enum" ;
1112
1213export class LineBar implements ChartBuildInterface {
1314 chartEnumType = ChartTypeEnum ;
@@ -37,8 +38,8 @@ export class LineBar implements ChartBuildInterface {
3738 * -data[0].series.length mean that have only one metric
3839 * - visualization type for single must have bar type
3940 */
40- if ( ! visualization . aggregationType . bucket ||
41- visualization . aggregationType . bucket . subBucket ||
41+ if ( ( visualization . aggregationType && ! visualization . aggregationType . bucket ) ||
42+ ( visualization . aggregationType && visualization . aggregationType && visualization . aggregationType . bucket . subBucket ) ||
4243 data [ 0 ] . series . length > 1 ||
4344 ( visualization . chartType === this . chartEnumType . LINE_CHART ||
4445 visualization . chartType === this . chartEnumType . AREA_LINE_CHART ) ) {
@@ -105,7 +106,8 @@ export class LineBar implements ChartBuildInterface {
105106 for ( let j = 0 ; j < data [ 0 ] . series . length ; j ++ ) {
106107 const metricId = Number ( data [ 0 ] . series [ j ] . metricId ) ;
107108 const index = serie . findIndex ( value => Number ( value . metricId ) === metricId ) ;
108- const metricLabel = extractMetricLabel ( data [ 0 ] . series [ j ] . metricId , visualization ) ;
109+ const metricLabel = visualization . queryLanguage === ChartBuilderQueryLanguageEnum . DSL ?
110+ extractMetricLabel ( data [ 0 ] . series [ j ] . metricId , visualization ) : '' ;
109111 const stackBy = data [ 0 ] . series [ j ] . name === '' ? metricLabel : data [ 0 ] . series [ j ] . name ;
110112 if ( index !== - 1 ) {
111113 const ser = {
0 commit comments