Use of datasource in Apache eChart

glad to see i am not the only one that has 15 tabs open and 50+ bookmarks :laughing:

Please share some sample data coming from your data source not as an image but maybe inline csv

time,value,metric
2023-11-14 1:00:00,34.5,nuggets
1 Like

:joy: In a hurry I did not check it.

I can not attach files except pictures.

“Tipo”,“Fecha”,“Tickets”
Baja,2021,3
Retiro,2021,2
Retiro,2022,90
Baja,2022,394
Baja,2023,317
Retiro,2023,1485

In Function

let fechas = , tipos = , tickets = ;

data.series.map((s) => {
if (s.refId === “A”) {
fechas = s.fields.find((f) => f.name === “Fecha”).values;
tipos = s.fields.find((f) => f.name === “Tipo”).values;
tickets = s.fields.find((f) => f.name === “Tickets”).values;
}
});
console.log(‘Debug:’, fechas);

1 Like

before writing any code always fully vet the data
add this console.log() right below the .map as you see here

const series = data.series.map((s) => {
  console.log('Quijote', s)

look in your console of your browser and then work your way up to extract your data.

Then code review your own code to see where the bug is


Hi Yosiasz. I see s.refId is not defined.
I am using another dashboard data, is that the problem?

I will avoid using s.refId.
BR.rené

1 Like

Also s does not show transformation data names, but original names. That’s the reason.

1 Like