Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
Angular - Errors when filling a Highcharts network graph with an array

I try to fill a network graph made with the JS Highcharts library (see an example in that JS Fiddle). The whole thing is made on an Angular framework.

I want to fill the data part of the graph with an array.

When I fill directly that data part, the network is well built :

data : [
['Test 1', 'Test2'], 
['Test 1', 'Test 3']
]

It gives :
enter image description here

Now I want to fill it by using that array :

var myArray3 = [['Test 1', 'Test2'], ['Test 1', 'Test 3']];

So I write in the data part...

data : [myArray3]

... which gives a strange network graph.. I should have 3 nodes and two lines which is not the case. What's more, as you can see, I get the couples (Test1,Test2)/ (Test1,Test3) instead of Test1, Test2 and Test3.
enter image description here

How could I do to make my graph work with the data taken from my array myArray3 ?

Any help would be greatly appreciated !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You wrapped your myArray3 unnecessarily in the brackets. The below will work:

var myArray3 = [['Test 1', 'Test2'], ['Test 1', 'Test 3']];
...
data : myArray3

https://jsfiddle.net/0rnfdjaz/6/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!