Configuring Tag History Data onto a Bar Chart

Intending to create a mimic like this,


wherein on basis of Date Selected, the displayed Bar Charts should automatically pick 24-hour data for assigned tags on basis of hourly interval from Tag History i.e. User will only select Date of which he wants to view the Chart and the chart should automatically populate with data of that date sliced into 24 hour bars.
The problem I am facing is while attaching Tag History binding for single Popup Calendar to act both as Start Date and End date. I know I can achieve it with 2 Popup Calendars but customer intends to use 1 Date only and he wants data to be filled for 24-hour period of that date. If no date is selected it should show previous day’s 24-hour period Data beginning from 00:00 hrs to 24:00 hrs.

How can I default the Bar Chart to show previous day’s data and with single date selection, populate the bar chart with 24-hour period of that day’s data. Also, the X-axis should only show hourly timestamp and not the entire date-time.

Regards,
Akik

This would be best done with a pair of custom properties on the popup calendar component.
Using dateArithmetic expressions and the midnight() function, you can add/subtract the necessary amount of time to get the right startDate and endDate for your tag history binding.
https://docs.inductiveautomation.com/pages/viewpage.action?pageId=6718387
https://docs.inductiveautomation.com/display/DOC79/midnight

What about setting the X-Axis to default hourly timestamp instead of the entire datetime…?
The entire datetime is eating up a lot of bar chart space.:sweat_smile: