Download:
child 312:908be10494c7
parent 310:d6d9ed9a566d
311:cdd183a85dd1
Anton Shestakov <av6@dwimlabs.net>, Fri, 06 Oct 2017 16:22:57 +0800
viewer: hide dashed line in the chart if current check is not anywhere on it

1 файлов изменено, 10 вставок(+), 7 удалений(-) [+]
static/candolint.js file | annotate | diff | comparison | revisions
--- a/static/candolint.js Fri Oct 06 16:06:44 2017 +0800
+++ b/static/candolint.js Fri Oct 06 16:22:57 2017 +0800
@@ -70,13 +70,16 @@
y1.rangeRound([height, 0]);
y2.rangeRound([height, 0]);
- cg.append('line')
- .attr('stroke', '#000')
- .attr('stroke-dasharray', '5,2')
- .attr('x1', x(data.current) + 0.5)
- .attr('y1', 0)
- .attr('x2', x(data.current) + 0.5)
- .attr('y2', height);
+ var cx = x(data.current) + 0.5;
+ if (!isNaN(cx)) {
+ cg.append('line')
+ .attr('stroke', '#000')
+ .attr('stroke-dasharray', '5,2')
+ .attr('x1', cx)
+ .attr('y1', 0)
+ .attr('x2', cx)
+ .attr('y2', height);
+ }
var hover = cg.append('line')
.attr('opacity', 0)