Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

301
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda