Package org.openfaces.component.chart

Examples of org.openfaces.component.chart.ChartLabels


    }

    private void colorInit(GridChartView chartView, AbstractRenderer renderer) {
        StyleObjectModel cssViewModel = chartView.getStyleObjectModel();

        ChartLabels labels = chartView.getLabels();

        if (labels != null) {
            StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
            renderer.setBaseItemLabelPaint(cssLabelsModel.getColor());
            renderer.setBaseItemLabelFont(CSSUtil.getFont(cssLabelsModel));

        } else {
            renderer.setBaseItemLabelPaint(cssViewModel.getColor());
View Full Code Here


            LegendPosition position = legend.getPosition();
            setPosition(position != null ? position.toRectangleEdge() : RectangleEdge.BOTTOM);
        }

        //from legend labels
        ChartLabels labels = (legend != null) ? legend.getLabels() : null;
        if (labels != null) {
            StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
            setItemPaint(cssLabelsModel.getColor());
            setItemFont(CSSUtil.getFont(cssLabelsModel));
        } else {
            setItemPaint(cssLegendModel.getColor());
            setItemFont(CSSUtil.getFont(cssLegendModel));
View Full Code Here

        ChartLegend legend = chart.getLegend();
        if (legend == null || legend.getLabels() == null)
            return;

        final ChartLabels labels = legend.getLabels();
        if (labels.getText() != null) {
            // simple text = the same string for every item
            plot.setLegendLabelGenerator(new PieSectionLabelGenerator() {
                public String generateSectionLabel(PieDataset pieDataset, Comparable comparable) {
                    return labels.getText();
                }

                public AttributedString generateAttributedSectionLabel(PieDataset dataset, Comparable key) {
                    return null;
                }
            });
        } else if (labels.getDynamicText() != null) {
            plot.setLegendLabelGenerator(new DynamicPieGenerator(chartView, labels.getDynamicText()));
        } else {
            plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator());
        }

    }
View Full Code Here

    }

    private void setupPieLabelGenerator(PiePlot plot, PieChartView chartView) {
        if (chartView.isLabelsVisible()) {
            ChartLabels labels = chartView.getLabels();
            if (labels != null && labels.getDynamicText() != null)
                plot.setLabelGenerator(new DynamicPieGenerator(chartView, labels.getDynamicText()));
            else
                plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
            //TODO: move to style helper
            if (labels != null) {
                StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
                plot.setLabelFont(CSSUtil.getFont(cssLabelsModel));
                plot.setLabelPaint(cssLabelsModel.getColor());
                plot.setLabelBackgroundPaint(cssLabelsModel.getBackground());
            }
        } else {
View Full Code Here

        ChartLegend legend = chart.getLegend();
        if (legend == null || legend.getLabels() == null)
            return;

        final ChartLabels labels = legend.getLabels();
        if (labels.getText() != null) {
            // simple text = the same string for every item
            plot.setLegendLabelGenerator(new PieSectionLabelGenerator() {
                public String generateSectionLabel(PieDataset pieDataset, Comparable comparable) {
                    return labels.getText();
                }

                public AttributedString generateAttributedSectionLabel(PieDataset dataset, Comparable key) {
                    return null;
                }
            });
        } else if (labels.getDynamicText() != null) {
            plot.setLegendLabelGenerator(new DynamicPieGenerator(chartView, labels.getDynamicText()));
        } else {
            plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator());
        }

    }
View Full Code Here

    }

    private void setupPieLabelGenerator(PiePlot plot, PieChartView chartView) {
        if (chartView.isLabelsVisible()) {
            ChartLabels labels = chartView.getLabels();
            if (labels != null && labels.getDynamicText() != null)
                plot.setLabelGenerator(new DynamicPieGenerator(chartView, labels.getDynamicText()));
            else
                plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
            //TODO: move to style helper
            if (labels != null) {
                StyleObjectModel cssLabelsModel = labels.getStyleObjectModel();
                plot.setLabelFont(CSSUtil.getFont(cssLabelsModel));
                plot.setLabelPaint(cssLabelsModel.getColor());
                plot.setLabelBackgroundPaint(cssLabelsModel.getBackground());
            }
        } else {
View Full Code Here

TOP

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

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.