Multiple colors in a shape

I am trying to use multiple colors in a shape but I do not want to use the color by value property because if my shape is linked with two different rows I want to be able to use two colors for the shape and if is linked with three rows I want to use three colors for the shape, and so on. Is there a way to do this, either programming or using the UI?

Thanks

June 29th, 2015 4:04pm

Hi,

Which version of Visio do you use? In general Visio shapes have always supported a single solid colour and if you want two or more colors you need to group shapes together.  There are some tricks using shadow offsets to add another color, but by and large its one color per shape.  Visio 2013 changes that by introducing gradients and, aside from the standard use for gradients, this allows you to create regions of different colors across the shape.

For more detail information, please refer to the following link:

http://visualsignals.typepad.co.uk/vislog/2014/05/multiple-colors-in-a-single-visio-shape.html

Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Regards,

George Zhao
TechNet Community Support

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2015 1:11am

Hi JJ,

It is possible to build SmartShapes to do this, but then the intelligence would be built into your shapes, and not "fitted afterwards" by DataGraphics. So the risk of hard-coding has to be worth it.

If you are only changing text color, then you can do it within a single shape, but if you need different colored rectangles, then you need to group several rectangles together.

Here's a rough structure of your shape, inside the ShapeSheet.

The group might have some data value:

Prop.Type = "A", "B" or "C"

Then you could build several user-defined cells to analyze that value:

User.SubBoxColor_1 = IF(STRSAME(Prop.Type,"A"), RGB(255,0,0), RGB(255,255,255))  '//...red or white

User.SubBoxColor_2 = IF(STRSAME(Prop.Type,"B"), RGB(0,255,0), RGB(255,255,255))  '//...green or white

User.SubBoxColor_3 = IF(STRSAME(Prop.Type,"C"), RGB(0,0,255), RGB(255,255,255))  '//...blue or white

Now, each subshape/box inside the group needs to reference the group values. So you need to know the group's ID, which you can find using the Developer toolbar and the Shape Name dialog.

See:

http://www.visguy.com/2009/07/15/whats-my-shapes-id/

and:

http://www.visguy.com/2015/06/19/how-to-show-the-developer-ribbon-tab-and-why/

Let's say the group's id is 316 for this example. Inside the ShapeSheets for each box, you would do this:

Box A

FillForegnd = GUARD(Sheet.316!User.SubBoxColor_1)

Box B

FillForegnd = GUARD(Sheet.316!User.SubBoxColor_2)

Box C

FillForegnd = GUARD(Sheet.316!User.SubBoxColor_3)

The GUARD protects the sub-box colors from being blasted if a user applies a color to the whole group.

June 30th, 2015 8:00am

Hi,

Thanks for answering.

I am using Visio Professional 2013. I tried to use gradients but I will need more than the ten colors that gradients offers me.

Free Windows Admin Tool Kit Click here and download it now
June 30th, 2015 9:42am

You might check this out

http://visualsignals.typepad.co.uk/vislog/2014/05/multiple-colors-in-a-single-visio-shape.html

al edlund

July 1st, 2015 9:03am

You might check this out

http://visualsignals.typepad.co.uk/vislog/2014/05/multiple-colors-in-a-single-visio-shape.html

al edlund

Free Windows Admin Tool Kit Click here and download it now
July 1st, 2015 9:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics