Create a Bar Chart from a list/array


I have a variable of type List (ArrayList in fact) that contains numbers. How can I plot that numbers in a Bar Chart? What should I enter in Series Category Expression?

Complete story:

I'm using an XML datasource. One of its fields is:


So I've created a variable with those values splitted like this:

<variable name="arraylist" class="java.util.List">

Now I want to plot the values in a Bar Chart but... what should I write here?

The list of values will always have 20 values (size=20), if that simplifies the problem.

TheBronx's picture
Joined: Apr 12 2013 - 12:09am
Last seen: 7 years 8 months ago

1 Answer:


You could create a subdataset that has a field called _THIS, use the subdataset for the chart with new$V{arraylist}), and set $F{_THIS} as category and value expressions.



lucianc's picture
Joined: Jul 17 2006 - 1:10am
Last seen: 1 day 14 hours ago

DId it work for yu ? if so can u please share ur jrxml here as I am stuck in same kind of scenario

ruchiagraw - 6 years 5 months ago