Formatting Custom Units in Visio

A recent reader asked how can you use custom units in Visio when the only number formats available appear to be currencies, lengths and percentage. In his case he would like to display Kgs and the symbol for degrees Celsius. Well, I will explain how you can do this for Shape Data, at source, or in Data Graphics.

Displaying Custom Units in Shape Data

In the following example, I have taken a normal Server master and added four extra Shape Data rows – MaxOperatingTemp, MinOperatingTemp, Weight, and TempRange:

image

I have included TempRange to show that the other two temperature Shape Data rows are indeed numeric, even tough they display the custom unit °C in both the Shape Data window and in the Data Graphics – without needing to add any extra formatting.

In each of these four Shape Data rows I have added a custom format in the form

=”0.0 ‘text'”

The first part specifies the number format, and the second part is any text within single quotes. The whole lot is surrounded by double-quotes.

These formulae can be entered in the ShapeSheet, as above, or in the Define Shape Data dialog, without the equals sign and the double-quotes, however, the formula for the TempRange value cell had to be entered using the ShapeSheet:.

=GUARD(Prop.MaxOperatingTemp-Prop.MinOperatingTemp)

Tip : If you need to insert special symbols like °C then simply use the Insert / Symbol command on any text box, then copy and paste the characters into the formula.

Displaying Custom Units in Data Graphics

In my example, I have displayed the Memory Shape Data row in the Data Graphics with the Gb custom unit. Unlike the other Shape Data rows that I added, this one does not have a custom format defined in the Shape Data row, it is merely added to the display, and this is surprisingly easy … When you are in the Value Format row, the temptation is to open the Data Format dialog with the builder button on the right hand side.

image

However, none of the Category settings allow you specify a custom unit, except for the Date/Time … and these are not dates – but you can use the Custom Format box. So, all you need to do is enter the custom units in the same way as before.

You can apply custom units to the values in Data Bars too:

image

QED.

Posted in Visio. 2 Comments »

2 Responses to “Formatting Custom Units in Visio”

  1. Arnav Sud Says:

    Awesome! Worked like a charm!! Though it works with “Text” only I suppose? I mean I edited the data graphic to look like “Data Bars” and it did not work…!?
    But surely, that has to be a first on the internet! Well done!!!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Chris Webb's BI Blog

Microsoft Analysis Services, MDX, DAX, Power Pivot, Power Query and Power BI

davecra.wordpress.com/

Microsoft Office 365 Development, and more...

PowerShell.Amsterdam

Automate, Accelerate, Accurate

johnvisiomvp

Life with Visio and other Microsoft Toys!

Title (Required)

Windows Server Essentials Tips & Tricks

Nilsandrey's Weblog

Just another WordPress.com weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Shapes, Stencils, Drawings Templates, Tutorials, Tips & Developer Info for Microsoft Visio

Hannes's Virtual Earth

Tips & Tricks around Mapping and Cloud Computing

Pluralsight blog

be smart, be clear, be visual ...

%d bloggers like this: