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.
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!!!
davidjpp says
Wow! That was quick response … I’ve added a Data Bar graphic example at the end of the blog.
Sean says
David,
I am trying to format the input on a shape data set. I want the format to be a telephone number. For example (123) 111-2222
David Parker says
Hmmm … not so easy … I had a go, but it really requires some code, not just ShapeSheet formulas