Package org.primefaces.model.chart

Examples of org.primefaces.model.chart.DonutChartModel


public class DonutRenderer extends BasePlotRenderer {
   
    @Override
    protected void encodeData(FacesContext context, Chart chart) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        DonutChartModel model = (DonutChartModel) chart.getModel();
        List data = model.getData();
       
        writer.write(",data:[");
        for(int i = 0; i < data.size() ; i++) {
            if(i != 0) {
                writer.write(",");
View Full Code Here


    @Override
    protected void encodeOptions(FacesContext context, Chart chart) throws IOException {
        super.encodeOptions(context, chart);
       
        ResponseWriter writer = context.getResponseWriter();
        DonutChartModel model = (DonutChartModel) chart.getModel();
        int sliceMargin = model.getSliceMargin();
        boolean fill = model.isFill();
        boolean showDataLabels = model.isShowDataLabels();
        String dataFormat = model.getDataFormat();
   
        if(sliceMargin != 0) writer.write(",sliceMargin:" + sliceMargin);
        if(!fill) writer.write(",fill:false");
        if(showDataLabels) writer.write(",showDataLabels:true");
        if(dataFormat != null) writer.write(",dataFormat:\"" + dataFormat + "\"");
View Full Code Here

    public DonutChartController() {
        createDonutChart();
    }

    private void createDonutChart() {
        model = new DonutChartModel();

        Map<String, Number> circle1 = new LinkedHashMap<String, Number>();
        circle1.put("APPL", 150);
        circle1.put("IBM", 180);
        circle1.put("AMD", 30);
View Full Code Here

TOP

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

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.