Use of datasource in Apache eChart

@Seji, It’s an error for the wind array, which has an undefined element. You should push elements to the wind array or define it with three elements from the start like

const wind = [[], [], []]

It’s not clear which visualization you are using. To have an array with three nested arrays following your logic, I would suggest:

const wind = data.series.map((s) => {
  const tws = s.fields.find((f) => f.name === 'tws').values.buffer;
  const twd = s.fields.find((f) => f.name === 'twd').values.buffer;
  const time = s.fields.find((f) => f.type === 'time').values.buffer;

  return [tws, twd, time];
});
2 Likes