Package ca.nanometrics.gflot.client

Examples of ca.nanometrics.gflot.client.SeriesHandler


        PlotOptions plotOptions = new PlotOptions();
        plotOptions.setGlobalSeriesOptions( new GlobalSeriesOptions()
        .setLineSeriesOptions( new LineSeriesOptions().setLineWidth( 1 ).setShow( true ) )
        .setPointsOptions( new PointsSeriesOptions().setRadius( 2 ).setShow( true ) ).setShadowSize( 0d ) );

        SeriesHandler series = model.addSeries( "Random Series", "#2c1d54" );

        // generate random data
        for ( int i = 0; i < 200; i++ )
        {
            series.add( new DataPoint( i, Random.nextDouble() ) );
        }

        // create the plot
        final PlotWithOverview plot = new PlotWithOverview( model, plotOptions );
View Full Code Here


        // add tick formatter to the options
        plotOptions.setXAxisOptions( new AxisOptions().setMinimum( -8 ).setMaximum( 4 ) );
        plotOptions.setYAxisOptions( new AxisOptions().setMinimum( -8 ).setMaximum( 4 ) );

        // create a series
        SeriesHandler handlerImage = model.addSeries( "Image series" );
        handlerImage.getSeries().setSeriesOptions( SeriesType.IMAGE, new ImageSeriesOptions().setShow( true ).setAlpha(0.5) );
        handlerImage.add( new ImageDataPoint( "images/hs-2004-27-a-large_web.jpg", -2, -2, 2, 2 ) );

        // create a series
        SeriesHandler handlerLine = model.addSeries( "Line series" );
        handlerLine.add( new DataPoint(-8, -8) );
        handlerLine.add( new DataPoint(-6, -4) );
        handlerLine.add( new DataPoint(-2, -8) );
        handlerLine.add( new DataPoint(4, 0) );

        // add data

        SimplePlot plot = new SimplePlot( model, plotOptions );
        plot.setLoadDataImages( true );
View Full Code Here

            public void selected( double x1, double y1, double x2, double y2 )
            {
                plot.setLinearSelection( x1, x2 );
            }
        } );
        SeriesHandler s = plot.getModel().addSeries( "Series 1" );
        s.add( new DataPoint( 1, 2 ) );
        s.add( new DataPoint( 2, 5 ) );
        s.add( new DataPoint( 3, 7 ) );
        s.add( new DataPoint( 4, 5 ) );
        s.add( new DataPoint( 5, 3 ) );
        s.add( new DataPoint( 6, 2 ) );
        s.add( new DataPoint( 7, 5 ) );
        s.add( new DataPoint( 8, 7 ) );
        s.add( new DataPoint( 9, 5 ) );
        s.add( new DataPoint( 10, 3 ) );

        // Start of Marking Code
        Marking m = new Marking();
        m.setX( new Range( 2, 4 ) );
        m.setColor( "#3BEFc3" );
View Full Code Here

                return label + " formated";
            }
        } ) );
        plotOptions.setXAxisOptions( new AxisOptions().setShow( false ) );

        final SeriesHandler series = model.addSeries( "Random Series", "#003366" );

        // create the plot
        final PlotWithOverview plot = new PlotWithOverview( model, plotOptions );

        // pull the "fake" RPC service for new data
View Full Code Here

    // >>>>>>> You need make the grid hoverable <<<<<<<<<
    plotOptions.setGridOptions(new GridOptions().setHoverable(true));
    // >>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    // create a series
    SeriesHandler handler = model.addSeries("Ottawa's Month Temperatures (Daily Average in &deg;C)", "#007f00");

    // add data
    handler.add(new DataPoint(1, -10.5));
    handler.add(new DataPoint(2, -8.6));
    handler.add(new DataPoint(3, -2.4));
    handler.add(new DataPoint(4, 6));
    handler.add(new DataPoint(5, 13.6));
    handler.add(new DataPoint(6, 18.4));
    handler.add(new DataPoint(7, 21));
    handler.add(new DataPoint(8, 19.7));
    handler.add(new DataPoint(9, 14.7));
    handler.add(new DataPoint(10, 8.2));
    handler.add(new DataPoint(11, 1.5));
    handler.add(new DataPoint(12, -6.6));

    // create the plot
    SimplePlot plot = new SimplePlot(model, plotOptions);

        final PopupPanel popup = new PopupPanel();
View Full Code Here

        plotOptions.setXAxisOptions( new TimeSeriesAxisOptions().setTickSize( 2, TickTimeUnit.MONTH ).setMonthNames( MONTH_NAMES ) );

        // create a series
        // Note: you need to specified the colors in other for the legend to
        // work properly
        SeriesHandler ottawaSeries = model.addSeries( "Ottawa", "#edc240" );
        SeriesHandler vancouverSeries = model.addSeries( "Vancouver", "#afd8f8" );

        // add data
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 0, 1, 0, 0, 0 ), -10.5 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 1, 1, 0, 0, 0 ), -8.6 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 2, 1, 0, 0, 0 ), -2.4 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 3, 1, 0, 0, 0 ), 6 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 4, 1, 0, 0, 0 ), 13.6 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 5, 1, 0, 0, 0 ), 18.4 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 6, 1, 0, 0, 0 ), 21 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 7, 1, 0, 0, 0 ), 19.7 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 8, 1, 0, 0, 0 ), 14.7 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 9, 1, 0, 0, 0 ), 8.2 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 10, 1, 0, 0, 0 ), 1.5 ) );
        ottawaSeries.add( new DataPoint( Date.UTC( 110, 11, 1, 0, 0, 0 ), -6.6 ) );

        vancouverSeries.add( new DataPoint( Date.UTC( 110, 0, 1, 0, 0, 0 ), 4.8 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 1, 1, 0, 0, 0 ), 5.9 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 2, 1, 0, 0, 0 ), 7.6 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 3, 1, 0, 0, 0 ), 10 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 4, 1, 0, 0, 0 ), 13.2 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 5, 1, 0, 0, 0 ), 15.9 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 6, 1, 0, 0, 0 ), 18.1 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 7, 1, 0, 0, 0 ), 18.3 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 8, 1, 0, 0, 0 ), 15.4 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 9, 1, 0, 0, 0 ), 11.1 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 10, 1, 0, 0, 0 ), 7.1 ) );
        vancouverSeries.add( new DataPoint( Date.UTC( 110, 11, 1, 0, 0, 0 ), 4.8 ) );

        // create the plot
        SimplePlot plot = new SimplePlot( model, plotOptions );

        // put it on a panel
View Full Code Here

        } ) );

        plotOptions.setGridOptions( new GridOptions().setAboveData( true ) );

        // create a series
        SeriesHandler handler = model.addSeries( "Ottawa's Month Temperatures (Daily Average in &deg;C)", "blue" );

        // add data
        handler.add( new DataPoint( 1, -10.5 ) );
        handler.add( new DataPoint( 2, -8.6 ) );
        handler.add( new DataPoint( 3, -2.4 ) );
        handler.add( new DataPoint( 4, 6 ) );
        handler.add( new DataPoint( 5, 13.6 ) );
        handler.add( new DataPoint( 6, 18.4 ) );
        handler.add( new DataPoint( 7, 21 ) );
        handler.add( new DataPoint( 8, 19.7 ) );
        handler.add( new DataPoint( 9, 14.7 ) );
        handler.add( new DataPoint( 10, 8.2 ) );
        handler.add( new DataPoint( 11, 1.5 ) );
        handler.add( new DataPoint( 12, -6.6 ) );

        // create the plot
        SimplePlot plot = new SimplePlot( model, plotOptions );

        // put it on a panel
View Full Code Here

TOP

Related Classes of ca.nanometrics.gflot.client.SeriesHandler

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.