Package org.openfaces.component.chart

Examples of org.openfaces.component.chart.PieSectorInfo


    }

    private static String getDynamicProperties(Chart chart, ChartViewValueExpression view, ChartEntity entity) {
        GridPointInfo info = ChartInfoUtil.getGridPointInfo(entity, chart);
        if (info == null) {
            PieSectorInfo infoPie = ChartInfoUtil.getPieSectorInfo(entity);
            if (infoPie != null) {
                PieChartView pieView = (PieChartView) chart.getChartView();
                pieView.setSector(infoPie);
                String res = (String) DynamicPropertiesUtils.getDynamicValue("sector", infoPie, view);
                pieView.setSector(null);
View Full Code Here


        }
    }

    private void setupPieChartSelection(PiePlot plot, Chart chart) {
        if (((PieChartView) chart.getChartView()).getSelectedSector() != null) {
            final PieSectorInfo info = ((PieChartView) chart.getChartView()).getSelectedSector();
            final ChartSelection selection = chart.getChartSelection();
            final LineStyle lineStyle = selection.getLineStyle();
            Paint outlinePaint = lineStyle.getColor() != null
                    ? lineStyle.getColor()
                    : Color.WHITE;
            final Stroke outlineStroke = lineStyle.getStroke();
            final Paint selectionPaint = selection.getFillPaint();

            plot.setSectionOutlinePaint(info.getIndex(), outlinePaint);
            if (outlineStroke != null) {
                plot.setSectionOutlineStroke(info.getIndex(), outlineStroke);
            }

            if (selectionPaint != null) {
                plot.setSectionPaint(info.getIndex(), selectionPaint);
            }
        }
    }
View Full Code Here

        double dValue = 0;
        if (value != null) {
            dValue = ((Number) value).doubleValue();
        }

        PieSectorInfo sector = new PieSectorInfoImpl();
        sector.setKey(comparable);
        sector.setValue(value);
        sector.setSeriesTotal(total);
        sector.setIndex(index);
        sector.setSeries(new SeriesInfoImpl());

        sector.getSeries().setIndex(dsIndex);

        double p = (dValue / total);
        DecimalFormat nf1 = new DecimalFormat("#.00%");
        String proportionalPercent = nf1.format(p);

        sector.setProportionalValue(proportionalPercent);
        return sector;
    }
View Full Code Here

    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!(obj instanceof PieSectorInfo))
            return false;
        PieSectorInfo info = (PieSectorInfo) obj;
        return info.getKey().equals(key) && info.getValue().equals(value);

    }
View Full Code Here

    public AttributedString generateAttributedSectionLabel(PieDataset pieDataset, Comparable comparable) {
        return null;
    }

    public boolean getConditionValue(PieSectorProperties sector, int index, PieDataset pieDataset, Comparable comparable) {
        PieSectorInfo info = ChartInfoUtil.getPieSectorInfo(pieDataset, comparable, index);

        ChartViewValueExpression dynamicCondition = sector.getDynamicCondition();
        if (dynamicCondition == null)
            return true;
View Full Code Here

        return result;
    }

    private String getValue(PieDataset pieDataset, Comparable comparable, int index) {
        PieSectorInfo info = ChartInfoUtil.getPieSectorInfo(pieDataset, comparable, index);

        if (valueExpression == null)
            return null;

        pieView.setSector(info);
View Full Code Here

    public boolean isDefaultSector() {
        if (selectedSector != null)
            return false;

        PieSectorInfo sector = getSector();
        if (sector.getKey().equals("ten")) {
            selectedSector = sector;
            return true;
        }
        return false;
    }
View Full Code Here

    public boolean isDefaultSector() {
        if (selectedSector != null)
            return false;

        PieSectorInfo sector = getSector();
        if (sector.getKey().equals("Q1")) {
            selectedSector = sector;
            return true;
        }
        return false;
    }
View Full Code Here

    public String getTitle() {
        return "Largest Cities of the European Union by Population";
    }

    public String getTooltip() {
        PieSectorInfo sector = Faces.var("sector", PieSectorInfo.class);
        DecimalFormat format = new DecimalFormat("#,###");
        return sector.getKey() + " - " + format.format(sector.getValue());
    }
View Full Code Here

                        Object oldAttributeValue = requestMap.put("point", pointInfo);
                        renderChartPopup(facesContext, view);
                        requestMap.put("point", oldAttributeValue);
                    }
                } else if (view instanceof PieChartView) {
                    final PieSectorInfo pieSectorInfo = ChartInfoUtil.getPieSectorInfo(entity);
                    if (pieSectorInfo != null) {
                        Object oldAttributeValue = requestMap.put("sector", pieSectorInfo);
                        renderChartPopup(facesContext, view);
                        requestMap.put("sector", oldAttributeValue);
                    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.chart.PieSectorInfo

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.