I am using the SimplePlot class from Gflot library (3.1.0) in one of my projects and I noticed that in the constructor the default height and width is being set to a certain value that CANNOT be changed.
private static final int DEFAULT_WIDTH = 600;
private static final int DEFAULT_HEIGHT = 300;
public SimplePlot( Element plotContainer, PlotModel model, PlotOptions options )
{
this.model = model;
onLoadOperations = new ArrayList<Command>();
setElement( plotContainer );
setWidth( DEFAULT_WIDTH );
setHeight( DEFAULT_HEIGHT );
this.options = options;
}
Although there are methods to change the height and width of the plot, (setWidth and setHeight), the initial default setting is causing a problem. When the chart is loaded for the first time, for the first milliseconds or microseconds the charts loads with the default 300px setting, once the new height is calculated in my code and after I call the setHeight method with the new value, it changes from 300px to this new calculated value. Although the change from 300px to a new value (say 50px) is a matter of few milliseconds, the initial view of a larger height is causing a problem. Since there is no way to change the DEFAULT_HEIGHT as it is private and final, Is there a way to avoid loading the chart until the new height is calculated?
Thanks