Demo of xAxis.title.text and align
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/stock.js"></script>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@highcharts/controls@0.8.0" type="module"></script>
<figure class="highcharts-figure">
<div id="container"></div>
</figure>
<div class="highcharts-controls-wrapper">
<highcharts-controls>
<highcharts-group header="Update options">
<highcharts-control type="text" path="xAxis.title.text" value="This is the x-axis text"></highcharts-control>
<highcharts-control type="select" path="xAxis.title.align" value="middle" options="low,middle,high"></highcharts-control>
</highcharts-group>
</highcharts-controls>
</div>
CSS
* {
font-family:
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Helvetica,
Arial,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
sans-serif;
}
.highcharts-figure {
max-width: 800px;
margin: 1em auto;
}
.highcharts-controls-wrapper {
max-width: 800px;
margin: 1em auto;
padding: 0 10px;
}
highcharts-controls {
display: inline-block;
}
TypeScript
(async () => {
const data = await fetch(
'https://www.highcharts.com/samples/data/usdeur.json'
).then(response => response.json());
Highcharts.stockChart('container', {
title: {
text: 'Demo of <em>xAxis.title.text</em> and <em>align</em>'
},
xAxis: {
title: {
align: 'middle',
text: 'This is the x-axis text'
}
},
series: [{
data: data
}]
});
})();