A set of minor fixes (#3014)

This commit is contained in:
Maxime Beauchemin
2017-06-21 12:09:49 -07:00
committed by GitHub
parent 5344a80535
commit 99e1de58bc
6 changed files with 31 additions and 26 deletions

View File

@@ -655,6 +655,7 @@ export const controls = {
type: 'SelectControl',
label: 'Entity',
default: null,
validators: [v.nonEmpty],
description: 'This define the element to be plotted on the chart',
mapStateToProps: state => ({
choices: (state.datasource) ? state.datasource.gb_cols : [],
@@ -761,7 +762,9 @@ export const controls = {
type: 'SelectControl',
freeForm: true,
label: 'Table Timestamp Format',
default: 'smart_date',
default: '%Y-%m-%d %H:%M:%S',
validators: [v.nonEmpty],
clearable: false,
choices: D3_TIME_FORMAT_OPTIONS,
description: 'Timestamp Format',
},

View File

@@ -183,6 +183,9 @@ const visTypes = {
y_axis_format: {
label: 'Left Axis Format',
},
x_axis_format: {
choices: D3_TIME_FORMAT_OPTIONS,
},
},
},
@@ -211,6 +214,13 @@ const visTypes = {
},
sections.NVD3TimeSeries[1],
],
controlOverrides: {
x_axis_format: {
choices: D3_TIME_FORMAT_OPTIONS,
default: control =>
control.choices && control.choices.length > 0 ? [control.choices[0][0]] : null,
},
},
},
compare: {
@@ -475,9 +485,8 @@ const visTypes = {
label: null,
controlSetRows: [
['metric'],
['compare_lag'],
['compare_suffix'],
['y_axis_format'],
['compare_lag', 'compare_suffix'],
['y_axis_format', null],
],
},
],