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.

I know this thread is already quite old, but how did you solved that problem (no stored data shown in chart after hide->show group)? I focus excatly on the same issue with the actual node red version today. When reloading Chrome all chart data are shown but not over ui_control in the flow. Thx

I ran into the same problem recently with ui control node. I use stored data in a database. The chart will not show data sometimes when I toggle groups.

Currently, I use the method that you mentioned. But the problem is that when the inquiry date is more than a week, then it takes long time to load the chart. If the inquiry is a month, then this method becomes impractical when one toggles groups.

If it takes that long you are storing too much data in the chart. There is no point saving many more data points that there are pixels across the chart. So for example if your chart is 200 pixels wide and you have a months worth of data then that means that each pixel covers about four hours worth of data, so there is no point having a sample rate more that one every two hours. If yours takes a long time to load then I suspect you have a much higher sample rate than such a calculation would give for your chart.

Yes our sampling rate is high. The default sampling rate is 50S/s. Each sample is 16bit resolution. But we have multiple sensors pumping in data in parallel. The sampling rate can go up to 25KS/s from time to time. The high sampling rate is for machine condition monitoring application.

The bottle neck is the data inquiry from the database. Once we get the data out from the database, then we analyze the data, down-sample the data and only show 3000 points data in the chart. But data analysis is still based on the original data :sweat_smile:

So are you saying that the update being slow is not due to the chart but because you have to fetch it from the database in order to redraw it? If so then you could keep a downsampled copy in node red and use that rather than going down to the db each time.

Are you drawing a chart more than 1000 pixels wide? If not then 3000 samples seems like overkill.

Yes updating from the chart is not slow due to down-sampled data. I will switch to 2000 maximum samples for faster response.

Yes I will store the inquired data locally in this case.