Legend Font Size in Reporting

How can I change the font size in a chart's legend in the reporting module in Vision?

At the very bottom of the chart options, there is a Scripting section. Enable it and click Edit Script.

image

Then, under the def configureChart(data, chart): you can enter something like this. Modify as needed and reference the URLs for more info.

	from java.awt import Font
	legend = chart.getLegend()	# http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/JFreeChart.html
	font = Font(Font.DIALOG, Font.PLAIN, 10)	# https://docs.oracle.com/javase/7/docs/api/java/awt/Font.html
	legend.setItemFont(font)	# http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/title/LegendTitle.html