Jump to content
Changes to the Jaspersoft community edition download ×

Chart height increase dynamically

2006 IR Open Dicussion

Recommended Posts

By: Lal V K - lalnec

Chart height increase dynamically

2006-03-03 02:59

Dear Experts,

I would like to place different kind of Charts(6 nos of Timeseries chart and bar charts)in the summary report.My problem is my chart is not expanding as the height of the data.I have setted the common properties (stretch type),but the chart is height is too small.

Can anybody help me to exapand the chart dynmaically based on the data.

Very urgent.Kindly help me.





By: Dane L - danelav

RE: Chart height increase dynamically

2006-03-03 12:48

I'm adding my vote to request an answer here. I am trying to create a horizontal bar chart that will extend vertically to hold any number of bars. I would love to hear anyone's solution, be it elegent or a hack.









By: Giulio Toffoli - gt78

RE: Chart height increase dynamically

2006-03-03 13:19

Ok, I have the hack...


Put your chart in a band (i.e. detail).

Add a textelement on the left of your chart.

The expression of the text element will be:



Create a variable like that:


Calc: SUM

Type: String

Expression: " n"


Your variable will be a set of spaces and new lines (a new line for each record). You can set the height of each line setting the font size. In this way you have an element that grown proportionally to the number of records.


select the chart an the textfield and "group" them.


set Stretch type of the chart RelativeToTollsetObject.


Let me know if this works. I have nor tryed it.












By: Dane L - danelav

RE: Chart height increase dynamically

2006-03-03 15:37

Thank you so much! I guess I'll finally have to upgrade from 0.4.1 so that I can try out the element grouping.


Also, I have one more related question. I tried the variable you suggested (SUM, String, "n") but it only ever returned a single "n". However, when I changed it to (SUM, Integer, new Integer(1)) it would return the total sum of the rows: 7, which was the correct number. Is there anything I need to add or change in order for the SUM to work correctly on strings?


Thanks again,







By: Giulio Toffoli - gt78

RE: Chart height increase dynamically

2006-03-03 16:34

Try this expression with calculation type: none





Anyway perhaps a trim() reducesthe string to a single new line. Try instead an expression like:

"_n" and set the fore color to white (or to the same color of the background in order to hide the text...".

Another solution could be use the formula $V{RECORDS_LINES} + " n" in the variable, but you have to change your textfield expression in something like:


"_" + $V{RECORDS_LINES} + "_" sot the rendered test is no longer trimmed.








By: Lal V K - lalnec

RE: Chart height increase dynamically

2006-03-03 22:34

Dear Giulio,


Thanks for your reply.I have tried your suggestions,but it is not working as per the requirement.I have to accommodate 6 different chart in the band,so that I am not expanding the chart while placing the chart inside the band.During run time the 6 different charts are comming with too small size (height of the chart).Is it anyway to accomodate all charts inside a single band and expand the height during runtime.Pls help me.





By: temakela - temakela00

RE: Chart height increase dynamically

2006-03-23 01:25

Did you get this actually working? So, when I have a chart with horizantal barsa and the nubmer of bars may vary - how to dynamically change the height of the chart according to the number of bars?


I tried to follow instuctions in this thread but without success.

Link to comment
Share on other sites

  • 4 years 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...