Skip to content

Commit

Permalink
[line chart] adding option for circle markers (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Aug 26, 2016
1 parent 36a6714 commit b93f9ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
6 changes: 6 additions & 0 deletions caravel/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ function nvd3Vis(slice) {
.attr('width', width)
.call(chart);

if (fd.show_markers) {
svg.selectAll('.nv-point')
.style('stroke-opacity', 1)
.style('fill-opacity', 1);
}

return chart;
});

Expand Down
7 changes: 7 additions & 0 deletions caravel/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def __init__(self, viz):
"default": False,
"description": ""
}),
'show_markers': (BetterBooleanField, {
"label": _("Show Markers"),
"default": False,
"description": (
"Show data points as circle markers on top of the lines "
"in the chart")
}),
'show_bar_value': (BetterBooleanField, {
"label": _("Bar Values"),
"default": False,
Expand Down
3 changes: 2 additions & 1 deletion caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,8 @@ class NVD3TimeSeriesViz(NVD3Viz):
('show_brush', 'show_legend'),
('rich_tooltip', 'y_axis_zero'),
('y_log_scale', 'contribution'),
('line_interpolation', 'x_axis_showminmax'),
('show_markers', 'x_axis_showminmax'),
('line_interpolation', None),
('x_axis_format', 'y_axis_format'),
('x_axis_label', 'y_axis_label'),
),
Expand Down

0 comments on commit b93f9ec

Please sign in to comment.