Site icon bVisual

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:

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.

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:

QED.

Exit mobile version