Download:
child 321:b4d13f27821e
parent 319:e2f4e8c5795c
320:745af5b44403
Anton Shestakov <av6@dwimlabs.net>, Mon, 16 Oct 2017 11:29:02 +0800
viewer: center line chart dots and lines around x axis better

1 файлов изменено, 2 вставок(+), 2 удалений(-) [+]
static/candolint.js file | annotate | diff | comparison | revisions
--- a/static/candolint.js Sun Oct 15 10:07:54 2017 +0800
+++ b/static/candolint.js Mon Oct 16 11:29:02 2017 +0800
@@ -107,7 +107,7 @@
var line = d3.line()
.defined(function(d) { return d[series.name] !== null; })
- .x(function(d) { return x(d.ordinal); })
+ .x(function(d) { return x(d.ordinal) + 0.5; })
.y(function(d) { return series.scale(d[series.name]); });
sg.append('path')
@@ -122,7 +122,7 @@
.filter(function(d) { return d[series.name] !== null; })
.append('circle')
.attr('r', 5)
- .attr('cx', function(d) { return x(d.ordinal); })
+ .attr('cx', function(d) { return x(d.ordinal) + 0.5; })
.attr('cy', function(d) { return series.scale(d[series.name]); });
});