Is anyone able to provide an update on the options available for providing values in the custom data tip based on values from other lines on the plot that can be updated in real time? I have been working on this and still I am unable to find a solution
Adding Custom Data Tips to Plot Running in Real-Time
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nick Nauman
le 14 Juil 2021
Réponse apportée : Nick Nauman
le 26 Juil 2021
I am working on designing an app that plots seven different lines in real time to indicate how certain values are trending over time. I am trying to create custom data tips for each line that is plotted to display the values of all the other lines at that time as well as a few extra values. When I create the custom data tips when the plot is originally created all the custom data tip rows don't show any values, just labels. I tried creating a function to call the custom data tip functions again, so as to update with the latest values of the variables I am trying to include in the data tips. When I do this, I get an error saying "Value must be compatible with the data source". Is there any way to update the custom data tips while plotting in real time? The functions I am using are shown below.
function CreateDataTips(app)
%Discards Line Data Tips
app.discardsplot.DataTipTemplate.DataTipRows(1).Label = 'Date-Time';
app.discardsplot.DataTipTemplate.DataTipRows(2).Label = 'Packet Discards';
app.discardsplot.DataTipTemplate.DataTipRows(3) = dataTipTextRow('Packet Retries',app.Retries_all);
app.discardsplot.DataTipTemplate.DataTipRows(4) = dataTipTextRow('Packet Fails',app.Fails_all);
app.discardsplot.DataTipTemplate.DataTipRows(5) = dataTipTextRow('Bits Recieved',app.Recieved_all);
app.discardsplot.DataTipTemplate.DataTipRows(6) = dataTipTextRow('Bits Sent',app.Sent_all);
app.discardsplot.DataTipTemplate.DataTipRows(7) = dataTipTextRow('RSSI',app.RSSI_all);
app.discardsplot.DataTipTemplate.DataTipRows(8) = dataTipTextRow('SNR',app.SNR_all);
app.discardsplot.DataTipTemplate.DataTipRows(9) = dataTipTextRow('TX Rate',app.Rate_all);
%Retries Line Data Tips
%.... Same for other 6 lines
end
function UpdateDataTips(app)
%Discards Line Data Tips
app.discardsplot.DataTipTemplate.DataTipRows(3).Value = app.Retries_all;
app.discardsplot.DataTipTemplate.DataTipRows(4).Value = app.Fails_all;
app.discardsplot.DataTipTemplate.DataTipRows(5).Value = app.Recieved_all;
app.discardsplot.DataTipTemplate.DataTipRows(6).Value = app.Sent_all;
app.discardsplot.DataTipTemplate.DataTipRows(7).Value = app.RSSI_all;
app.discardsplot.DataTipTemplate.DataTipRows(8).Value = app.SNR_all;
app.discardsplot.DataTipTemplate.DataTipRows(9).Value = app.Rate_all;
%Retries Line Data Tips
%.... Same for other 6 lines
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!