double[][] dbset = convertToDouble(dset);
return renderGraphics(dbset, (String[])xlabels.toArray(new String[xlabels.size()]));
}
public JComponent renderGraphics(double[][] data, String[] xAxisLabels) {
LineGraph panel = new LineGraph();
panel.setTitle(this.getTitle());
panel.setData(data);
panel.setXAxisLabels(xAxisLabels);
panel.setYAxisLabels(this.getURLs().split(URL_DELIM));
panel.setXAxisTitle(this.getFormattedXAxis());
panel.setYAxisTitle(this.getYAxis());
// we should make this configurable eventually
int _width = getWidth();
int _height = getHeight();
panel.setPreferredSize(new Dimension(_width,_height));
panel.setSize(new Dimension(_width,_height));
panel.setWidth(_width);
panel.setHeight(_width);
setBufferedImage(new BufferedImage(_width,_height,BufferedImage.TYPE_INT_RGB));
panel.paintComponent(this.getBufferedImage().createGraphics());
return panel;
}