Examples of PlotRenderingInfo


Examples of com.positive.charts.plot.PlotRenderingInfo

   * @param entities
   *            an entity collection (<code>null</code> permitted).
   */
  public ChartRenderingInfo(final EntityCollection entities) {
    this.chartArea = new Rectangle(0, 0, 0, 0);
    this.plotInfo = new PlotRenderingInfo(this);
    this.entities = entities;
  }
View Full Code Here

Examples of com.positive.charts.plot.PlotRenderingInfo

  /**
   * Clears the information recorded by this object.
   */
  public void clear() {
    this.chartArea.x = this.chartArea.y = this.chartArea.width = this.chartArea.height = 0;
    this.plotInfo = new PlotRenderingInfo(this);
    if (this.entities != null) {
      this.entities.clear();
    }
  }
View Full Code Here

Examples of com.positive.charts.plot.PlotRenderingInfo

  /**
   * Draw the plot (axes and data visualization).
   */
  private void drawPlot(final GC gc, final Rectangle plotArea,
      final Point anchor, final ChartRenderingInfo info) {
    PlotRenderingInfo plotInfo = null;
    if (info != null) {
      plotInfo = info.getPlotInfo();
    }
    this.plot.draw(gc, plotArea, anchor, null, plotInfo);
  }
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

    if (action.equals("mouseover")) {
      if (chartRenderingInfo==null) return false;

      XYPlot plot = (XYPlot)chart.getXYPlot();
     
      PlotRenderingInfo info = chartRenderingInfo.getPlotInfo();
      Rectangle2D dataArea = info.getDataArea();
      if (dataArea.contains(x, y)) {
        plot.setRangeCrosshairVisible(true);
        plot.setDomainCrosshairVisible(true);
       
        String msg = "";

        // set the crosshair value for the horizontal axis...
        ValueAxis da = plot.getDomainAxis();
        if (da != null) {
          double hvalue = da.translateJava2DToValue(x, info.getDataArea(),plot.getDomainAxisEdge());
          plot.setDomainCrosshairValue(hvalue,false);
          String label = da.getLabel();
          if ((label!=null) && (!label.equals(""))) msg += label;
          else msg+= resources.getString("X");
          msg += "=" + AxisLabelFormatter.labelFormat(hvalue);
        }

        // set the crosshair value for the vertical axis...
        ValueAxis ra = plot.getRangeAxis();
        if (ra != null) {
          double vvalue = ra.translateJava2DToValue(y, info.getDataArea(),plot.getRangeAxisEdge());
          plot.setRangeCrosshairValue(vvalue,false);
          if (!msg.equals("")) msg+="   ";
          String label = ra.getLabel();
          if ((label!=null) && (!label.equals(""))) msg += label;
          else msg+= resources.getString("Y");
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

      // get the origin of the zoom selection in the Java2D space used for
      // drawing the chart (that is, before any scaling to fit the panel)
      Point2D selectOrigin = translateScreenToJava2D(new Point(
              (int) Math.ceil(selection.getX()),
              (int) Math.ceil(selection.getY())));
      PlotRenderingInfo plotInfo = this.info.getPlotInfo();
      Rectangle2D scaledDataArea = getScreenDataArea(
              (int) selection.getCenterX(), (int) selection.getCenterY());
      if ((selection.getHeight() > 0) && (selection.getWidth() > 0))
      {
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

    *
    * @return The scaled data area.
    */
   public Rectangle2D getScreenDataArea(int x, int y)
   {
      PlotRenderingInfo plotInfo = this.info.getPlotInfo();
      Rectangle2D result;
      if (plotInfo.getSubplotCount() == 0)
      {
         result = getScreenDataArea();
      }
      else
      {
         // get the origin of the zoom selection in the Java2D space used for
         // drawing the chart (that is, before any scaling to fit the panel)
         Point2D selectOrigin = translateScreenToJava2D(new Point(x, y));
         int subplotIndex = plotInfo.getSubplotIndex(selectOrigin);
         if (subplotIndex == -1)
         {
            return null;
         }
         result = scale(plotInfo.getSubplotInfo(subplotIndex).getDataArea());
      }
      return result;
   }
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

     *
     * @param entities  an entity collection (<code>null</code> permitted).
     */
    public ChartRenderingInfo(EntityCollection entities) {
        this.chartArea = new Rectangle2D.Double();
        this.plotInfo = new PlotRenderingInfo(this);
        this.entities = entities;
    }
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

    /**
     * Clears the information recorded by this object.
     */
    public void clear() {
        this.chartArea.setRect(0.0, 0.0, 0.0, 0.0);
        this.plotInfo = new PlotRenderingInfo(this);
        if (this.entities != null) {
            this.entities.clear();
        }
    }
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

     * @param e  the mouse wheel event.
     */
    private void handleZoomable(Zoomable zoomable, MouseWheelEvent e) {
        // don't zoom unless the mouse pointer is in the plot's data area
        ChartRenderingInfo info = this.chartPanel.getChartRenderingInfo();
        PlotRenderingInfo pinfo = info.getPlotInfo();
        Point2D p = this.chartPanel.translateScreenToJava2D(e.getPoint());
        if (!pinfo.getDataArea().contains(p)) {
            return;
        }

        Plot plot = (Plot) zoomable;
        // do not notify while zooming each axis
View Full Code Here

Examples of org.jfree.chart.plot.PlotRenderingInfo

  // Returns a pan request listener.
  protected Listener<PanRequestMessage> createPanRequestListener() {
    return new Listener<PanRequestMessage>() {
      @Override
      public void update(PanRequestMessage msg) {
        final PlotRenderingInfo plotInfo = chartPanel
            .getChartRenderingInfo().getPlotInfo();

        final Point2D source = new Point2D.Double(0, 0);

        double percentage = 0.01;
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.