fix card count graph

https://forums.ankiweb.net/t/anki-2-1-28-beta/629/24
This commit is contained in:
Damien Elmes 2020-07-07 11:39:58 +10:00
parent 85cbd263da
commit 1162a8feb5

View file

@ -115,10 +115,10 @@ export function renderCards(
showTooltip(tooltipText(d), x, y); showTooltip(tooltipText(d), x, y);
}) })
.transition(trans) .transition(trans)
.attr("width", (d) => x(d.total)); .attr("x", (d) => x(d.total - d.count[1]))
.attr("width", (d) => x(d.count[1]) - x(0));
}; };
data.reverse();
svg.select("g.days") svg.select("g.days")
.selectAll("rect") .selectAll("rect")
.data(data) .data(data)
@ -127,7 +127,6 @@ export function renderCards(
enter enter
.append("rect") .append("rect")
.attr("height", 10) .attr("height", 10)
.attr("x", x(0))
.attr("y", bounds.marginTop) .attr("y", bounds.marginTop)
.attr("fill", (d: any): any => { .attr("fill", (d: any): any => {
switch (d.idx) { switch (d.idx) {