Skip to content

Commit dafbfda

Browse files
committed
See DmitryBaranovskiy#137: Made it possible to break on years/months. Need to do week next.
1 parent 6a7f69c commit dafbfda

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

g.line.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116

117117
if (opts.axis) {
118118
var ax = (opts.axis + "").split(/[,\s]+/);
119-
(+ax[0] || +ax[2]) && chartinst.grid(x + gutter, gutter + 10, width - 2 * gutter, height - 2 * gutter, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper);
119+
//(+ax[0] || +ax[2]) && chartinst.grid(x + gutter, gutter + 10, width - 2 * gutter, height - 2 * gutter, opts.axisxstep || Math.floor((width - 2 * gutter) / 20), 0, paper);
120120
(+ax[1] || +ax[3]) && chartinst.grid(x + gutter, y + height - gutter, width - 2 * gutter, height - 2 * gutter, opts.axisystep || Math.floor((height - 2 * gutter) / 20), 1, paper);
121121
}
122122

@@ -215,9 +215,9 @@
215215
var cvrs = f || paper.set();
216216

217217
for (i = 0; i < ii; i++) {
218-
var X = xs[i] - (xs[i] - (xs[i - 1] || x)) / 2,
219-
w = ((xs[i + 1] || x + width) - xs[i]) / 2 + (xs[i] - (xs[i - 1] || x)) / 2,
220-
C;
218+
var X = xs[i] - (xs[i] - (xs[i - 1] || x)) / 2;
219+
var w = ((xs[i + 1] || x + width) - xs[i]) / 2 + (xs[i] - (xs[i - 1] || x)) / 2;
220+
var C;
221221

222222
f ? (C = {}) : cvrs.push(C = paper.rect(X - 1, y, Math.max(w + 1, 1), height).attr({ stroke: "none", fill: "#000", opacity: 0 }));
223223
C.values = [];
@@ -243,8 +243,9 @@
243243
f && f.call(C);
244244
}
245245

246-
console.log(cvrs);
247246
!f && (columns = cvrs);
247+
248+
chart.columns = columns;
248249
}
249250

250251
function createDots(f) {
@@ -271,9 +272,11 @@
271272
}
272273

273274
!f && (dots = cvrs);
275+
276+
chart.dots = dots;
274277
}
275278

276-
chart.push(lines, shades, symbols, axis, columns, dots);
279+
chart.push(lines, shades, symbols, axis);
277280
chart.lines = lines;
278281
chart.shades = shades;
279282
chart.symbols = symbols;

0 commit comments

Comments
 (0)