Jump to content
We've recently updated our Privacy Statement, available here ×

Dynamic Jasper Report with the 3d graph Bar chart


pradeepvbe

Recommended Posts

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hello,

JR does no have this functionality, you will need to use JFreeChart along with JRs "Chart Customizers" Here is an example:

The Class:

package yourPackage;
 
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.LogarithmicAxis;
 
import net.sf.jasperreports.engine.JRAbstractChartCustomizer;
import net.sf.jasperreports.engine.JRChart;

public class MyChartCustomizerLogXAxis extends JRAbstractChartCustomizer

          JFreeChart chart;
 
         public void customize(JFreeChart chart, JRChart jrChart);

}

public void customize(JFreeChart chart, JRChart jrChart)


            final CategoryAxis categoryAxis = new CategoryAxis("Category");
            final ValueAxis valueAxis = new LogarithmicAxis("Percentage (%)");
            this.chart = chart;
 
            LogarithmicAxis logScale = new LogarithmicAxis("Percentage (%)");
     
            logScale.setStrictValuesFlag(false);
            logScale.setAutoTickUnitSelection(true);
            logScale.autoAdjustRange();
            chart.getCategoryPlot().setRangeAxis(logScale);
            categoryAxis.setUpperMargin(0.5);
        }

You will however need to customize this for your needs, hope it helps Enjoy!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...