Highcharts Demo

author(s): Torstein Hønsi

by Black Label

HTML

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">

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

<div class="flex-container">
  <div id="container1"></div>
  <div id="container2"></div>
</div>

CSS

.flex-container {
  display: flex;
}

#container1, #container2 {
  flex: 1;
}

#container2{
      border-left: 1px solid #E2E2E2; /* Just for visualization */
}

JavaScript

Highcharts.theme = {
  colors: [
    "#2D2357",
    "#4B3A7D",
    "#614FA2",
    "#7765C7",
    "#8E7BED",
    "#A392F5",
    "#B8A8FF",
    "#CCC0FF",
    "#E0D9FF"
  ],
  chart: {
    panning: {
      enabled: false
    },
    zooming: {
      mouseWheel: {
        enabled: false
      }
    },
    style: {
      fontFamily: 'Montserrat, sans-serif'
    },
  },
  credits: {
    enabled: false
  },
  title: {
    style: {
      fontWeight: 'normal',
      color: 'black',
      fontSize: '16px'
    }
  },
  legend: {
    symbolRadius: 0,
    itemStyle: {
      fontWeight: 'normal',
      color: 'black',
      fontSize: '12px'
    }
  },
  plotOptions: {
    series: {
      borderRadius: 0,
      borderWidth: 0.5,
      borderColor: null,
      dataLabels: {
        style: {
          fontWeight: 'normal',
          color: 'black',
          fontSize: '12px'
        }
      }
    }
  },
  xAxis: {
    title: {
      style: {
        fontSize: 14,
        fontWeight: 'normal',
        color: 'black',
      }
    },
    labels: {
      style: {
        fontSize: 12,
        fontWeight: 'normal',
        color: 'black',
      }
    }
  },
  yAxis: {
    title: {
      style: {
        fontSize: 14,
        fontWeight: 'normal',
        color: 'black',
      }
    },
    labels: {
      style: {
        fontSize: 12,
        fontWeight: 'normal',
        color: 'black',
      }
    }
  }
};

Highcharts.setOptions(Highcharts.theme);


function formatCurrency(value) {
  const formattedValue = new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: 'USD',
    minimumFractionDigits: 0,
    maximumFractionDigits: 0
  }).format(value);

  return formattedValue;
}

Highcharts.chart('container1', {
  title: {
    text: 'Top 2023 Movies at the Worldwide Box Office',
    style:{
    fontWeight:'500'
    }    
  },
  subtitle: {
    text: '<a href="https://www.the-numbers.com/box-office-records/worldwide/all-movies/cumulative/released-in-2023"...