Hi everyone,

I'm trying to increase the width of labels in my timeline. I tried adding
the following lines to my code block on the page that contains the timeline
:


var theme = Timeline.ClassicTheme.create();
theme.event.label.width = 250; // px



So, my script now looks like :



<script language="JavaScript" type="text/javascript">
var tl;
function onLoad() {
var eventSource = new Timeline.DefaultEventSource();

var theme = Timeline.ClassicTheme.create();
theme.event.label.width = 250; // px

                        
  var bandInfos = [
    Timeline.createBandInfo({

                eventSource:    eventSource,
        date:           Date(),
        width:          "75%", 
        intervalUnit:   Timeline.DateTime.MONTH, 
        intervalPixels: 200
    }),
    Timeline.createBandInfo({
            showEventText:  false,
        trackHeight:    0.7,
        trackGap:       0.2,
                eventSource:    eventSource,
        date:           Date(),
        width:          "25%", 
        intervalUnit:   Timeline.DateTime.YEAR, 
        intervalPixels: 275
    })
  ];
  

  
  bandInfos[1].syncWith = 0;
  bandInfos[1].highlight = true;
 
bandInfos[1].eventPainter.setLayout(bandInfos[0].eventPainter.getLayout());
  
  tl = Timeline.create(document.getElementById("my-timeline"), bandInfos);
  Timeline.loadXML("events/event_timeline.xml", function(xml, url) {
eventSource.loadXML(xml, url); });
}

var resizeTimerID = null;
function onResize() {
    if (resizeTimerID == null) {
        resizeTimerID = window.setTimeout(function() {
            resizeTimerID = null;
            tl.layout();
        }, 500);
    }
}


/* Comment this out to disable bubbles and load a page instead
Timeline.DurationEventPainter.prototype._showBubble = function(x, y, evt) {
  document.location.href=evt.getLink();
 }*/
 
</script>




However, when I refresh my page (including deleting my cached files) nothing
changes and some of my event titles are being truncated. What am I doing
wrong?


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

Reply via email to