Interactive charts

Hi, I am hoping to create a daily chart and hourly chart of progress of installation with MongoDB Charts. Below is a sample object copied from MongoDB:

{"_id":{"$oid":“620496fdc0f56c21a0c0f5b5”},
“weight”:{"$numberInt":“100”},
“barcodeID”:“987654321”,
“registeredOn”:{"$date":{"$numberLong":“1644467965016”}},
“installedOn”:{"$date":{"$numberLong":“1644468159022”}},
“__v”:{"$numberInt":“0”}}

My problem:

  1. Daily chart and hourly chart that shows empty (no installation) days or hour.
  2. Hourly chart that only shows the 24 hours within a single day.
  3. Hourly chart automatically update for a new day. (i.e when its a new day, the chart will reset to an empty one with a new title of the new date).

Kindly assist,
Kwan

Hi Kwan -

There are two main features you need to use to do what you want: date binning and period filters.

For both your daily and hourly charts, you should encode the date field you want (probably installedOn) on your category axis, and choose the appropriate binning period, e.g;

On the Filters tab, you can create a filter from the same date field. The “Period” filter type automatically selects the start of the period (e.g. each day or each month). This is in contrast to the “sliding window” behaviour you get if you use the “Relative” filter type.

image

Unfortunately there is not currently a way of automatically inserting the current date into the chart title.

Tom

2 Likes

Thank you for your prompt reply.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.