Shapes Conditional coloring Visio

Started by amative, April 18, 2012, 05:59:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

amative

Hello,

I have an excel file in which for each ID I have four values (V1, V2, V3, V4) I need to draw shapes for each of these IDs and that shape should have four colors based  on (V1, V2, V3, V4). Please see attachment

JohnGoldsmith

Hi,

I not clear on what your question is.  Have you tried this and it's not worked or are you after general guidance on how to tackle the problem?

Also, what Visio version are you using?

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

amative

Thanks John for the response, Sorry if i was not clear enough. Well, I am looking for general guidance on how to do this. I have both 2007 & 2010.
I was able to color shapes based on a single value (conditional formatting) but the case now is a bit complicated as i need the same shape to have 3 or more colors based on a couple of its attribute as appears in the picture above.

Let me know if you have questions


Thanks!

vojo

still confusing

Are you
A:  wanting to have a given shape have 3 regions of colors based on 3 or more variables
or
B:  want to use 3 or more variables to arrive at the color used for the entire shape

For A.....I think its going to need to be several shapes in the group where each subshape makes it own choice

For B....that is really a next if statement
    fillforegnd = if(strsame("A", mycell), <color1>, if(strsame("B", mycell), <color2>, if(strsame ("C:, mycell),<color3>, <color4>)))
    or can do some sort of lookup function.

JohnGoldsmith

Do you have an example of what your data looks like?  Are you retrieving the colour information from the data (ie does your worksheet contain rgb values) or will that just be up to the Visio shape?

In general I would try and separate the visual appearance from the data unless absolutely necessary.

Broadly though, you could create a grouped master shape that contains four child shapes (to hold the four colours).  The group shape should be where you set/link the data and where you'd have the colour information that the child shapes could just read, based on logic in the group shape. 

For example, you might have four User cells in your group shape called 'User.Colour1', 'User.Colour2' etc.  How you then set those parent level cells will depend on the format of your data and the logic that determines which colour is displayed.

Can you share some test data?

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

amative

Thank you guys for the replies, I am really new to this whole visio and trying to learn, Anyway, my data looks like:

ID        V1       V2      V3     V4
A       1         3        5       7
B       3         6        2       9
C       5         2        8       1

So, For ID A, i need a shape like the picture i posted first, that has four colors these colors need to be based on attributes of the ID A (1,3,5,7)
I need to set up a couple of coloring rules, I will use the same rules to color the four values, something like:

  • If V between [1,2] then red
  • If V between [3,4] then green
  • If V between [4,6] then blue


JohnGoldsmith

Ok, well that looks reasonable.  I might write this up in a quick blog post and I'll add the link here tomorrow if that's ok.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

amative

Well, that would be great!!

Thanks in advance

JohnGoldsmith

Hi,

Well I've just uploaded the blog post (in three parts).  If you are targeting Visio Standard edition (ie not Professional and Premium) then let me know and I'll flesh out the User Cells option for you instead.

http://visualsignals.typepad.co.uk/vislog/2012/04/multi-color-by-value-using-visio-data-graphics-1-of-3.html

Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

amative

Thank you so much John, I do appreciate your effort and time. This is just perfect. I will work on it and get back to you if I have questions!

Regards,
O.D.