Examples of ChartView


Examples of org.openfaces.component.chart.ChartView

    public void encodeEnd(FacesContext facesContext, UIComponent component) throws IOException {
        Components.generateIdIfNotSpecified(component);
        ResponseWriter writer = facesContext.getResponseWriter();
        Chart chart = (Chart) component;

        ChartView view = chart.getChartView();
        if (!chart.isRendered() || view == null)
            return;

        writer.startElement("div", chart);
        writeIdAttribute(facesContext, chart);
        Rendering.writeComponentClassAttribute(writer, chart);
        writer.writeAttribute("style", "width: " + chart.getWidth() + "px;" + " height:" + chart.getHeight() + "px;", "style");

        String actionFiledId = chart.getClientId(facesContext) + MapRenderUtilities.ACTION_FIELD_SUFFIX;
        Rendering.writeNewLine(writer);
        Rendering.renderHiddenField(writer, actionFiledId, null);
        Rendering.writeNewLine(writer);

        BufferedImage image = chart.make();
        final byte[] imageAsByteArray = Rendering.encodeAsPNG(image);

        final JfcRenderHints renderHints = chart.getRenderHints();
        final ChartRenderingInfo renderingInfo = renderHints.getRenderingInfo();
        String mapId = renderHints.getMapId(chart);
        String map = MapRenderUtilities.getImageMapExt(chart, mapId, renderingInfo,
                new StandardToolTipTagFragmentGenerator(), new StandardURLTagFragmentGenerator());
        renderHints.setMap(map);
        if (view.getChartPopup() != null) {
            encodeChartPopup(facesContext, chart, view, renderingInfo);
        }

        chart.setImageBytes(imageAsByteArray);
        final Integer oldEntityIndex = chart.getEntityIndex();
View Full Code Here

Examples of org.openfaces.component.chart.ChartView

    protected void encodeScripts(FacesContext context, Chart chart, DynamicImage dynamicImage) throws IOException {
        ScriptBuilder buf = new ScriptBuilder();
        final Integer oldEntityIndex = chart.getEntityIndex();
        chart.setEntityIndex(-1);
        ChartView chartView = chart.getChartView();
        if (chart.getChartSelection() != null ||
                chartView.getActionListener() != null ||
                chartView.getActionListeners().length > 0) {
            buf.initScript(context, chart, "O$.Chart._init");
        }

        encodeChartSelection(context, chart);
        encodeChartMenuSupport(context, chart, dynamicImage, buf);
View Full Code Here

Examples of pivot.charts.ChartView

    @Override
    public void install(Component component) {
        super.install(component);

        // Add listeners
        ChartView chartView = (ChartView)component;
        chartView.getChartViewListeners().add(this);
        chartView.getChartViewCategoryListeners().add(this);
        chartView.getChartViewSeriesListeners().add(this);
    }
View Full Code Here

Examples of pivot.charts.ChartView

    }

    @Override
    public void uninstall() {
        // Remove listeners
        ChartView chartView = (ChartView)getComponent();
        chartView.getChartViewListeners().remove(this);
        chartView.getChartViewCategoryListeners().remove(this);
        chartView.getChartViewSeriesListeners().remove(this);

        super.uninstall();
    }
View Full Code Here

Examples of pivot.charts.ChartView

            return false;
        }

        @SuppressWarnings("unchecked")
        public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
            ChartView chartView = (ChartView)component;
            ChartView.Element element = chartView.getElementAt(x, y);

            if (element != null) {
                int seriesIndex = element.getSeriesIndex();
                int elementIndex = element.getElementIndex();

                String elementLabel;
                ChartView.CategorySequence categories = chartView.getCategories();
                if (categories.getLength() > 0) {
                    elementLabel = "\"" + chartView.getCategories().get(elementIndex).getLabel() + "\"";
                } else {
                    elementLabel = Integer.toString(elementIndex);
                }

                List<?> chartData = chartView.getChartData();
                Object series = chartData.get(seriesIndex);

                Dictionary<String, Object> seriesDictionary;
                if (series instanceof Dictionary<?, ?>) {
                    seriesDictionary = (Dictionary<String, Object>)series;
                } else {
                    seriesDictionary = new BeanDictionary(series);
                }

                String seriesNameKey = chartView.getSeriesNameKey();

                Alert.alert("You clicked element " + elementLabel + " in \""
                    + seriesDictionary.get(seriesNameKey) + "\".", frame);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.