[Feature] Percentage columns in Table Viz (#3586)

* Added percent metric options to table viz

* Added unit tests for TableViz

* fixed code for python3

* bump travis
This commit is contained in:
Jeff Niu
2017-10-16 20:16:20 -07:00
committed by Maxime Beauchemin
parent adef519583
commit e121a8585e
5 changed files with 293 additions and 6 deletions

View File

@@ -100,6 +100,19 @@ export const controls = {
description: t('One or many metrics to display'),
},
percent_metrics: {
type: 'SelectControl',
multi: true,
label: t('Percentage Metrics'),
valueKey: 'metric_name',
optionRenderer: m => <MetricOption metric={m} />,
valueRenderer: m => <MetricOption metric={m} />,
mapStateToProps: state => ({
options: (state.datasource) ? state.datasource.metrics : [],
}),
description: t('Metrics for which percentage of total are to be displayed'),
},
y_axis_bounds: {
type: 'BoundsControl',
label: t('Y Axis Bounds'),

View File

@@ -338,8 +338,9 @@ export const visTypes = {
label: t('GROUP BY'),
description: t('Use this section if you want a query that aggregates'),
controlSetRows: [
['groupby', 'metrics'],
['include_time', null],
['groupby'],
['metrics', 'percent_metrics'],
['include_time'],
['timeseries_limit_metric', 'order_desc'],
],
},