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

Jasper report bar charts with list


ajpcm1

Recommended Posts

I'm trying to do a report in Jasper and I want a bar chart. As parameter I have an object that contains a list of objects (label/value) that I want to do the chart. The problem is I don't know how I plot the chart with this list. For example:

I have the following object: 

public class ChartField {    private String name;    private double value;    public ChartField(String name, double value) {        this.name = name;        this.value = value;    }    public String getName() {        return name;    }    public void setName(String name) {        this.name = name;    }    public double getValue() {        return value;    }    public void setValue(double value) {        this.value = value;    }}[/code]

and

public class Person{   private String name;   private List<ChartField> chart;  public String getName(){    return name;  }  public List<ChartField> getChart(){    return chart;  }}[/code]

So for jasper I pass as datasource a list of Person.

The ideia is to each person I want to plot a bar chart with the list of ChartFields.

Can anyone advice me how to do this? Thanks

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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...