JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<button onclick="changeData();">change data</button>

JavaScript

$(function() {
  Highcharts.theme = {
    colors: [
      // Main Colours
      /* '#1E73AA', '#C44441', '#55BF3B', '#7A5992',
      '#009AB2', '#F08736', '#8EAACF', '#CE7057', '#737373' */
      '#2691d9', '#cf6563', '#79cf63', '#9d81b1', '#33e4ff', '#f39b58', '#a6bcd9', '#d78a75', '#a6a6a6'
    ],
    legend: {
      itemStyle: {
        font: '9pt Trebuchet MS, Verdana, sans-serif',
        color: 'black'
      },
      itemHoverStyle: {
        color: 'gray'
      }
    },
    lang: {
      decimalPoint: ',',
      thousandsSep: ' '
    }
  };

  // Apply the theme:
  Highcharts.setOptions(Highcharts.theme);
  
  
  $('#container').highcharts({
    title: {
      text: 'Monthly Average Temperature',
      x: -20 //center
    },
    subtitle: {
      text: 'Source: WorldClimate.com',
      x: -20
    },
    xAxis: {
      categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
        'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
      ]
    },
    yAxis: {
      title: {
        text: 'Temperature (°C)'
      },
      plotLines: [{
        value: 0,
        width: 1,
        color: '#808080'
      }]
    },
    tooltip: {
      valueSuffix: '°C'
    },
    legend: {
      layout: 'vertical',
      align: 'right',
      verticalAlign: 'middle',
      borderWidth: 0
    },
    series: [{
      name: 'New York',
      data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0, 24.8, 24.1, 20.1, 14.1, 8.6, 2.5]
    }]
  });
});
function changeData(){
	 $('#container').highcharts({
    title: {
      text: 'Monthly Average Temperature1',
      x: -20 //center
    },
    subtitle: {
      text: 'Source: WorldClimate.com1',
      x: -20
    },
    xAxis: {
      categories: ['Jan1', 'Feb1', 'Mar1', 'Apr1', 'May1', 'Jun1',
        'Jul1', 'Aug1', 'Sep1', 'Oct1', 'Nov1', 'Dec1'
      ]
    },
    yAxis: {
      title: {
        text: 'Temperature (°C)'
      },
      plotLines: [{
        value: 0,
        width: 1,
        color: '#808080'
      }]
    },
    tooltip: {
      valueSuffix:...