Package org.openfaces.component.chart.impl.configuration

Examples of org.openfaces.component.chart.impl.configuration.ConfigurableRenderer


        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);

            final GridDatePlotAdapter datePlotAdapter = new GridDatePlotAdapter(ds, renderer, chartView);
            initMarkers(chart, datePlotAdapter);

            return datePlotAdapter;
        }

        CategoryDataset ds = ModelConverter.toCategoryDataset(info);
        int rowCount = ds != null ? ds.getRowCount() : 0;

        BarRenderer renderer = chartView.isEnable3D()
                ? new BarRenderer3DAdapter()
                : new BarRendererAdapter();

        ConfigurableRenderer configurableRenderer = (ConfigurableRenderer) renderer;
        configure(chartView, configurableRenderer, rowCount);

        if (chartView.isEnable3D() && renderer instanceof BarRenderer3DAdapter) {
            ((BarRenderer3DAdapter) renderer).setWallPaint(chartView.getWallColor());
        }
View Full Code Here

TOP

Related Classes of org.openfaces.component.chart.impl.configuration.ConfigurableRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.