I would start by building out one "candidate" group, including everything you were planning on displaying; name, party affiliation, vote count/percentage, photo, etc. Then, duplicate that group so you have "Candidate Group 1," "Candidate Group 2," and "Candidate Group 3."
If you're displaying and have data for vote count, that will probably be the easiest way to move forward, otherwise, you could use the vote percentage. For the sake of the example, I'll use the vote count, but just substitute it out for percentage if you go the other way.
Place your groups as placeholders where you would like them to be. You said left to right, so group 1 would be on your left, 3 on your right. Get the X Position value for each of those and write it down. You'll need it later.
Now, you can get into the scripting part of things. The script I'll help build for you is going to take the vote count from each group, then determine which is the highest, and change the groups' PosX value to match.
Here's the script:
'these first three are going to be your candidate groups
dim candidate1 as xpBaseObject
dim candidate2 as xpBaseObject
dim candidate3 as xpBaseObject
'these three are the vote count values as they come in through datalinq
dim value1 as xpTextObject
dim value2 as xpTextObject
dim value3 as xpTextObject
'these will be used within the script in order to do math
dim valint1 as Integer
dim valint2 as Integer
dim valint3 as Integer
'this group is assigning the objects into the script
Self.GetObjectByName("Candidate Group 1", candidate1)
Self.GetObjectByName("Candidate Group 2", candidate2)
Self.GetObjectByName("Candidate Group 3", candidate3)
Self.GetObjectByName("Votes 1", value1)
Self.GetObjectByName("Votes 2", value2)
Self.GetObjectByName("Votes 3", value3)
'this next block is going to convert the values into integers that the script can do math with
valint1=Cint(value1.Text)
valint2=Cint(value2.Text)
valint3=Cint(value3.Text)
'and now we plug and chug
if valint1 > valint2 and valint2 > valint3 then
candidate1.PosX= 'the value for the left group
candidate2.PosX= 'the value for the middle group
candidate3.PosX= 'the value for the right group
elseif valint1 > valint2 and valint2 < valint3 then
candidate1.PosX= 'left group
candidate2.PosX= 'right group
candidate3.PosX= 'middle group
and etc., etc., on and on to fill out all possible combinations.
This is a very messy way of doing it, and someone else can definitely do better, but this would brute force your way through.
#XPression