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

Adding interpolation choice for line charts #39

Merged
merged 2 commits into from
Oct 2, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions panoramix/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ def __init__(self, viz):
choices=[(s, s) for s in ['random', 'flat', 'square']],
default="random",
description="Rotation to apply to words in the cloud"),
'line_interpolation': SelectField(
"Line Interpolation",
choices=[(s, s) for s in [
'linear', 'basis', 'cardinal', 'monotone',
'step-before', 'step-after']],
default='linear',
description="Line interpolation as defined by d3.js"),
'code': TextAreaField("Code", description="Put your code here"),
'size_from': TextField(
"Font Size From",
Expand Down
1 change: 1 addition & 0 deletions panoramix/static/widgets/viz_nvd3.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function viz_nvd3(token_name, json_callback) {
} else {
var chart = nv.models.lineChart()
}
chart.interpolate(viz.form_data.line_interpolation);
chart.xScale(d3.time.scale());
chart.xAxis
.showMaxMin(false)
Expand Down
2 changes: 1 addition & 1 deletion panoramix/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ class NVD3TimeSeriesViz(NVD3Viz):
'metrics',
'groupby', 'limit',
('rolling_type', 'rolling_periods'),
('num_period_compare', None),
('num_period_compare', 'line_interpolation'),
('show_brush', 'show_legend'),
('rich_tooltip', 'y_axis_zero'),
('y_log_scale', 'contribution')
Expand Down