I've been able to do it by recreating the timeline object. The new interval
data is included in the JSON array. The timeline is set to null then
recreated with the new unit and pixel interval. It's not at all pretty but
it works. I've pasted an abbreviated excerpt of my code below.
Thanks to David and everyone else who's worked on this for a great tool. I
discovered it about a month ago.
Art Hanson
www.watchjeffersoncounty.net
try {
t1 = null;
eventSource = new Timeline.DefaultEventSource(0);
// Create new range
var I1= Timeline.DateTime.WEEK;
if (data[5]=='DAY') {I1= Timeline.DateTime.DAY;}
if (data[5]=='WEEK') {I1= Timeline.DateTime.WEEK;}
if (data[5]=='MONTH') {I1= Timeline.DateTime.MONTH
;}
var I2 = Timeline.DateTime.YEAR;
if (data[6]=='WEEK') {I2= Timeline.DateTime.WEEK;}
if (data[6]=='MONTH') {I2= Timeline.DateTime.MONTH
;}
if (data[6]=='YEAR') {I2= Timeline.DateTime.YEAR;}
var bandInfos = [
Timeline.createBandInfo({
intervalUnit: I1,
intervalPixels: data[7],
}),
Timeline.createBandInfo({
intervalUnit: I2,
intervalPixels: data[8]
})
];
bandInfos[1].syncWith = 0;
bandInfos[1].highlight = true;
tl =
Timeline.create(document.getElementById("g_timeline"),
bandInfos);
}catch(err){
alert('Timeline Error: '+err);
}
On 6/5/07, Bennett, Scott R. <[EMAIL PROTECTED]> wrote:
Hi,
I was reading in the general mailing list archives a post a year ago from
Adam Fields about changing the interval unit for a timeline band
on-the-fly. And David Huynh had responded that at that time the Timeline
API did not support changing the timeline's properties on the fly but he was
considering implementing in the future the functionality to allow changes to
the ethers and then calling the layout function.
I need to implement this capability for my project and I was wondering if
any work has been done to include this functionality or if anyone has any
thoughts on how this can be done. Specifically I need to modify the ether
for a timeline band so I can dynamically change the interval unit for a band
from day to week or month. Any insight on how to accomplish this would be
greatly appreciated.
Thanks,
Scott R. Bennett
Sr. Software Systems Engineer
The MITRE Corporation
[EMAIL PROTECTED]
781-271-4533
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general