Left axis as a table
author(s): Lars Cabrera
by Black Label
HTML
<script src="https://code.highcharts.com/gantt/highcharts-gantt.js"></script>
<script src="https://code.highcharts.com/gantt/modules/exporting.js"></script>
<script src="https://code.highcharts.com/gantt/modules/accessibility.js"></script>
<div class="scrolling-container">
<div id="container"></div>
</div>
CSS
#container {
max-width: 1200px;
min-width: 800px;
height: 400px;
margin: 1em auto;
}
.scrolling-container {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
JavaScript
Highcharts.ganttChart('container', {
title: {
text: 'Left Axis as Table'
},
lang: {
accessibility: {
axis: {
xAxisDescriptionPlural: 'The chart has a two-part X axis showing time in both week numbers and days.',
yAxisDescriptionSingular: 'The chart has a tabular Y axis showing a data table row for each point.'
}
}
},
accessibility: {
point: {
descriptionFormat: '{#if milestone}' +
'{name}, milestone for {yCategory} at {x:%Y-%m-%d}.' +
'{else}' +
'{name}, assigned to {yCategory} from {x:%Y-%m-%d} to {x2:%Y-%m-%d}.' +
'{/if}'
}
},
xAxis: {
tickPixelInterval: 70
},
yAxis: {
type: 'category',
labels:{
align: 'left',
useHTML: true,
},
grid: {
enabled: true,
borderColor: 'rgba(0,0,0,0.3)',
borderWidth: 1,
columns: [{
title: {
text: 'Project'
},
labels: {
format: '<div style="padding: 0 15px;">{point.name}</div>'
}
}, {
title: {
text: 'Assignee'
},
labels: {
format: '<div style="padding: 0 15px;">{point.assignee}</div>'
}
}, {
title: {
text: 'Est. days'
},
labels: {
format: '<div style="padding: 0 15px;">{(divide (subtract point.x2 point.x) 86400000):.2f}</div>'
}
}, {
labels: {
format: '<div style="padding: 0 15px;">{point.start:%e. %b}</div>'
},
title: {
text: 'Start date'
}
}, {
title: {
...