How to create custom text callouts for data graphics?

J

joel simpson

I have been trying to create a custom text callout that i can use in Data
Graphics. I've been trying to follow the tech article "Building Custom Data
Graphics for Visio 2007" in the Visio SDK documentation.

I have duplicated a text callout shape in the drawing explorer window,
renamed it and changed some properties of the shape (just the colour).

But when I go to use that text callout by creating a new data graphic, it
doesn't appear in the dropdown list of available text callouts. It has all
the same properties as the other text callouts, so I don't see why it doesn't
appear.

many thanks in advance...
 
D

David Parker

The MS callouts are on a special stencil, which you are not allowed to edit.
To get your custom callouts to appear in the drop down, the Master must be
in the document stencil, it is not sufficient to have them in a docked
stencil.
 
J

joel simpson

Thanks David

unfortunately I'm still stuck. I have
- opened the document stencil
- created a new Master on that
- in the masters shapesheet, created a user-defined field
User.msvCalloutFieldType of "Text Callout"
- added another field for User.TextSample to provide a default value
- added a row to the Shape Data section of the shapesheet to create
Prop.msvCalloutField (with a value of User.TextSample)

I have looked at the shape master for existing callouts, and tried to follow
that (without copying every single user defined field in them -- there
doesn't seem to be an easy way to do this, and there are loads of them, so
that woul be lots of work).

Based on the article I mentioned earlier, it doesn't look like i need to do
anything else. However, my callout shape isn't available when I try to
define a data graphic.

Any ideas why?

Is there an easier way to copy the callout shapes provided so that I can
just tweak those as necessary? (ultimately, I just want to have a bit more
control over them, for instance to change their colour)
 
D

David Parker

Joel,

The built-in Graphic Item Masters are added to a document when you slect
them in a Data Graphic Master.
You can simply copy and paste an existing Graphic Item Master in the Drawing
Explorer window, rename it, and edit it - this usually means opening up the
group shape, and replacing the sub-shapes with your own.

I describe such a technique in my book, Visualizing Information with
Microsoft Office Visio 2007, and there are some custom Graphic Items
(including some with the ability to change the colour of Headers and Data
Bars, in my new DataLegends product avaulable from www.visiotoolbox.com
 
M

Mark Nelson [MS]

Hi Joel,

You've got the wrong User row name based on your message below. You need a
cell called User.msvCalloutType, which has "Text Callout" in it. Then you
need a cell called Prop.msvCalloutField (Shape Data section) for the value
Visio will shove in the callout. Anything else is at your discretion.

One more gotcha to beware of. You should either start from scratch or
programmatically reset all your User-defined and Shape Data row names to
their universal values. The first time you name a row, Visio sets the Name
(local) and NameU (universal) strings. Subsequent changes through the
Shapesheet window will only update the local name. Visio generally works
with universal, so your cell may appear to be correct but still not work.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top