Dynamic mode (OPAQUE/TRANSPARENT) in customizer

Hi, 

I have a customizer which works well, I already use it to remove axis and other things when the chart has no data (I have to display pages even if the datasets I use to fill charts return no data).

Now I want to swith the chart mode from opaque to transparent to reveal a text  "NO DATA" beneath.

the code I use is " jasperChart.setMode(ModeEnum.TRANSPARENT);"  I print the ligne after "System.out.println(jasperChart.getModeValue());" for debug.

I always get "OPAQUE" in logs  and yet the chart is still opaque ;).

Any idea ?

thanks :)

 

 

thanatonaute's picture
Joined: Oct 5 2009 - 11:52am
Last seen: 13 years 12 months ago

1 Answer:

I figured out how to print a message on graphs when there is no data :

using the plot function "setNoDataMessage" ;)

Code:
CategoryPlot plot = (CategoryPlot) chart.getPlot();
 
plot.setNoDataMessageFont(new Font("SansSerif", Font.BOLD,20));
plot.setNoDataMessagePaint(Color.RED);
plot.setNoDataMessage("Il n'y a pas de résultats correspondant à votre requête");</td></tr></tbody></table>
thanatonaute's picture
Joined: Oct 5 2009 - 11:52am
Last seen: 13 years 12 months ago
Feedback
randomness