Setting Datatips in Standalone MATLAB-App

Hi there,
in my Standalone-MATLAB App I plot Data in a figure. In the App-Designer I can set datatips by clicking the Datatip-Button in the top-right corner of the figure. But when I use the compiled Standalone-App the Datatip Symbol is not present anymore. Are there any settings I need to make before compiling my app to get a usable Datatip-Button?
Edit:
With the following function I am able to enable the Datacursormode and the Datatip Symbol is enabled:
datacursormode(app.axes, 'on')
But when I click on another Symbol like the magnifying glas, the datatip symbol disapears.
Thanks
Nico

回答 (1 件)

Saurabh
Saurabh 2024 年 5 月 23 日
編集済み: Saurabh 2024 年 5 月 23 日

0 投票

Hi Nico,
I understand that you want to have DataTip button available for your standalone application as well.
To manage the availability of built-in interactions in a chart, utilize the `disableDefaultInteractivity` and `enableDefaultInteractivity` functions. MATLAB may automatically deactivate these interactions in specific scenarios. After plotting on `UIAxes`, consider invoking `enableDefaultInteractivity` to re-enable these interactions.
You can try calling enableDefaultInteractivity after you plot something on the UIAxes.
function plotfunction(app,....)
% ... code to plot ....%
enableDefaultInteractivity(app.X); % app.X where X is the name of your UIAxes object
% alternative method to only enable dataTipInteractions.
app.X.Interactions = [dataTipInteraction]; % app.X where X is the name of your UIAxes object
end
For more information, you can visit this link:
I hope this was helpful.

3 件のコメント

Nico
Nico 2024 年 5 月 24 日
Thanks for your effort, but sadly this does not help. The datatip-button is still not visible in my standalone-app
Saurabh
Saurabh 2024 年 5 月 24 日
If possible can you the file you are working on?
Nico
Nico 2024 年 5 月 24 日
No thats not possible

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2023a

質問済み:

2024 年 5 月 23 日

編集済み:

2024 年 7 月 3 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by