Sankey chart value settings - Javascript highcharts

Javascript examples for highcharts:Chart Value

Description

Sankey chart value settings

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Highcharts Demo</title> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

#container {/*from w ww  .  ja v a2  s . co m*/
   min-width: 300px;
   max-width: 800px;
   height: 400px;
   margin: 1em auto;
   border: 1px solid silver;
}
#csv {
   display: none;
}


      </style> 
   </head> 
   <body> 
      <script src="https://code.highcharts.com/highcharts.js"></script> 
      <script src="https://code.highcharts.com/modules/sankey.js"></script> 
      <script src="https://code.highcharts.com/modules/exporting.js"></script> 
      <div id="container"></div> 
      <script type="text/javascript">
Highcharts.chart('container', {
    title: {
        text: 'Highcharts Sankey Diagram'
    },
    series: [{
        keys: ['from', 'to', 'weight'],
        data: [
            ['Brazil', 'Portugal', 5 ],
            ['Brazil', 'France', 1 ],
            ['Brazil', 'Spain', 1 ],
            ['Brazil', 'England', 1 ],
            ['Canada', 'Portugal', 1 ],
            ['Canada', 'France', 5 ],
            ['Canada', 'England', 1 ],
            ['Canada', 'Brazil-end', 4 ],
        ],
        nodes: [{
            id: 'Brazil-end',
            name: 'Brazil'
          }
        ],
        type: 'sankey',
        name: 'Sankey demo series'
    }]
});

      </script>  
   </body>
</html>

Related Tutorials