Jeremy Conn wrote:
>
> Does anyone know if it is possible to change the event text color in a 
> Timeline if a particular condition of that item is true?
>
> Example: I have all the items in my timeline show up orange that are 
> listed as “In Progress”, but I want items listed as “Shipped” to have 
> blue text.
>
> I am using Exhibit with the Timeline, and my data format is JSON… 
> thanks for any direction people could give.
>
I presume you are generating the JSON on the fly? In that case you can 
add a color property to selective events.

{ 'start' : ...,
'title' : ...,
'description' : ...,
'color' : 'red'
}

You can also use a hex color code like #ffffff.

If you have a static JSON file, then you can do a little processing 
before loading it into timeline, e.g.

            tl.loadJSON("cubism.js", function(json, url) {
                var events = json.events;
                for (var i = 0; i < events.length; i++) {
                        var evt = events[i];
                        if (evt.status == "In Progress") {
                                evt.color = "orange";
                        } else {
                                evt.color = "Shipped";
                        }
                }
                eventSource.loadJSON(json, url);
            });


Hope that helps,

David

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to