Dashboard Time Based Chart Group By Is Empty

Feature(s) impacted

Dashboard

Observed behavior

I’m trying to create a time based chart, but the ‘group by’ field is empty and there is nothing to select from. I would expect to see the date over there. We do have a date field in the this table available. Any idea what I am doing wrong?

1 Like

Hello @nielswhydonate,

I am sad to hear that you have issues creating a chart, I have tried to reproduce the issue but couldn’t. Can you share with me the environment you are working on and the model of your table ?

Best regards,

Dogan

Thanks for your response @dogan.ay ! This is the model of our table:

  • Project name: WhyDonate
  • Team name: WhyDonate
  • Environment name: Production
  • Agent type & version: NodeJS

Any idea what the issue could be?

Hi @dogan.ay, sorry for bothering you again. Any idea what can be wrong here?

Hello @nielswhydonate, no need to worry, I am here for that.

I have been looking into the issue, thanks for sharing the info it helped.
I found 2 causes:

  • As of now the only field allowed to be used for a groupby on time based charts is a “Date” field. We have already created a ticket to allow “Dateonly” defined fields to be used. This leads to the second cause.
  • For some reason, your ‘datetime(6)’ fields are defined as “Dateonly” fields in your .forestadmin-schema.json which shouldn’t be the case. I am setting up a mysql database to recreate the behaviour and will come back to you.

Sorry for the inconvenience.

Best regards,

Dogan

I have recreated the use case. On a mysql database, I defined datetime fields with varying precision, when update your schema via forest schema:update, you should have seen logs as following.

Basic datetime, with precision 0 as default, are handled properly and will be added to your model, however that is not the case for higher precision datetime fields. You will have to add them manually in your models. As shown here.

Since your fields are present in the schema, I think you just need to update the definition from DataTypes.DATEONLY to DataTypes.DATE, after which you simply have to update your schema then refresh your browser.

I hope this helps.

Thanks for your reply. Changing it to DataTypes.DATE resolved our issue! Thanks again for the great support.

1 Like

Hi there,

For information, now it is possible to create a time-based chart grouping by a DATEONLY field.

Cheers!