Jump to content

Charts in iReport


learner444

Recommended Posts

Can someone describe the Chart Properties Key Expression, Value Expression and Label Expression when using Pie Charts in iReport?

Also, describe the Chart Properties Series Expression, Category Expression and Value Expression when using Stacked Bar Charts.

Thanks,

Shankar

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Key Expression: is something that identifies a slice. In example if you are creating a chart showing the orders in some contries, it can be the country name. If can not be null or you'll get an exception. If there are two items with the same key, only the last value for the same key is used, and you'll get only one slice for that key.

Value Expression: is the value of the slice specified by the key expression. It's a Number.

Label Expression: is optional, if not specified, the key expression will be used as label

-----------------------

Series Expression: is optional. It is used to group columns. In example you can have a chart where you have several students, several classes, and you want to show the students performance. Each student will have a color, and he will appear in all the classes. Now the class is a Series, while the student is a category. If the series is not specified, you'll get a simple bar chart with all the columns of the same color, each column is identified by the category.

Category Expression: Identifies a column inside a series (like a key in the Pie chart).

Value Expression: is the value of a column specified by the series + category expression. It's a Number.

Label Expression: is optional, if not specified, the category and the series are used as label

See the attached pdf for some examples

Giulio

Link to comment
Share on other sites

  • 2 years later...

Hi Giulio,

Thanks for the below explanation and the charts example. It was very useful.

I'm trying to create a similar chart with more values, and the chart seems to show a maximum of only 2 bars.

 

I'm attaching the csv datasource file, pdf output and the expressions ive used. I'm not sure if ive missed any more configurations.

There are 10 rows in the csv, and i would like to see bars for all of them in the chart. Instead it shows only 7.

 

Any pointers would be useful.

Link to comment
Share on other sites

I've used the following expressions corresponding to the column names of the csv file,

 

Series Expression: $F{Series}

Category Expression : $F{Category}

Value Expression : new Integer(Integer.valueOf($F{Value}))

Display Value Expression : $F{Label}

Link to comment
Share on other sites

Hello.

 

I saw your PDF file and because I'm new to Jasper I would like to know, how it's possible to make a chart with tooltip, when you are over with a mouse....and how can I make a "mouse sensible" legend label, so that when you click on one label, the bar in the chart dissapears and appers again, when you click once more on a label of a legend??

Is this on PRO stuff or can I make it also in Community Editon of jasper?

 

Thanks,

Robi

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