Xcelsius Dynamic Color Binding
April 6, 2010 by: David LaiDynamic Color Binding is a great new feature in Xcelsius SP3 that allows developers to dynamically bind colors. This gives developers total flexibility on dynamically customizing their coloring schema during run time.
I’ve attached a video which shows a couple examples on using dynamic color binding.
If you have any additional examples that you would like to share, please post them on the comments section.
David
I saw what you did but I guess what I am trying to do was not covered. I want to be able to show in a calendar alets for a specific day if there are ticket activity. Am I to follow the same procedures are demostrated in your presentation.
Yes,
Watch the video and it will tell you how to bind cell colors to a certain property.
In your calendar object you would go to appearance, then choose the appropriate color section (ie: the month background), then click the binding button and select the appropriate cell (ie: E2 which can have a formula like “IF(A1=5,”red”,”black”)”)
Let me know if that helps!
How about binding colors to a specific column in a chart ?
Hi Fred,
Yes you can. You will need to go to the alerts tab on the chart properties to do this. You will notice that you have full control of the coloring there if you uncheck “enable auto colors”.
Another note is that you cannot control individual column colors if you are using a stacked bar chart.
Hi-
I want to color individual dates on the calendar component to indicate types of activities on the particular date. Is this possible?
Hi!
Unfortunately for any component (whether it be calendar, chart, selector, etc), you can only control the colors for any color fields on the “Appearance” icon. If you look at the calendar component, you will see that you cannot control the color of cells for multiple dates.
You could however somewhat emulate how a calendar looks using the grid component. However you wont be able to perform the same click interactions. Basically it would be a read only calendar that doesn’t allow you to click on a date cell.
Hi, I’m I saw your video and some of the blogs which are great…I’m trying to find out if the following is possible with Excelsius.
I need to have two 2-dimensional graphs.
Graph 1- Plots Region/Client(X-axis) against no. of Projects (Y-axis). The client names can be say – A, B, C, D, & E.
Graph 2 – Plots Region/Client(X-axis) against no. of Late Projects (Y-axis). The client names can be say – A, B, C, D, & E.
Question – Can I always bind client A to say green, client B to say blue and so on..on both graphs..Basically I want the same colour for the same client on both graphs…Can this be achieved? If so how?
I would greatly appreciate your kind advice.
Tks
Hi Shamith,
Yes you can emulate that.
You can dynamically bind your series colors. If you go to the series tab on the appearance section, you can set the colors appropriately. Each client will have to be it’s own series.
For example you will have 5 series in your case (A, B, C, D, & E)
Is this what you are trying to achieve?
Thanks
David
Hi Folks,
I am having a problem with the Dynamic Binding. I am getting data dynamically,used vlookup condition to look for a particular name and displays a color based on the name on a graph.it is working fine with the static data. But whenever i am getting data from the database that colors are not showing and showing the graph with Black Colors. Could You please help on this?
Regards,
Sagar Reddy
Hi Sagar,
Try to use a spreadsheet table component to check that the color selected is correct. If not, the graph will show black.
Spreadsheet table is a great way to debug if you are having these color issues because most likely the cell that you are binding to is not correct.
Hope that helps
David
Hi! Excelent Post!
I’m having a problem with something like this that seems to me that is a xcelsius bug.
I have combination chart where I have three column series that change the metric through clicking a button, and I want them to change color too. I’ve done this binding the colors to conditioned cells. But the truth is that the colors on the series stay the way they are by default, it never changes with the click of the button. What can I be doing wrong?
Thanks in advance!
Pt_Curious
Hi,
The best strategy to use here to make sure that the dynamic color cell that you are binding the series color to is working. To do this, create a spreadsheet component and then watch it during runtime to see if the cell is working as expected. For example it should say “Green” when you want green and “Red” when you want red.
Hope that helps!
David
Hello,
I tried to bind the three same cells to three distinct background objects, and there the colors work well.
But I talked with a colleague who already used this en the past, and it worked well just the way I did, but today when he created nem charts with this, it doesn’t work. The old ones work, but the news don’t. The only explanation we found, is that it may be becausa of the Xcelsius version now installed. We already have SP4, but when it worked for him, he had an older version.
Can you confirm if it works for you in SP4?
Thank you very much,
PT_Curious
@PT_Curious:
Hi,
You are right. There’s a bug on SP4 causing this issue.
Here’s the error message that my debugger gives me when you try to bind the chart object to a cell
Error: Invalid chain (expecting ArrayChainAccessor) or Invalid styleName (expecting styleName for Array)!
at xcelsius.binding.chain::ChainWalker$/styleWalkAndSet()
…
I’ll write a post to make sure SAP sees this and gets it fixed.
Thanks for your find!
Thank you David!
I hope SAP corrects it soon.
PT_Curious.
Hi Folks,
Dynamic color binding is working perfectly in SP3 version,but not in SP4. Thanks for all who helped me in this issue.
Regards,
Sagar Reddy
Not working in 2008 SP4
Just an FYI for everyone. The color binding bug has been fixed in Xcelsius 2008 SP5!
Hi,
pie chart have 4 part, onc I click a part of the pie, i am getting a drill coloum graph, Now I need the coloum graph to be 4 different colour, the 4 colour has to be constant for each part of the pie.
Help me.
have a drill down pie chart, once i click i am gettign the data change in coloum chart, now i need different colour for the colum chart, it has to be consistenty . Help me
Hi Gopi,
You’ll need to do some dynamic logic in your excel that is dependant on your pie selection to accomplish this.
Hi!
I am also working with a pie chart with 4 parts and using a bar chart to display what is on the pie chart. How can I get the bars on the bar chart to match the colors on the pie chart?
Thanks!
Lisa
Hi Lisa,
You can use a cell to control the color on the bar chart.
That cell will take whatever color is coming from the pie chart.
Hope that helps!
David