Dashboard ui control & charts refresh problem

Hello guys,
I had a problem with dashboards charts that doesn't refresh properly when using the ui control to hide / show dashboard elements.
the below is an example of the problem.
1- Section of the dashboard were when the "energy section" button is pressed it hides the current dashboard groups and show up the group with the energy chart.
image
2-this is the energy group that show up properly, the go back button simply hide energy group (charts) and show all the previous groups.
image
3-This is What I got very often when hiding the energy group and showing up all the groups when going back sometimes the charts don not refresh properly, I have to refresh web browser or simply go to main menu and then come back.
image
this is occurring since several months ago node-red versions 0.19.x to current version 0.20.5.
This is just section of my tabs/groups show/hide functions:

var tab = flow.get('button') ||0;
if (msg.tab==4) {
  msg.payload={ "group": {
        "hide": [
            
			"BOMBA4_B4-HIST-ENERGIA",    //HIDE BOMBA RECIRC 1
			"BOMBA4_B4-GRAFICAS-AVANZADAS",    //HIDE BOMBA RECIRC 2
			"BOMBA4_B4-ALARMS",            //HIDE BOMBAS B1-B2 ALARMS
            "BOMBA4_B4-TELEGRAM-CFG"
        ],
        "show": [
            "BOMBA4_B4-STATUS/CONTROL/LINKS",
            "BOMBA4_B4-MOTOR-OP-PAR1",
            "BOMBA4_B4-MOTOR-OP-PAR2"
        ]
    }
  } ;
  
}  else {
   // msg.payload= null;
    delete msg.payload;
}
return msg;

This is the button " Go BACK" on energy chart group .


Any hint would be appreciated.

Do you present live data or stored data in your charts?

@hotNipi is the stored data about 8 hours ..

Then to this flow where group activation goes, connect chart data feeding branch of flow also (ask from database -> modify for chart ->send to chart). Every time the charts activates, refeed them with data.

first of all thanks so much @hotNipi for your time trying to help, but I think I misunderstood your previous question , I am not using any external database to feed the charts, charts are live chars with a time range of 8 hours.