private Plot createPlot(Chart chart, ModelInfo info) {
final BarChartView chartView = (BarChartView) chart.getChartView();
if (info.getModelType().equals(ModelType.Number)) {
XYDataset ds = ModelConverter.toXYSeriesCollection(info);
XYBarRenderer renderer = new XYBarRendererAdapter();
ConfigurableRenderer configurableRenderer = (ConfigurableRenderer) renderer;
int seriesCount = ds != null ? ds.getSeriesCount() : 0;
configure(chartView, configurableRenderer, seriesCount);
final GridXYPlotAdapter xyPlotAdapter = new GridXYPlotAdapter(ds, renderer, chartView);
initMarkers(chart, xyPlotAdapter);
return xyPlotAdapter;
}
if (info.getModelType().equals(ModelType.Date)) {
TimeSeriesCollection ds = ModelConverter.toTimeSeriesCollection(chart, info);
XYBarRenderer renderer = new XYBarRendererAdapter();
ConfigurableRenderer configurableRenderer = (ConfigurableRenderer) renderer;
int seriesCount = ds != null ? ds.getSeriesCount() : 0;
configure(chartView, configurableRenderer, seriesCount);