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

JRChartCustomizer


2004 IR Help

Recommended Posts

By: Celamus - celamus

JRChartCustomizer

2005-10-26 12:10

Hi -

 

Is it possible to access the data series values from within a JRChartCustomizer attached to a chart? For instance, in order to set the colors used in the chart based on the values being charted?

 

I can access the JRChart object, which in turn gives me a DataSet and Series, but I am unclear whether those objects can then be used to iterate over the data values themselves, and if so how to do it.

 

If anyone can point me in the direction of an example, I'd really appreciate it.

 

Thanks.

 

 

 

 

 

By: Michael McMahon - msquared

RE: JRChartCustomizer

2005-10-29 19:04

Your question is really not about Jasper, its about JFreeCharts.

Suggest you read the JFreeChart API on howto do these things.

 

Hint: create a BarRenderer and override getItemPaint(),

then within the JRChartCustomizer do something like

jasperChart.getPlot().getCategoryPlot().setRenderer(myCustomRenderer),

I may be missing a typecast in there

 

 

 

 

 

By: Michael McMahon - msquared

RE: JRChartCustomizer

2005-10-29 19:25

typo above, it should have been

 

chart.getPlot().getCategoryPlot().setRenderer(myCustomRenderer)

 

meaning you do this using the JFreeChart reference

 

 

 

 

 

By: Celamus - celamus

RE: JRChartCustomizer

2005-10-29 19:37

Michael -

 

Many thanks for the response. Not sure if I really explained properly what i'm trying to do. The customization I need to do is trivial - just changing a color on an otherwise standard chart - exactly like the bar chart color customization example code, but based on the value of a JR variable (which is also the single value in the series being charted).

 

So I was wondering if it was possible to see the values associated with the series e.g., from the JRChart object passed in to JRChartCustomizer? (Or even just directly to access the Jasper variables from within my JRChartCustomizer?)

 

Or are you saying that the only place to get visibility to that data is from within a custom renderer? (E.g., because the series haven't been populated yet at the point that JRChartCustomizer is called).

 

Apologies if I'm just not understanding properly where the boundaries lie between Jasper and JFreeCharts...

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