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

164
Views
¿Cómo manipular y acceder al archivo de datos json anidado con la opción "beforedatavalidated" en amCharts?

Intenté manipular con la opción "beforedatavalidated" estos datos json:

 [("air":{ "indicateur": 4 }, "date": "2021-09-10" },{ "air":{ "indicateur": 3 }, "date": "2021-09-11" },{ "air":{ "indicateur": 1 }, "date": "2021-09-12" },{ "air":{ "indicateur": 1 }, "date": "2021-09-08" }]

Aquí hay una parte de la configuración de los gráficos:

 // Create axes var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis()); categoryAxis.dataFields.category = "date"; categoryAxis.renderer.grid.template.location = 0; categoryAxis.renderer.minGridDistance = 150; categoryAxis.tooltip.disabled = "visible"; categoryAxis.renderer.labels.template.adapter.add("dy", function(dy, target) { if (target.dataItem && target.dataItem.index & 2 == 2) { return dy + 0; } return dy; }) var valueAxis = chart.yAxes.push(new am4charts.ValueAxis()); valueAxis.renderer.minWidth = 50; valueAxis.min = 0; valueAxis.cursorTooltipEnabled = false; // Create series var series = chart.series.push(new am4charts.ColumnSeries()); series.sequencedInterpolation = "visible"; //series.data.value = air; series.dataFields.valueY = "air"; series.dataFields.categoryX = "date"; series.tooltipText = "[{categoryX}: bold]{valueY}[/]"; series.columns.template.strokeWidth = 0; series.columns.template.column.cornerRadiusTopLeft = 10; series.columns.template.column.cornerRadiusTopRight = 10; //series.fill = am4core.color("#50f0e6"); series.data.events.on("beforedatavalidated", function(ev){ var source = ev.target.chart.data; if (source.air) { ev.target.chart.data = source.air.indicateur; } });

Intenté acceder al valor "indicateur" pero fallé en absoluto. Traté de mirar toda la documentación de amcharts y aún no podía entender cómo hacerlo en esta situación.

Muchas gracias de antemano

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!