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

356
Views
migrar gráfico js en angular con Echart

Necesito dibujar un gráfico. Tengo este código de referencia en .js.

 loadServizi(servizi => { loadConcetti(concetti => { graph = buildGraph(servizi, concetti); buildChartConcetti(graph); }); });

en angular he replicado loadServizi y loadConcetti que devuelven Observable<Concetti[]> y lo mismo para loadServizi, la función buildGraph necesita esta matriz 2 de Object para dibujar el gráfico, esta es mi implementación en angular:

 drowChartAngular(): void { this.concettoService.getConcetti().subscribe(dataConcetti => { this.concettoService.getServizi().subscribe(dataservice=>{ this.concetti = dataConcetti; this.servizi = dataservice; this.graph = this.buildGraph(dataservice, dataConcetti); }); });

y en la función buildGraph:

 servizi.forEach(d => { let idServizio = `${this.DATA_CATEGORY.servizio.id}-${d.id}`; nodes[idServizio] = { id: idServizio, name: d.nome, category: this.DATA_CATEGORY.servizio.id, info: this.createServizioInfo(d), adjNodes: d.dominiInteresse.map(x => `${this.DATA_CATEGORY.concetto.id}-${x.concettoRelativo.id}`) }; });

en esta línea "adjNodes: d.dominiInteresse.map(x => ${this.DATA_CATEGORY.concetto.id}-${x.concettoRelativo.id} )" tengo este error en la consola:

 ERROR TypeError: Cannot read properties of undefined (reading 'map') at DemoComponent.push../src/app/components/demo/demo.component.ts.DemoComponent.createServizioInfo (demo.component.ts:225:71) at demo.component.ts:110:20 at Array.forEach (<anonymous>) at DemoComponent.push../src/app/components/demo/demo.component.ts.DemoComponent.buildGraph (demo.component.ts:104:13) at SafeSubscriber._next (demo.component.ts:67:28) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.__tryOrUnsub (Subscriber.js:196:1) at SafeSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.SafeSubscriber.next (Subscriber.js:134:1) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77:1) at Subscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber.next (Subscriber.js:54:1) at CatchSubscriber.push../node_modules/rxjs/_esm5/internal/Subscriber.js.Subscriber._next (Subscriber.js:77:

no se que puede ocasionar si el mapa, o el doble de sucripcion

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