Examples of PlotWithOverview


Examples of ca.nanometrics.gflot.client.PlotWithOverview

    plotOptions.setDefaultShadowSize(1);

    plotOptions.setLegendOptions(new LegendOptions().setShow(false));

    plotOptions.setSelectionOptions(new SelectionOptions().setDragging(true).setMode("x"));
    final PlotWithOverview plot = new PlotWithOverview(model, plotOptions);
    // add hover listener
    plot.addHoverListener(new PlotHoverListener() {
      public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
        if (item != null) {
          selectedPointLabel
              .setText("x: " + item.getDataPoint().getX() + ", y: " + item.getDataPoint().getY());
        } else {
          selectedPointLabel.setText(INSTRUCTION);
        }
      }
    }, false);
    plot.addSelectionListener(new SelectionListener() {

      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");

    Marking m2 = new Marking();
    m2.setX(new Range(5, 7));
    m2.setColor("#cccccc");

    Marking m3 = new Marking();
    Range a = new Range();
    a.setFrom(8);
    m3.setX(a);
    m3.setColor("#000000");

    Markings ms = new Markings();
    ms.addMarking(m);
    ms.addMarking(m2);
    ms.addMarking(m3);
    // End of Marking Code

    // Add Markings Objects to Grid Options
    plotOptions.setGridOptions(new GridOptions().setHoverable(true).setMarkings(ms));

    plot.setHeight(250);
    plot.setOverviewHeight(60);

   
   
    FlowPanel panel = new FlowPanel(){
      @Override
      protected void onLoad() {
        super.onLoad();
        plot.setLinearSelection(0, 10);
            plot.redraw();
      }
    };
    panel.add(selectedPointLabel);
    panel.add(plot);
    return panel;
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

    plotOptions.setDefaultShadowSize(0);

    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
    final Timer updater = new Timer() {
      @Override
      public void run() {
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

        new TimeSeriesAxisOptions());

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

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

    // pull the "fake" RPC service for new data
    final Timer updater = new Timer() {
      @Override
      public void run() {
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

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

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

    // put it on a panel
    FlowPanel panel = new FlowPanel() {

      @Override
      protected void onLoad() {
        super.onLoad();
        plot.setLinearSelection(150, 199);
      }
    };
    panel.add(plot);
    panel.add(new Label("Click on the overview to change the selection."));
    return panel;
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

                .setXAxisOptions( new TimeSeriesAxisOptions() );

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

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

        // pull the "fake" RPC service for new data
        final Timer updater = new Timer()
        {
            @Override
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

        {
            series.add( new DataPoint( i, Random.nextDouble() ) );
        }

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

        // put it on a panel
        FlowPanel panel = new FlowPanel();
        panel.add( plot );
        panel.add( new Label( "Click on the overview to change the selection." ) );

        // have to wait the plot to be loaded before calling the setLinearSelection method
        Scheduler.get().scheduleDeferred( new ScheduledCommand()
        {
            @Override
            public void execute()
            {
                plot.setLinearSelection( 150, 199 );
            }
        } );

        return panel;
    }
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

        plotOptions.setGlobalSeriesOptions( new GlobalSeriesOptions()
        .setLineSeriesOptions( new LineSeriesOptions().setLineWidth( 1 ).setShow( true ) )
        .setPointsOptions( new PointsSeriesOptions().setRadius( 2 ).setShow( true ) ).setShadowSize( 1 ) );
        plotOptions.setLegendOptions( new LegendOptions().setShow( false ) );

        final PlotWithOverview plot = new PlotWithOverview( model, plotOptions );
        // add hover listener
        plot.addHoverListener( new PlotHoverListener()
        {
            public void onPlotHover( Plot plot, PlotPosition position, PlotItem item )
            {
                if ( item != null )
                {
                    selectedPointLabel.setText( "x: " + item.getDataPoint().getX() + ", y: " + item.getDataPoint().getY() );
                }
                else
                {
                    selectedPointLabel.setText( INSTRUCTION );
                }
            }
        }, false );
        plot.addSelectionListener( new SelectionListener()
        {

            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" );

        Marking m2 = new Marking();
        m2.setX( new Range( 5, 7 ) );
        m2.setColor( "#cccccc" );

        Marking m3 = new Marking();
        Range a = new Range();
        a.setFrom( 8 );
        m3.setX( a );
        m3.setColor( "#000000" );

        Markings ms = new Markings();
        ms.addMarking( m );
        ms.addMarking( m2 );
        ms.addMarking( m3 );
        // End of Marking Code

        // Add Markings Objects to Grid Options
        plotOptions.setGridOptions( new GridOptions().setHoverable( true ).setMarkings( ms ) );

        plot.setHeight( 250 );
        plot.setOverviewHeight( 60 );

        FlowPanel panel = new FlowPanel();
        panel.add( selectedPointLabel );
        panel.add( plot );

        // have to wait the plot to be loaded before calling the setLinearSelection method
        Scheduler.get().scheduleDeferred( new ScheduledCommand()
        {
            @Override
            public void execute()
            {
                plot.setLinearSelection( 1, 8 );
            }
        } );
        return panel;
    }
View Full Code Here

Examples of ca.nanometrics.gflot.client.PlotWithOverview

        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
        final Timer updater = new Timer()
        {
            @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.