Make chart size dynamic

This makes it possible to resize the chart while generating it