Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

300
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda