Skip to content

Commit

Permalink
support fill color
Browse files Browse the repository at this point in the history
  • Loading branch information
penqe committed Apr 4, 2024
1 parent 385ee71 commit 9dd56f2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion stanzas/barchart/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,15 @@ export default class Barchart extends MetaStanza {
return `translate(${this.xAxisGen.axisGen.scale()(d.x0)},0)`}
);

const css = (key) => getComputedStyle(this.element).getPropertyValue(key);
const fill = css("--togostanza-theme-series_0_color");

bar
.append("rect")
.attr("y", (d) => y(d.length))
.attr("width", x(bins[0].x1) - x(bins[0].x0) - 1)
.attr("height", (d) => height - y(d.length))
.attr("fill", "steelblue");
.attr("fill", fill);
}

handleEvent(event) {
Expand Down

0 comments on commit 9dd56f2

Please sign in to comment.