Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions webcomponent/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ customElements.define(

this.appendChild(canvasContainer)
const canvas = this.getElementsByTagName("canvas")[0]

// Setup the display size of the canvas to match the requested width/height,
// this will normally only work if the option responsive field is set to False.
canvas.width = this.getAttribute("chartWidth")
canvas.height = this.getAttribute("chartHeight")

const ctx = canvas.getContext("2d")
this._chart = new Chart(ctx, this._chartConfig)
}
Expand Down