Javascript examples for highcharts:Chart Configuration
center align span inside text tag for pyramid chart
<html> <head> <title>Highcharts Demo</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script src="https://code.highcharts.com/highcharts.js"></script> <script src="https://code.highcharts.com/modules/funnel.js"></script> <script src="https://code.highcharts.com/modules/exporting.js"></script> <div id="container" style="min-width: 410px; max-width: 600px; height: 400px; margin: 0 auto"></div> <script type="text/javascript"> Highcharts.chart('container', { chart: {// www. ja v a2s .com type: 'pyramid' }, title: { text: 'Sales pyramid', x: -50 }, plotOptions: { series: { dataLabels: { useHTML:true, enabled: true, format: '<b>{point.name}</b><br/><div align="center">{point.y:,.0f}</div>', color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black', softConnector: true }, center: ['40%', '50%'], width: '80%' } }, legend: { enabled: false }, series: [{ name: 'Unique users', data: [ ['Website visits', 15654], ['Downloads', 4064], ['Requested price list', 1987], ['Invoice sent', 976], ['Finalized', 846] ] }] }); </script> </body> </html>