had to put the script for chart in onMounted function to get it to work. Was not loaded on screen when referred, so got an error before.