I am using an html canvas
element to draw some data as a chart.
I have 4 canvases on one page with a chart in each of them.
When the user clicks on a chart I want to enlarge the chart.
For the smaller charts, my code is as follows:
<canvas width='350' height='200' ></canvas>
For the larger charts, I rebuild the same chart with the following attributes:
<canvas width='700' height='350' ></canvas>
I have tried:
onclick - redraw the entire chart with new values in the height and width attributes.
onclick - redraw the entire chart with new values in the css styles height and width.
onclick - redraw the entire chart with new values in both attributes and css styles.
I am getting very unexpected results such as a blank chart, or bigger canvas but the proportions are way off.