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

[line chart] adding option for circle markers #1006

Merged
merged 1 commit into from
Aug 26, 2016
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
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