Add option to show minmax on x axis
This commit is contained in:
parent
618e117374
commit
63b27bbece
|
|
@ -185,7 +185,8 @@ class FormFactory(object):
|
|||
'step-before', 'step-after']),
|
||||
default='linear',
|
||||
description="Line interpolation as defined by d3.js"),
|
||||
'code': TextAreaField("Code", description="Put your code here", default=''),
|
||||
'code': TextAreaField(
|
||||
"Code", description="Put your code here", default=''),
|
||||
'pandas_aggfunc': SelectField(
|
||||
"Aggregation function",
|
||||
choices=self.choicify([
|
||||
|
|
@ -204,10 +205,15 @@ class FormFactory(object):
|
|||
description="Font size for the biggest value in the list"),
|
||||
'show_brush': BetterBooleanField(
|
||||
"Range Selector", default=True,
|
||||
description="Whether to display the time range interactive selector"),
|
||||
description=(
|
||||
"Whether to display the time range interactive selector")),
|
||||
'show_legend': BetterBooleanField(
|
||||
"Legend", default=True,
|
||||
description="Whether to display the legend (toggles)"),
|
||||
'x_axis_showminmax': BetterBooleanField(
|
||||
"X axis show min/max", default=True,
|
||||
description=(
|
||||
"Whether to display the min and max values of the axis")),
|
||||
'rich_tooltip': BetterBooleanField(
|
||||
"Rich Tooltip", default=True,
|
||||
description="The rich tooltip shows a list of all series for that point in time"),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ function viz_nvd3(data_attribute) {
|
|||
//chart.lines2.xScale( d3.time.scale.utc());
|
||||
chart.lines2.xScale(d3.time.scale.utc());
|
||||
chart.x2Axis
|
||||
.showMaxMin(true)
|
||||
.showMaxMin(viz.form_data.x_axis_showminmax)
|
||||
.tickFormat(formatDate);
|
||||
} else {
|
||||
chart = nv.models.lineChart()
|
||||
|
|
@ -55,7 +55,7 @@ function viz_nvd3(data_attribute) {
|
|||
chart.xScale(d3.time.scale.utc());
|
||||
chart.interpolate(viz.form_data.line_interpolation);
|
||||
chart.xAxis
|
||||
.showMaxMin(true)
|
||||
.showMaxMin(viz.form_data.x_axis_showminmax)
|
||||
.tickFormat(formatDate);
|
||||
chart.showLegend(viz.form_data.show_legend);
|
||||
chart.yAxis.tickFormat(d3.format('.3s'));
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ class NVD3TimeSeriesViz(NVD3Viz):
|
|||
('show_brush', 'show_legend'),
|
||||
('rich_tooltip', 'y_axis_zero'),
|
||||
('y_log_scale', 'contribution'),
|
||||
('y_axis_format', None)
|
||||
('y_axis_format', 'x_axis_showminmax'),
|
||||
]
|
||||
|
||||
def get_df(self, query_obj=None):
|
||||
|
|
|
|||
Loading…
Reference in New Issue