<div id="visInteractiveYear" class="vega-embed"> <canvas width="1366" height="960" class="marks" style="width: 976px; height: 686px;"></canvas> </div> #add to css this: canvas.marks { max-width: 100%!important; height: auto!important; }