mirror of
https://github.com/apache/superset.git
synced 2026-06-09 17:49:26 +00:00
fix(plugin-chart-echarts): add orderby to funnel chart (#1099)
* fix(plugin-chart-echarts): add orderby fix https://github.com/apache/superset/issues/14534 * feat(plugin-chart-echarts): set orderby default value is true
This commit is contained in:
@@ -19,9 +19,11 @@
|
||||
import { buildQueryContext, QueryFormData } from '@superset-ui/core';
|
||||
|
||||
export default function buildQuery(formData: QueryFormData) {
|
||||
const { metric, sort_by_metric } = formData;
|
||||
return buildQueryContext(formData, baseQueryObject => [
|
||||
{
|
||||
...baseQueryObject,
|
||||
...(sort_by_metric && { orderby: [[metric, false]] }),
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,17 @@ const config: ControlPanelConfig = {
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
name: 'sort_by_metric',
|
||||
config: {
|
||||
default: true,
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort by metric'),
|
||||
description: t('Whether to sort results by the selected metric in descending order.'),
|
||||
},
|
||||
},
|
||||
],
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user