I’m assuming you’re talking about the “old” dashboards and not the newer executive dashboards? The old ones are based upon c3.js and the materialized views are in the xtdash schema. The product guide for the dashboard is helpful to get started. It doesn’t go into creating a custom refresh function.
Dashboard views are refreshed using the function, xtdash.refresh_views(boolean).
This function refreshes materialized views in the xtdash schema. I have created a custom function in the past that followed the same approach, but for different schemas. I’ve also created some dashboards that use a view and didn’t require a refresh. I am actually running some of these on a raspberry pis with large TVs visible to the shop floor.