* Colour coding parts of a diagram?

Older V4 Queries please post for any version in the General Forum
Locked
User avatar
Merenwen
Diamond
Posts: 76
Joined: 30 May 2007 22:03
Family Historian: None

Colour coding parts of a diagram?

Post by Merenwen » 06 Mar 2012 14:21

As I sat colouring in my husbands family tree over the weekend,I was wondering if there is an easy way you can have FH colour code branches of an ancestor diagram.

For those that don't want to read the whole story ( Paper Filing Systems (9789) ) here's the short version; I'm looking to colour the diagram boxes of all ancestors of the paternal grandfather blue, paternal grandmother green,  maternal grandfather red and maternal grandmother yellow.

I've not used FH for a while and I'm a bit rusty on the diagram options. Is there an easier (and more automatic) way than creating a flag for each colour, using a query to assign said flag and then using the box condition to colour the box based on the flag?

ID:5988

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Colour coding parts of a diagram?

Post by johnmorrisoniom » 06 Mar 2012 15:33

You should be able to use a variation of the expression


=IsAncestorOf(FileRoot(), %INDI%)

But I don't know how to specify someone other than the file root

User avatar
Merenwen
Diamond
Posts: 76
Joined: 30 May 2007 22:03
Family Historian: None

Colour coding parts of a diagram?

Post by Merenwen » 06 Mar 2012 15:39

That's the trouble, I'm looking at colouring different branches of the root persons ancestry different colours.

I wonder if you can replace 'File Root (), Ind%' with a set ID number? ie make the expression =IsAncestorOf ID8. I'll give it a try and let you know.

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Colour coding parts of a diagram?

Post by Jane » 06 Mar 2012 15:48

I have a V5 script to see the colour flags, so once V5 is out if you are upgrading you can have it.

Alternately you could add 4 expressions one for each colour, but I suspect they would be pretty complex.

In the mean time. I'll see if I can work out the expression.

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Colour coding parts of a diagram?

Post by Jane » 06 Mar 2012 16:24

Ok I have done it (I can't get it to work with the diagram root, but it's fine with the fileroot)

You need to add 4 expressions and they need to be in this order highest at the top

Code: Select all

Yellow
=IsAncestorOf(%INDI%,Field(FileRoot(),'INDI.FAMC>WIFE>FAMC>WIFE>')) 

Green
=IsAncestorOf(%INDI%,Field(FileRoot(),'INDI.FAMC>HUSB>FAMC>WIFE>')) 

Red
=IsAncestorOf(%INDI%,Field(FileRoot(),'INDI.FAMC>WIFE>'))

Blue
=IsAncestorOf(%INDI%,FileRoot())


User avatar
Merenwen
Diamond
Posts: 76
Joined: 30 May 2007 22:03
Family Historian: None

Colour coding parts of a diagram?

Post by Merenwen » 06 Mar 2012 16:51

Thanks Jane, you're a star! I'd never worked that out myself. I can do basic queries, but that's about it.

And yes, I will be going to v5 when it comes out, so I would be very interested in that script.

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Colour coding parts of a diagram?

Post by tatewise » 06 Mar 2012 21:49

The beauty of using Expressions rather than Flags is that they are always correct, whereas Flags have to keep on being added as you find ancestors.

Returning to your idea of using Record Id then Jane's Expressions would become:

=IsAncestorOf(%INDI%,Record(11,'I'))  Yellow
=IsAncestorOf(%INDI%,Record(22,'I'))  Green
=IsAncestorOf(%INDI%,Record(33,'I'))  Red
=IsAncestorOf(%INDI%,Record(44,'I'))  Blue

where Record Id 11, 22, 33, 44 are the ID for each appropriate grandparent.
The order of the Expressions is not important.

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Colour coding parts of a diagram?

Post by johnmorrisoniom » 06 Mar 2012 23:14

I wish these examples were in the help file, instead of just the fileroot() examples.

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Colour coding parts of a diagram?

Post by johnmorrisoniom » 07 Mar 2012 09:51

Thanks Mike
That works well, however these conditions 'Must' be placed higher than the 'Sex' option to work

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Colour coding parts of a diagram?

Post by tatewise » 07 Mar 2012 11:07

The order of the Conditions is not important if they govern a different Box Feature.
I would not expect the Sex Condition to govern the same Box Feature as these Expression Conditions.
e.g.
I have Sex Highest in my list and governing Text Colour.
The Expressions for =IsAncestorOf(...) are lower Priority and govern Box Line colour & style.
Their order is not important.
I wish these examples were in the help file, instead of just the fileroot() examples.
Yes, more Examples would always be helpful, but even the MS Excel Help for Functions only gives one basic Example.
Chances are the extra Examples would rarely be the ones you want.

The Examples of FH Functions are probably meant to illustrate their syntax rather than usage.
Remember that every Function Parameter can generally be an Expression which might be:
1) a Number               e.g. 123
2) a Text String            e.g. 'Alphabet'
3) a Data Reference   e.g. %INDI.BIRT%
4) a Function               e.g. =RecordId()
5) any combination of the above
The Parameter description says what is allowed.
e.g.
The =IsAncestorOf(P1,P2) Function says both must be a Data Reference to an Individual record.
So Record(123,'I') refers to an Individual record and is allowed.
But Record(123,'S') refers to an Source record and is NOT allowed.
Note the two Parameters for =Record() are a Record Id Number and a single character Text String.

Look in the FH Help and Search for Expression for many associated topics.
Also Understanding Data References and Understanding Functions may help.

Locked