Skip to content

Define labels from REST API data #728

Closed Answered by JoanePouech
JoanePouech asked this question in Q&A
Discussion options

You must be logged in to vote

I found a way to obtain what I need, I share my solution here as it could be useful to other people.

I formatted my data like that:

{
  fields: [
    { name: 'timestamp', type: 'time', values: ['2023-09-22T09:30:00.000000Z', '2023-09-22T09:40:00.000000Z'] },
    {
      name: 'temperature',
      values: [15.8, 16.1],
      labels: {
        town: 'Paris',
      },
    },
    {
      name: 'temperature',
      values: [12.4, 13.4],
      labels: {
        town: 'London',
      },
    },
    {
      name: 'humidity',
      values: [45, 52],
      labels: {
        town: 'Paris',
      },
    },
    {
      name: 'humidity',
      values: [73, 70],
      labels: {
        town: 'London',
  …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@JoanePouech
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by JoanePouech
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants