You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by vo...@apache.org on 2024/08/15 03:47:12 UTC
(druid) 02/13: fix bar chart
This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a commit to branch explore_source
in repository https://gitbox.apache.org/repos/asf/druid.git
commit 69cdd7c86238cd2036c4c246f982a3a76ac0d4eb
Author: Vadim Ogievetsky <va...@ogievetsky.com>
AuthorDate: Mon Aug 12 15:22:54 2024 -0700
fix bar chart
---
web-console/src/modules/bar-chart-module.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/web-console/src/modules/bar-chart-module.tsx b/web-console/src/modules/bar-chart-module.tsx
index f53b7ff420d..ab72c78e391 100644
--- a/web-console/src/modules/bar-chart-module.tsx
+++ b/web-console/src/modules/bar-chart-module.tsx
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import { SqlExpression, SqlQuery } from '@druid-toolkit/query';
+import { L, SqlExpression, SqlQuery } from '@druid-toolkit/query';
import * as echarts from 'echarts';
import React, { useEffect, useRef } from 'react';
@@ -54,15 +54,14 @@ const barChartFn = ({ container, runSqlQuery }: any) => {
return {
async update({ source, parameterValues }: any) {
const { splitColumn, metric, metricToSort, limit } = parameterValues;
- console.log('splitColumn', splitColumn);
myChart.off('click');
- if (!splitColumn) return;
+ const splitExpression = splitColumn ? splitColumn.expression : L('Overall');
const v = await runSqlQuery(
SqlQuery.from(source)
- .addSelect(splitColumn.expression.as('dim'), { addToGroupBy: 'end' })
+ .addSelect(splitExpression.as('dim'), { addToGroupBy: 'end' })
.addSelect(metric.expression.as('met'), {
addToOrderBy: metricToSort ? undefined : 'end',
direction: 'DESC',
@@ -179,6 +178,7 @@ ModuleRepository.registerModule<RecordTableParameterValues>({
<div
className="bar-chart-module"
ref={x => {
+ if (updateFn.current) return;
updateFn.current = barChartFn({ container: x, runSqlQuery });
}}
style={{ height: '100%' }}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org