Column chart
author(s):
Torstein Hønsi
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<figure class="highcharts-figure">
<div id="container"></div>
<p class="highcharts-description">
A basic column chart comparing estimated corn and wheat production
in some countries.
The chart is making use of the axis crosshair feature, to highlight
the hovered country.
</p>
</figure>
CSS
body {
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
sans-serif;
background: var(--highcharts-background-color);
color: var(--highcharts-neutral-color-100);
}
.highcharts-figure,
.highcharts-data-table table {
min-width: 310px;
max-width: 800px;
margin: 1em auto;
}
#container {
height: 400px;
}
/* Custom CSS for the tooltip */
.highcharts-tooltip {
caption {
font-size: 0.9em;
font-weight: 500;
padding: 0.5em 0;
border-bottom: 1px solid var(--highcharts-neutral-color-10);
text-align: left;
}
th {
font-weight: normal;
padding: 0.15em 0;
color: var(--highcharts-neutral-color-60);
}
td {
font-weight: 500;
padding: 0.15em 0 0.15em 2em;
text-align: right;
}
tr:first-child td,
tr:first-child th {
padding-top: 0.75em;
}
tr:last-child td,
tr:last-child th {
padding-bottom: 0.25em;
}
}
.highcharts-data-table table {
font-family: Verdana, sans-serif;
border-collapse: collapse;
border: 1px solid var(--highcharts-neutral-color-10, #e6e6e6);
margin: 10px auto;
text-align: center;
width: 100%;
max-width: 500px;
}
.highcharts-data-table caption {
padding: 1em 0;
font-size: 1.2em;
color: var(--highcharts-neutral-color-60, #666);
}
.highcharts-data-table th {
font-weight: 600;
padding: 0.5em;
}
.highcharts-data-table td,
.highcharts-data-table th,
.highcharts-data-table caption {
padding: 0.5em;
}
.highcharts-data-table thead tr,
.highcharts-data-table tbody tr:nth-child(even) {
background: var(--highcharts-neutral-color-3, #f7f7f7);
}
.highcharts-description {
background: light-dark(#f2f6f2, #323232);
border-radius: 0 4px 4px 0;
border-left: 2px...
TypeScript
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Milano Cortina 2026 Winter Olympic medals, top six nations',
align: 'left'
},
subtitle: {
text:
'Source: <a target="_blank" ' +
'href="https://www.olympics.com/en/olympic-games/milano-cortina-2026/medals">www.olympics.com</a>',
align: 'left'
},
xAxis: {
categories: [
'Norway', 'USA', 'Netherlands', 'Italy', 'Germany', 'France'
],
crosshair: true,
accessibility: {
description: 'Countries'
}
},
yAxis: {
min: 0,
title: {
text: 'Medals'
}
},
legend: {
symbolRadius: 3
},
tooltip: {
shared: true,
headerFormat: '<table><caption>{point.key}</caption>',
pointFormat: `
<tr>
<th>
<svg width="20" height="10">
<rect x="5" y="0" width="10" height="10" rx="3" ry="3"
fill="{series.color}" />
</svg>
{series.name}
</th>
<td>{point.y}</td>
</tr>
`,
footerFormat: '</table>',
useHTML: true
},
plotOptions: {
column: {
pointPadding: 0.1,
borderWidth: 0
}
},
series: [
{
name: 'Gold medals',
data: [18, 12, 10, 10, 8, 8]
},
{
name: 'Silver medals',
data: [12, 12, 7, 6, 10, 9]
},
{
name: 'Bronze medals',
data: [11, 9, 3, 14, 8, 6]
}
]
});