Timeline - X axis refresh

I have a (Vaadin 7) Timeline object displaying time-series data. A BeanItemContainer is the data source. By default, it loads 4 days worth of data. The user has an option to change the timeframe and re-display the graph. If the user selects 2 days of data, the graph reloads and repaints, but the X axis still shows 4 days - the first two are blank and the last two have data. Similarly, if I select 8 days of data, the BeanItemContainer loads 8 days worth of data points, but the graph only shows 4 days, and I can’t see any of the earlier data. If I delete and recreate the graph (with an 8 day range), all the data shows up.

How do I force the X axis to resize itself? I’m assuming I’m missing a simple refresh call somewhere…

Thanks,

nbc

You need to tell the Timeline to display the new 8 day range. Calling
Timeline.selectFullRange()
should do the trick.

Thanks - but I’m still doing something wrong. My code looks like this, but when I switch from 4 days to 2 days of data, the X axis doesn’t change. Where should I place the call to selectFullRange?


     ...
    tl = myGraph.getTimeline();       // Get the Timeline Object

    for(int i = 0; i < numGraphLines(); i++){
        gl = myGraph.getLine(i);
        updateGraphSource(myGraph, myGraphLine);   // Update the BeanItemContainer for this line
        bic = gl.getBic();         // The updated BeanItemContainer
        tl.setGraphOutlineColor(bic, new java.awt.Color(gl.getColor()));
        tl.selectFullRange();
    }

This code gets called when I try to update the graph, after changing the date range (4 days to 2, or 4 days to 8).
As I said, in the first case, only have the graph gets painted with 2 days worth of data. In the second case, I see 4 days of data, but can’t access the earlier 4 days…

Thanks,

nbc