1π
β
The styles you apply via css
are lost when you getContext
. You should try using prop
too/instead.
canvas.prop({ width: 700, height: 400 });
Source:stackexchange.com