Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to show minmax on x axis #71

Merged
merged 1 commit into from Dec 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions panoramix/forms.py
Expand Up @@ -185,7 +185,8 @@ def __init__(self, viz):
'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([
Expand All @@ -204,10 +205,15 @@ def __init__(self, viz):
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"),
Expand Down
4 changes: 2 additions & 2 deletions panoramix/static/widgets/viz_nvd3.js
Expand Up @@ -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()
Expand All @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion panoramix/viz.py
Expand Up @@ -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):
Expand Down