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

158
Visualizações
d3js to plot vector data from json file

I'm pretty new to D3 and json files so apologies if this is a somewhat elementary question. I have a dataset with four fields organized in columns, say:

Name Time Value
X t1 v1
X t2 v2
X t3 v3
Y t1 V1
Y t2 V2
Z t1 V1
Z t2 V2
Z t3 V3
Z t4 V4

As you notice, these data are basically time series of V for various names all in the same file. I want to transfer this to a json file to be read by d3 and plotted. It strikes me that the most efficient way would be if I can somehow organize it in a way where I can have members in the json file such that

Option 1 -

{name:'X',time:[t1 t2...],value:[V1 V2...]} for each name

Option 2 - Another alternative would be:

{name:'X',time:'t1',value:'v1'},{name:'X',time:'t2',value:'v2'} and so on for each name 

I'm aware that option 2 is possible but it seems a little inefficient with repeatedly storing the name. Is option 1 possible to store in json and plot using d3?

I don't seem to be able to find any examples for option 2 and how I could go about plotting data like that.

Thanks for your help!

about 4 years ago · Juan Pablo Isaza
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