diff --git a/panoramix/forms.py b/panoramix/forms.py index c41384b789c5..b38821e8fd00 100644 --- a/panoramix/forms.py +++ b/panoramix/forms.py @@ -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", diff --git a/panoramix/static/widgets/viz_nvd3.js b/panoramix/static/widgets/viz_nvd3.js index 01cac9ec7591..6ece06b740fc 100644 --- a/panoramix/static/widgets/viz_nvd3.js +++ b/panoramix/static/widgets/viz_nvd3.js @@ -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) diff --git a/panoramix/viz.py b/panoramix/viz.py index 447a0acd4298..e9584a81d55f 100644 --- a/panoramix/viz.py +++ b/panoramix/viz.py @@ -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')