Skip to content

Commit

Permalink
Adding an option for line_interpolation in line chart
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Oct 2, 2015
1 parent 3f9c838 commit bb535a3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
7 changes: 7 additions & 0 deletions panoramix/forms.py
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
2 changes: 2 additions & 0 deletions panoramix/static/widgets/viz_nvd3.js
Expand Up @@ -38,9 +38,11 @@ function viz_nvd3(token_name, json_callback) {
.tickFormat(function (d) {return tickMultiFormat(UTC(new Date(d))); })
.tickValues([]);
chart.y2Axis.tickFormat(d3.format('.3s'));
console.log(viz.form_data.line_interpolation);
} 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
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

0 comments on commit bb535a3

Please sign in to comment.