Hello,

> I want to create in a single page , 2 timebands with différents data.
> But all the data are display on the second time band.... look at this
> example :  http://www.classicalphila.com/test/timelinemultiple.htm
I don't quite understand why your data is not displayed in the first
timeline. However, you're using the same "eventSource" for both
timelines, so it seems logical to me that the second timeline contains
all events.

If you want two separate timelines, you should duplicate *all* the
timeline creation code, not just the last call to Timeline.create.

The following seems to work for me:

function createTimeline(divId, controlId, dataFilename) {

  var tl;
  var theme = Timeline.ClassicTheme.create();
  theme.timeline_start = new Date(Date.UTC(1849, 0, 1));
  theme.timeline_stop  = new Date(Date.UTC(1900, 0, 1));

  var date =  "Jun 30 1875 00:00:00 GMT";
  var eventSource = new Timeline.DefaultEventSource();
  var bandInfos = [
    Timeline.createBandInfo({
        eventSource:    eventSource,
        date:           date,
        width:          "70%",
        intervalUnit:   Timeline.DateTime.YEAR,
        intervalPixels: 20,
        theme:          theme,

    }),
    Timeline.createBandInfo({
        showEventText:  false,
        trackHeight:    0.5,
        trackGap:       0.2,
        eventSource:    eventSource,
        date:           date,
        width:          "30%",
        intervalUnit:   Timeline.DateTime.DECADE,
        overview:       true,
        intervalPixels: 100,

    })
  ];
  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;

  tl = Timeline.create(document.getElementById(divId), bandInfos,
         Timeline.HORIZONTAL);
  tl.loadXML(dataFilename, function(xml, url) { eventSource.loadXML(xml,
         url); });
  setupFilterHighlightControls(document.getElementById(controlId), tl,
         [0,1], theme);

  return tl;
}

var tl1 = createTimeline("example1", "controls1", "example1.xml");
var tl2 = createTimeline("example2", "controls2", "example2.xml");

Have a lot of fun,
Jonas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to