Package net.sf.jasperreports.charts.fill

Examples of net.sf.jasperreports.charts.fill.JRFillChartAxis


   
    // Generate the main plot from the first axes specified.
    Iterator iter = jrPlot.getAxes().iterator();
    if (iter.hasNext())
    {
      JRFillChartAxis axis = (JRFillChartAxis)iter.next();
      JRFillChart fillChart = axis.getFillChart();
     
      //a JFreeChart object should be obtained first; the rendering type should be always "vector"
     

      jfreeChart = fillChart.evaluateChart(evaluation);
      // Override the plot from the first axis with the plot for the multi-axis
      // chart.
      //FIXME is the above comment true?
      //configureChart(jfreeChart, getPlot(), evaluation);
      mainPlot = jfreeChart.getPlot();
      ChartHyperlinkProvider axisHyperlinkProvider = fillChart.getHyperlinkProvider();

      if (mainPlot instanceof CategoryPlot)
      {
        CategoryPlot categoryPlot = (CategoryPlot) mainPlot;
        categoryPlot.setRangeAxisLocation(0, getChartAxisLocation(axis));
        if (axisHyperlinkProvider != null)
        {
          multiHyperlinkProvider.addHyperlinkProvider(categoryPlot.getDataset(),
              axisHyperlinkProvider);
        }
      }
      else if (mainPlot instanceof XYPlot)
      {
        XYPlot xyPlot = (XYPlot) mainPlot;
        xyPlot.setRangeAxisLocation(0, getChartAxisLocation(axis));
        if (axisHyperlinkProvider != null)
        {
          multiHyperlinkProvider.addHyperlinkProvider(xyPlot.getDataset(), axisHyperlinkProvider);
        }
      }
     }

    // Now handle all the extra axes, if any.
    int axisNumber = 0;
    while (iter.hasNext())
    {
      axisNumber++;
      JRFillChartAxis chartAxis = (JRFillChartAxis)iter.next();
      JRFillChart fillChart = chartAxis.getFillChart();
      JFreeChart axisChart = fillChart.evaluateChart(evaluation);
      ChartHyperlinkProvider axisHyperlinkProvider = fillChart.getHyperlinkProvider();

      // In JFreeChart to add a second chart type to an existing chart
      // you need to add an axis, a data series and a renderer.  To
View Full Code Here


  }


  public JRChartAxis getChartAxis(JRChartAxis axis)
  {
    JRFillChartAxis fillAxis = null;
    if (axis != null)
    {
      fillAxis = (JRFillChartAxis) get(axis);
      if (fillAxis == null)
      {
        fillAxis = new JRFillChartAxis(axis, this);
      }
    }
    return fillAxis;
  }
View Full Code Here

TOP

Related Classes of net.sf.jasperreports.charts.fill.JRFillChartAxis

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.