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 :)
1 Answer:
Posted on August 25, 2010 at 5:49am
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> |