Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.SpiderWebPlot


      return ChartFactory.createXYLineChart("XY Line Chart", "X", "Y", createXYZDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof RadarChartExpression)
    {
      final SpiderWebPlot plot = new SpiderWebPlot(createDataset());
      return new JFreeChart("Radar Chart", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    }
    return null;
  }
View Full Code Here


    //Create the stroke for the primary (= real) data series...
    final Stroke thick = new BasicStroke(thicknessprimaryseries);

    //...and apply that stroke to the series
    final SpiderWebPlot webPlot = (SpiderWebPlot) chart.getPlot();

    if (StringUtils.isEmpty(getTooltipFormula()) == false)
    {
      webPlot.setToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula()));
    }
    if (StringUtils.isEmpty(getUrlFormula()) == false)
    {
      webPlot.setURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula()));
    }


    final CategoryDataset categoryDataset = webPlot.getDataset();
    final int count = categoryDataset.getRowCount();

    for (int t = 0; t < count; t++)
    {
      if (categoryDataset.getRowKey(t) instanceof GridCategoryItem)
      {
        continue;
      }
      webPlot.setSeriesOutlineStroke(t, thick);
    }

    //Set the spiderweb filled (or not)
    webPlot.setWebFilled(radarwebfilled);
    //Set the size of the datapoints on the axis
    webPlot.setHeadPercent(headsize);

    //Set the color of the fake datasets (gridlines) to grey
    for (int t = 0; t < count; t++)
    {
      if (categoryDataset.getRowKey(t) instanceof GridCategoryItem)
      {
        webPlot.setSeriesPaint(t, Color.GRAY);
      }
    }

  }
View Full Code Here

    {
      dataset = getSampleDataset();
      labelGenerator = new StandardCategoryItemLabelGenerator();
    }
   
    SpiderWebPlot spiderWebPlot = new SpiderWebPlot(dataset);

        if(plot.getAxisLineColor() != null)
        {
          spiderWebPlot.setAxisLinePaint(plot.getAxisLineColor());
        }
        if(plot.getAxisLineWidth() != null)
        {
          spiderWebPlot.setAxisLineStroke(new BasicStroke(plot.getAxisLineWidth()));
        }
        if(plot.getBackcolor() != null)
        {
          spiderWebPlot.setBackgroundPaint(plot.getBackcolor());
        }
        if(plot.getBackgroundAlpha() != null)
        {
          spiderWebPlot.setBackgroundAlpha(plot.getBackgroundAlpha());
        }
        if(plot.getForegroundAlpha() != null)
        {
          spiderWebPlot.setForegroundAlpha(plot.getForegroundAlpha());
        }
        if(plot.getHeadPercent() != null)
        {
          spiderWebPlot.setHeadPercent(plot.getHeadPercent());
        }
        if(plot.getInteriorGap() != null)
        {
          spiderWebPlot.setInteriorGap(plot.getInteriorGap());
        }
        if(plot.getLabelColor() != null)
        {
          spiderWebPlot.setLabelPaint(plot.getLabelColor());
        }
        if(plot.getLabelFont() != null)
        {
          spiderWebPlot.setLabelFont(JRFontUtil.getAwtFont(plot.getLabelFont(), Locale.getDefault()));
        }
        if(plot.getLabelGap() != null)
        {
          spiderWebPlot.setAxisLabelGap(plot.getLabelGap());
        }
        if(spiderchartBean.getMaxValue() != null)
        {
          spiderWebPlot.setMaxValue(spiderchartBean.getMaxValue());
        }
        if(plot.getRotation() != null)
        {
          spiderWebPlot.setDirection(plot.getRotation().getRotation());
        }
        if(plot.getStartAngle() != null)
        {
          spiderWebPlot.setStartAngle(plot.getStartAngle());
        }
        if(plot.getTableOrder() != null)
        {
          spiderWebPlot.setDataExtractOrder(plot.getTableOrder().getOrder());
        }
        if(plot.getWebFilled() != null)
        {
          spiderWebPlot.setWebFilled(plot.getWebFilled());
        }

        spiderWebPlot.setToolTipGenerator(new StandardCategoryToolTipGenerator());
        spiderWebPlot.setLabelGenerator(labelGenerator);
       
        Font titleFont = chartSettings.getTitleFont() != null
          ? JRFontUtil.getAwtFont(chartSettings.getTitleFont(), Locale.getDefault())
          : TextTitle.DEFAULT_FONT;
      
View Full Code Here

    //Create the stroke for the primary (= real) data series...
    final Stroke thick = new BasicStroke(thicknessprimaryseries);

    //...and apply that stroke to the series
    final SpiderWebPlot webPlot = (SpiderWebPlot) chart.getPlot();
    webPlot.setLabelFont(Font.decode(getLabelFont()));

    if (StringUtils.isEmpty(getTooltipFormula()) == false)
    {
      webPlot.setToolTipGenerator(new FormulaCategoryTooltipGenerator(getRuntime(), getTooltipFormula()));
    }
    if (StringUtils.isEmpty(getUrlFormula()) == false)
    {
      webPlot.setURLGenerator(new FormulaCategoryURLGenerator(getRuntime(), getUrlFormula()));
    }


    final CategoryDataset categoryDataset = webPlot.getDataset();
    final int count = categoryDataset.getRowCount();

    for (int t = 0; t < count; t++)
    {
      if (categoryDataset.getRowKey(t) instanceof GridCategoryItem)
      {
        continue;
      }
      webPlot.setSeriesOutlineStroke(t, thick);
    }

    //Set the spiderweb filled (or not)
    webPlot.setWebFilled(radarwebfilled);
    //Set the size of the datapoints on the axis
    webPlot.setHeadPercent(headsize);

    //Set the color of the fake datasets (gridlines) to grey
    for (int t = 0; t < count; t++)
    {
      if (categoryDataset.getRowKey(t) instanceof GridCategoryItem)
      {
        webPlot.setSeriesPaint(t, Color.GRAY);
      }
    }

  }
View Full Code Here

      return ChartFactory.createXYLineChart("XY Line Chart", "X", "Y", createXYZDataset(), PlotOrientation.VERTICAL,
          true, false, false);// NON-NLS
    }
    if (aExpression instanceof RadarChartExpression)
    {
      final SpiderWebPlot plot = new SpiderWebPlot(createDataset());
      return new JFreeChart("Radar Chart", JFreeChart.DEFAULT_TITLE_FONT, plot, true);
    }
    return null;
  }
View Full Code Here

    if (str != null)
      isItalic = "true".equals(str.toLowerCase());

    Plot plot = ((JFreeChart) chart).getPlot();
    if (plot instanceof SpiderWebPlot) {
      SpiderWebPlot swplot = (SpiderWebPlot) plot;
      swplot.setStartAngle(startAngle);
      swplot.setInteriorGap(interiorGap);
      swplot.setHeadPercent(headPercent);
      swplot.setWebFilled(webFilled);
      swplot.setLabelPaint(labelPaint);

      Font font = new Font(labelFontName,
                (isBold ? Font.BOLD : 0) + (isItalic ? Font.ITALIC : 0),
                labelFontSize);
      swplot.setLabelFont(font);

      if (clockWise)
        swplot.setDirection(Rotation.CLOCKWISE);
      else
        swplot.setDirection(Rotation.ANTICLOCKWISE);

      if (orderByRow)
        swplot.setDataExtractOrder(TableOrder.BY_ROW);
      else
        swplot.setDataExtractOrder(TableOrder.BY_COLUMN);
    }
  }
View Full Code Here

   * @return the created SpiderChart
   */
  private JFreeChart createSpiderChart(DefaultCategoryDataset dataset,
      boolean weighted) {

    SpiderWebPlot plot = new SpiderWebPlot(dataset);
    plot.setMaxValue(200.0f);

    plot.setStartAngle(54);
    plot.setInteriorGap(0.40);
    plot.setToolTipGenerator(new CategoryToolTipGenerator() {

      @Override
      public String generateToolTip(CategoryDataset dataset, int section,
          int index) {
        Float ratingValue = (Float) dataset.getValue(section, index);
        if (ratingValue == null)
          ratingValue = 0.0f;
        else
          ratingValue -= 100.0f;
        return String.valueOf("(" + dataset.getRowKey(section) + ","
            + dataset.getColumnKey(index) + ") = "
            + String.format("%.2f", ratingValue));
      }

    });
    plot.setNoDataMessage("No data to display");
    String titleStr = "ratings of selected elements";
    if (weighted)
      titleStr = "weighted " + titleStr;
    JFreeChart chart = new JFreeChart(titleStr, TextTitle.DEFAULT_FONT,
        plot, false);
View Full Code Here

//TODO da rifare
public class XYChart {

    public XYChart(SpedizioneCriteria criteria) {

        SpiderWebPlot spiderwebplot = valorizzaDataset();
        chart = new JFreeChart(null, null, spiderwebplot, false);
    }
View Full Code Here

        chart = new JFreeChart(null, null, spiderwebplot, false);
    }

    public XYChart(Dataset dataset) {

        SpiderWebPlot spiderwebplot = valorizzaDataset(dataset);
        chart = new JFreeChart(null, null, spiderwebplot, false);
    }
View Full Code Here

    private SpiderWebPlot valorizzaDataset(Dataset dataset) {

        DefaultCategoryDataset defaultcategorydataset = (DefaultCategoryDataset) dataset;

        SpiderWebPlot spiderwebplot = new SpiderWebPlot(defaultcategorydataset);
        spiderwebplot.setInteriorGap(0.40000000000000002D);
        return spiderwebplot;
    }
View Full Code Here

TOP

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

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.