Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.XYPlot


    if (urls)
    {
      renderer.setURLGenerator(new StandardXYURLGenerator());
    }

    final XYPlot plot = new XYPlot(dataset, domainAxis, valueAxis, renderer);
    plot.setOrientation(orientation);

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
        plot, legend);
  }
View Full Code Here


    if (urls)
    {
      renderer.setURLGenerator(new StandardXYURLGenerator());
    }

    final XYPlot plot = new XYPlot(dataset, domainAxis, valueAxis, renderer);
    plot.setOrientation(orientation);

    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
        plot, legend);
  }
View Full Code Here

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    final XYPlot xypl = chart.getXYPlot();
    final XYItemRenderer renderer = xypl.getRenderer();
    final XYBarRenderer br = (XYBarRenderer) renderer;
    br.setDrawBarOutline(isChartSectionOutline());
    if (margin != null)
    {
      br.setMargin(margin.doubleValue());
    }

    br.setShadowVisible(shadowVisible);
    br.setShadowXOffset(shadowXOffset);
    br.setShadowYOffset(shadowYOffset);

    if ((isStacked()) && renderPercentages && (br instanceof StackedXYBarRenderer))
    {
      final StackedXYBarRenderer sbr = (StackedXYBarRenderer) br;
      sbr.setRenderAsPercentages(true);

      final ValueAxis rangeAxis = xypl.getRangeAxis();
      final int level = getRuntime().getProcessingContext().getCompatibilityLevel();
      if (ClassicEngineBoot.isEnforceCompatibilityFor(level, 3, 8))
      {
        if (getRangeMinimum() != 0)
        {
View Full Code Here

    {
      final NumberAxis catAxis = new NumberAxis("Range");// NON-NLS
      final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
      final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

      final XYPlot plot = new XYPlot(createXYZDataset(), catAxis, barsAxis, new XYAreaRenderer());
      plot.setRenderer(1, new XYLineAndShapeRenderer());

      // add lines dataset and axis to plot
      plot.setDataset(1, createXYZDataset());
      plot.setRangeAxis(1, linesAxis);

      // map lines to second axis
      plot.mapDatasetToRangeAxis(1, 1);

      // set rendering order
      plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);

      // set location of second axis
      plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);

      return new JFreeChart("XY Area Line Chart", plot);// NON-NLS
    }
    if (aExpression instanceof XYAreaChartExpression)
    {
View Full Code Here

    final DrawableWrapper drawable = (DrawableWrapper)xyChartContent.getRawObject();
    assertTrue(drawable.getBackend() instanceof JFreeChartReportDrawable);
    final JFreeChartReportDrawable jFreeChartReportDrawable = (JFreeChartReportDrawable)drawable.getBackend();
    final JFreeChart xyLineChart = jFreeChartReportDrawable.getChart();
    final XYPlot xyLinePlot = xyLineChart.getXYPlot();

    assertTrue(xyLinePlot.getRenderer() instanceof XYLineAndShapeRenderer);
    final XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer)xyLinePlot.getRenderer();
    assertNotNull(renderer);
    assertTrue(renderer.getBaseLinesVisible());
    assertNotNull(renderer.getBaseItemLabelGenerator());
    assertTrue(renderer.getBaseItemLabelGenerator() instanceof StandardXYItemLabelGenerator);
  }
View Full Code Here

        }

        private JFreeChart createDefaultChart() {
            final XYSeriesCollection dataset = new XYSeriesCollection();
            final JFreeChart chart = ChartFactory.createScatterPlot(this.getTitle(), "x", "y", dataset, PlotOrientation.VERTICAL, true, true, false);
            final XYPlot plot = (XYPlot) chart.getPlot();
            plot.setBackgroundPaint(Color.lightGray);
            plot.setDomainGridlinePaint(Color.white);
            plot.setRangeGridlinePaint(Color.white);
            plot.setAxisOffset(new RectangleInsets(4, 4, 4, 4));

            dataset.removeAllSeries();
            final XYSeries series = new XYSeries("Series");
            for (int count=0; count<samples; count++) {
                for (int i=0; i<dimension; i++) {
View Full Code Here

   {
      List<XYPlot> list = ((List<XYPlot>) super.getSubplots());

      for (int i = 0; i < list.size(); i++)
      {
         XYPlot subPlot = (XYPlot) super.getSubplots().get(i);

         if (!(subPlot instanceof IGfrValueLinearAndLogarithmic))
            continue;

         return ((IGfrValueLinearAndLogarithmic) subPlot).isAxisXLogarithmic();
View Full Code Here

   {
      List<XYPlot> list = ((List<XYPlot>) super.getSubplots());

      for (int i = 0; i < list.size(); i++)
      {
         XYPlot subPlot = (XYPlot) super.getSubplots().get(i);

         if (!(subPlot instanceof IGfrValueLinearAndLogarithmic))
            continue;

         ((IGfrValueLinearAndLogarithmic) subPlot).setAxisXLogarithmic(bln);
View Full Code Here

      super.annotationChanged(evt);
   }
  
    @Override
    public LegendItem getLegendItem(int datasetIndex, int series) {
        XYPlot plot = getPlot();
        if (plot == null) {
            return null;
        }

        XYDataset dataset = plot.getDataset(datasetIndex);
        if (dataset == null) {
            return null;
        }
       
        if (!getItemVisible(series, 0)) {
View Full Code Here

    public void paintOverlay(Graphics2D g2, ChartPanel chartPanel) {
        Shape savedClip = g2.getClip();
        Rectangle2D dataArea = chartPanel.getScreenDataArea();
        g2.clip(dataArea);
        JFreeChart chart = chartPanel.getChart();
        XYPlot plot = (XYPlot) chart.getPlot();
        ValueAxis xAxis = plot.getDomainAxis();
        RectangleEdge xAxisEdge = plot.getDomainAxisEdge();
        Iterator iterator = this.xCrosshairs.iterator();
        while (iterator.hasNext()) {
            Crosshair ch = (Crosshair) iterator.next();
            if (ch.isVisible()) {
                double x = ch.getValue();
                double xx = xAxis.valueToJava2D(x, dataArea, xAxisEdge);
                if (plot.getOrientation() == PlotOrientation.VERTICAL) {
                    drawVerticalCrosshair(g2, dataArea, xx, ch);
                }
                else {
                    drawHorizontalCrosshair(g2, dataArea, xx, ch);
                }
            }
        }
        ValueAxis yAxis = plot.getRangeAxis();
        RectangleEdge yAxisEdge = plot.getRangeAxisEdge();
        iterator = this.yCrosshairs.iterator();
        while (iterator.hasNext()) {
            Crosshair ch = (Crosshair) iterator.next();
            if (ch.isVisible()) {
                double y = ch.getValue();
                double yy = yAxis.valueToJava2D(y, dataArea, yAxisEdge);
                if (plot.getOrientation() == PlotOrientation.VERTICAL) {
                    drawHorizontalCrosshair(g2, dataArea, yy, ch);
                }
                else {
                    drawVerticalCrosshair(g2, dataArea, yy, ch);
                }
View Full Code Here

TOP

Related Classes of org.jfree.chart.plot.XYPlot

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.