1

i'm trying to create a sankey-diagram using highcharts library. Tooltip works fine on sankey lines, appart from the nodes, when i hover to the node it throws an error:

Failed to retrieve the 'series' property of a null or undefined reference

The code i use for the sankey is very simple i dont understand why it doesn't work. Here is the code:

 var sankeyOptions = {
                    chart: {                      
                        renderTo: "container"                       
                    },
                    title: {
                        text: title
                    },

                series: [{
                    keys: ['from', 'to', 'weight'],
                    data: [
                        ['Oil', 'Transportation', 94],
                        ['Natural Gas', 'Transportation', 3],
                        ['Coal', 'Transportation', 0],
                        ['Renewable', 'Transportation', 0],
                        ['Nuclear', 'Transportation', 3],

                        ['Oil', 'Industrial', 41],
                        ['Natural Gas', 'Industrial', 40],
                        ['Coal', 'Industrial', 7],
                        ['Renewable', 'Industrial', 11],
                        ['Nuclear', 'Industrial', 0],

                        ['Oil', 'R&C', 17],
                        ['Natural Gas', 'R&C', 76],
                        ['Coal', 'R&C', 1],
                        ['Renewable', 'R&C', 7],
                        ['Nuclear', 'R&C', 0],

                        ['Oil', 'Electric Power', 1],
                        ['Natural Gas', 'Electric Power', 18],
                        ['Coal', 'Electric Power', 48],
                        ['Renewable', 'Electric Power', 11],
                        ['Nuclear', 'Electric Power', 22]

                    ],

                    type: 'sankey',
                    name: 'Energy in the United States'
                }]
            };

           var chartObject = new Highcharts.Chart(sankeyOptions);

Thanks for your help.

inna
  • 169
  • 1
  • 2
  • 10
  • works in a [fiddle](http://jsfiddle.net/hv00jdc4/1/) – Namaskar Mar 20 '18 at 16:46
  • Can you make a live example, e.g. on jsfiddle? – morganfree Mar 20 '18 at 19:20
  • @morganfree i'm sorry i cannot reproduce a live ex because it is separated in many other files – inna Mar 21 '18 at 08:42
  • @SvenWritesCode yes it works in your example , this is i dont understand why in my case in local it throws an error when hover on the node. – inna Mar 21 '18 at 08:45
  • You can put the code from different files into one live example, or use something else like plunkr which allows to have multiple files. The live example works, your code is not complete - there is not much we can do about the issue. – morganfree Mar 21 '18 at 11:55

0 Answers0