Package org.primefaces.model.chart

Examples of org.primefaces.model.chart.OhlcChartModel


public class OhlcRenderer extends CartesianPlotRenderer {

    @Override
    protected void encodeData(FacesContext context, Chart chart) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        OhlcChartModel model = (OhlcChartModel) chart.getModel();
        List<OhlcChartSeries> data = model.getData();
       
        writer.write(",data:[[");
        for(Iterator<OhlcChartSeries> it = data.iterator(); it.hasNext();) {
            OhlcChartSeries s = it.next();
            writer.write("[");
View Full Code Here


    @Override
    protected void encodeOptions(FacesContext context, Chart chart) throws IOException {
        super.encodeOptions(context, chart);
       
        ResponseWriter writer = context.getResponseWriter();
        OhlcChartModel model = (OhlcChartModel) chart.getModel();
       
        if(model.isCandleStick())
            writer.write(",candleStick:true");
       
        if(model.isZoom())
            writer.write(",zoom:true");
       
        if(model.isAnimate())
            writer.write(",animate:true");
       
        if(model.isShowDatatip()) {
            writer.write(",datatip:true");
            if(model.getDatatipFormat() != null)
                writer.write(",datatipFormat:\"" + model.getDatatipFormat() + "\"");
        }
    }   
View Full Code Here

public class OhlcChartController implements Serializable {

    private OhlcChartModel model;

    public OhlcChartController() {
        model = new OhlcChartModel();

        model.add(new OhlcChartSeries(1, 136.01, 139.5, 134.53, 139.48));
        model.add(new OhlcChartSeries(2, 143.82, 144.56, 136.04, 136.97));
        model.add(new OhlcChartSeries(3, 136.47, 146.4, 136, 144.67));
        model.add(new OhlcChartSeries(4, 124.76, 135.9, 124.55, 135.81));
View Full Code Here

        endScript(writer);
    }
   
    protected void encodeData(FacesContext context, OhlcChart chart) throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        OhlcChartModel model = (OhlcChartModel) chart.getValue();
        List<OhlcChartSeries> data = model.getData();
       
        writer.write(",data:[[");
        for (Iterator<OhlcChartSeries> it = data.iterator(); it.hasNext();) {
            OhlcChartSeries s = it.next();
            writer.write("[");
View Full Code Here

TOP

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

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.