Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

Commit

Permalink
feat: add sort by metric for charts with multiple metrics (#952)
Browse files Browse the repository at this point in the history
Including
  - legacy-plugin-chart-pivot-table
  - legacy-plugin-chart-parallel-coordinates
  - legacy-plugin-chart-treemap
  • Loading branch information
maloun96 authored and ktmud committed Feb 18, 2021
1 parent bc0e3d5 commit b3cdb8d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ const config: ControlPanelConfig = {
['secondary_metric'],
['adhoc_filters'],
['limit', 'row_limit'],
['timeseries_limit_metric'],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort Descending'),
default: true,
description: t('Whether to sort descending or ascending'),
},
},
],
],
},
{
Expand Down
12 changes: 12 additions & 0 deletions plugins/legacy-plugin-chart-pivot-table/src/controlPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ const config: ControlPanelConfig = {
['groupby'],
['columns'],
['row_limit', null],
['timeseries_limit_metric'],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort Descending'),
default: true,
description: t('Whether to sort descending or ascending'),
},
},
],
],
},
{
Expand Down
19 changes: 18 additions & 1 deletion plugins/legacy-plugin-chart-treemap/src/controlPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,24 @@ const config: ControlPanelConfig = {
{
label: t('Query'),
expanded: true,
controlSetRows: [['metrics'], ['adhoc_filters'], ['groupby'], ['row_limit']],
controlSetRows: [
['metrics'],
['adhoc_filters'],
['groupby'],
['row_limit'],
['timeseries_limit_metric'],
[
{
name: 'order_desc',
config: {
type: 'CheckboxControl',
label: t('Sort Descending'),
default: true,
description: t('Whether to sort descending or ascending'),
},
},
],
],
},
{
label: t('Chart Options'),
Expand Down

0 comments on commit b3cdb8d

Please sign in to comment.