23-07-2007, 08:21 AM
Here is a version of ScatterPlot with x/y axes shown. The axes labels change appropriately as the user chooses different fields to plot on the x and y axes.
One thing that felt kludgy to me was that to get the axes labels to redraw, I had to set the rangeModel to null. From axisUpdateAction:
if( isNumeric ) {
// need to set range model to null to force recalculation
labels.setRangeModel(null);
axis.setDataType(Constants.NUMERICAL);
} else { // completely untested with derived columns
axis.setDataType(Constants.ORDINAL);
labels.setRangeModel(null);
}
vis.run("draw");
Is there a different way I should be forcing a redraw, or is setting to null the Right Way To Do It?
One thing that felt kludgy to me was that to get the axes labels to redraw, I had to set the rangeModel to null. From axisUpdateAction:
if( isNumeric ) {
// need to set range model to null to force recalculation
labels.setRangeModel(null);
axis.setDataType(Constants.NUMERICAL);
} else { // completely untested with derived columns
axis.setDataType(Constants.ORDINAL);
labels.setRangeModel(null);
}
vis.run("draw");
Is there a different way I should be forcing a redraw, or is setting to null the Right Way To Do It?
