How to disable interactions with DonutChart objects?

Hi everyone,
I’m using the donutchart function (which returns a DonutChart object) and I’m looking for a supported way to disable chart interactions—specifically:
  • Data tips
  • The export interaction
For conventional plots (for example, line plots, scatter plots), I can usually disable interactions at the axes level. However, for donut charts I haven’t found an approach that reliably disables these interactions on the DonutChart object itself.
If anyone has a method (or knows whether this is currently not configurable for DonutChart), I’d really appreciate guidance.
Thanks a lot!

 Accepted Answer

Quick update on this topic: after submitting an enhancement suggestion, I received feedback quite quickly from a helpful MathWorks engineer.
Starting with Release R2026a, there will be a new property that allows controlling the toolbar visibility for donutchart / DonutChart:
dH = donutchart([1 2 3 4]);
dH.ToolbarVisible = "off";
I was able to verify this successfully in Prerelease R2026a Update 3.
For disabling datatips, there is no supported feature available yet. However, the MathWorks engineer told me he will create a separate enhancement request for that functionality.
In the meantime, he suggested an interesting workaround which also works in earlier releases: overlay an invisible axes on top of the DonutChart to capture all mouse interactions. This prevents the donut chart underneath from receiving mouse events (and therefore prevents interactions such as datatips and toolbar appearance).
donutchart([1 2 3 4])
ax = axes(gcf, Units="Normalized", Position=[0 0 1 1],...
Visible="off", PickableParts="all"); % PickeableParts=all diverts mouse clicks to the invisible axes
disableDefaultInteractivity(ax)
ax.Toolbar = [];
It’s a bit cumbersome, but it achieves the behavior I need. I tested the workaround with both figure/axes and uifigure/uiaxes. In both cases, it works.
Hope this helps anyone running into the same issue!

More Answers (1)

dpb
dpb on 8 Apr 2026 at 14:59
Edited: dpb on 8 Apr 2026 at 15:55
The penchant for creating all these specialty objects that are opaque so can't get to underlying axes for customizations that Mathworks' developers didn't think about is infuriating...
Rant aside, it turns out the underlying objects are in a tiled layout and one may be able to go handle-diving therein and figure out something.
data = [1 2 3 4];
hD=donutchart(data); % return handle to the chart object
hTL=hD.NodeChildren; % hidden property returns a tiled layout
hPAx=hTL.Children; % and its progeny -- a polar axes object
hPAx.Type % see who/what we gots
ans = 'polaraxes'
hPAx.Tag % doesn't have an identifier...
ans = 0×0 empty char array
hPAx is the handle to a polar axis object; you can see if you can figure out how to make it behave as wish. One can easily go down the rabbit hole with Alice, however...
Such is reliant upon <Yair Altman's getundoc FEX submission> to find the hidden properties' names...
Of course, such is always undocumented and can change at a moment's whim...
ADDENDUM
I don't think it would be out of line to submit this to Mathworks as an enhancement request at <Product Support Page> describing needs and use throughly for the desired functionality. Might just get a workaround that inside knowledge provides.

4 Comments

Thank you very much for your reply.
I went through the hidden properties of the donut chart handle. There are some promising ones, such as Datatip. I tried for example the following:
data = [1 2 3 4];
hD=donutchart(data);
hDStruct = struct(hD); % Reveal hidden properties
hDStruct.Datatip.Visible = "off";
Unfortunately this did not produce the desired result. The datatips are still visible.
I also checked other related properties of the parents and children of the donut chart handle but didn’t get any further. As you say, it’s easy to get lost in all of this.
I have now submitted a corresponding enhancement suggestion to MathWorks. Let’s see if we get a little more control in future releases.
data = [1 2 3 4];
hD=donutchart(data);
hDStruct = struct(hD); % Reveal hidden properties
hDStruct.Datatip.Visible = "off";
But the above just sets the value in the local struct, not in the object...
Try
hD.Datatip.Visible = "off";
You're right that I only set the struct field and not the property of the DonutChart object, which is why I can't expect any change in behavior.
However, I'm not able to set Datatip visibility on the DonutChart handle directly:
data = [1 2 3 4];
hD=donutchart(data);
hD.Datatip.Visible = "off";
No public property 'Datatip' for class ''DonutChart''.
Not sure what is up with that, but looks as though are hosed.
getendoc(hD)
returns the p;roperty name but returns "???" rather than a value which I've learned with time is a bad sign that things are going south...

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products

Release

R2025b

Asked:

on 8 Apr 2026 at 14:09

Edited:

on 10 Apr 2026 at 8:06

Community Treasure Hunt

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

Start Hunting!