Package org.primefaces.model.chart

Examples of org.primefaces.model.chart.ChartModel


   
    protected abstract void encodeData(FacesContext context, Chart chart) throws IOException;
   
    protected void encodeOptions(FacesContext context, Chart chart) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        ChartModel model = chart.getModel();
        String legendPosition = model.getLegendPosition();
        String title = model.getTitle();
        String seriesColors = model.getSeriesColors();
        String negativeSeriesColors = model.getNegativeSeriesColors();
        String extender = model.getExtender();

        if(title != null)
            writer.write(",title:\"" + ComponentUtils.escapeText(title) + "\"");
       
        if(!model.isShadow())
            writer.write(",shadow:false");
       
        if(seriesColors != null)
            writer.write(",seriesColors:[\"#" +  seriesColors.replaceAll("[ ]*,[ ]*", "\",\"#") + "\"]");
       
        if(negativeSeriesColors != null)
            writer.write(",negativeSeriesColors:[\"#" +  negativeSeriesColors.replaceAll("[ ]*,[ ]*", "\",\"#") + "\"]");
       
        if(legendPosition != null) {
            LegendPlacement legendPlacement = model.getLegendPlacement();
            writer.write(",legendPosition:\"" + legendPosition + "\"");
           
            if(model.getLegendCols() != 0)
                writer.write(",legendCols:" + model.getLegendCols());
           
            if(model.getLegendRows() != 0)
                writer.write(",legendRows:" + model.getLegendRows());
           
            if(legendPlacement != null)
                writer.write(",legendPlacement:\"" + legendPlacement + "\"");
        }
       
        if(!model.isMouseoverHighlight())
            writer.write(",highlightMouseOver:" + false);
       
        if(extender != null)
            writer.write(",extender:" + extender);
       
View Full Code Here

TOP

Related Classes of org.primefaces.model.chart.ChartModel

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.