Jump to content

Jasper Report Chart manipulate labelExpression


parthbhagat

Recommended Posts

For Jasper Report 4.5

How can I access bar chart label expression? I have tried ChartCustomizer, we can access label via SeriesItemLabelGenerator. But when this generator executes, it does not have formula we have set on jrxml file for <labelExpression> field e.g. [barValue$ColorCode$]. I found that <labelExpression> are been executed in CategoryLabelGenerator class, which is JasperReport class.

What I want to achieve is I am passing color code from dataset along with bar value with format [barValue$ColorCode$]. I want to pick $ColorCode$ and get that value and then change label value to [barValue]. ColorCode will be used to assign bar color from ChartCustomizer. But thing is when I access labelExpression from StandardCategoryItemLabelGenerator or AbstractCategoryItemLabelGenerator then it does returns [barValue] from generateLabelString()and generateLabel() method.

Only intention is to use ColorCode passed from dataset. If we only pass ColorCode instead of [barValue$ColorCode$], then only report shows [barValue] only. I think that we can customize CategoryLabelGenerator class then it would solve my problem. But I don't know how can we customize CategoryLabelGenerator.

Any input/help achieving this goal is greatly appreciated.

Thank you.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

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