Add NVD3's bullet chart (#1775)

* Add NVD3's bullet chart.

* Add empty lines before nested function definitions.

* Add thumbnail for bullet chart.

* Add bullet chart to gallery.rst.

* Add "requiresTime: false", fix indentation.

* Avoid scaling bullet chart vertically.

* Use a default if no range is specified.

* Fix coloring of bullet chart.
This commit is contained in:
Daniel Darabos
2016-12-12 16:58:13 +00:00
committed by Maxime Beauchemin
parent afb3c24d5a
commit 2993ff1d75
9 changed files with 171 additions and 1 deletions

View File

@@ -983,6 +983,48 @@ export const fields = {
],
description: 'The color for points and clusters in RGB',
},
ranges: {
type: 'TextField',
label: 'Ranges',
default: '',
description: 'Ranges to highlight with shading',
},
range_labels: {
type: 'TextField',
label: 'Range labels',
default: '',
description: 'Labels for the ranges',
},
markers: {
type: 'TextField',
label: 'Markers',
default: '',
description: 'List of values to mark with triangles',
},
marker_labels: {
type: 'TextField',
label: 'Marker labels',
default: '',
description: 'Labels for the markers',
},
marker_lines: {
type: 'TextField',
label: 'Marker lines',
default: '',
description: 'List of values to mark with lines',
},
marker_line_labels: {
type: 'TextField',
label: 'Marker line labels',
default: '',
description: 'Labels for the marker lines',
},
};
export default fields;

View File

@@ -49,3 +49,8 @@ export function initialState(vizType = 'table', datasourceType = 'table') {
};
}
// Control Panel fields that re-render chart without need for 'Query button'
export const autoQueryFields = [
'datasource',
'viz_type',
];

View File

@@ -354,6 +354,22 @@ const visTypes = {
],
},
bullet: {
label: 'Bullet Chart',
requiresTime: false,
controlPanelSections: [
{
label: null,
fieldSetRows: [
['metric'],
['ranges', 'range_labels'],
['markers', 'marker_labels'],
['marker_lines', 'marker_line_labels'],
],
},
],
},
big_number: {
label: 'Big Number with Trendline',
controlPanelSections: [