##############
# Plot Chart #
##############
#chart = ChartFactory.createLineChart(None,'Slide','% Brown Area',dataset,PlotOrientation.VERTICAL,False,True,False)
chart = ChartFactory.createBarChart("% Brown Area per Slide", 'Slide', '% Brown Area', dataset, PlotOrientation.VERTICAL, False,True,False)
# set the background color for the chart...
chart.setBackgroundPaint(Color.WHITE)

plot = chart.getPlot()
plot.setBackgroundPaint(Color.WHITE)
plot.setRangeGridlinesVisible(False)
plot.setAxisOffset(RectangleInsets.ZERO_INSETS)

#customise the range axis...
rangeAxis = plot.getRangeAxis()
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits())
rangeAxis.setAutoRangeIncludesZero(True)
#Set the Min Max value of the y axis
rangeAxis.setRange(0, 100)
#Create a custom BarRenderer
barRenderer = BarRenderer()
#Add a label in the middle of the histogram bar showing the % value
barRenderer.setBaseItemLabelGenerator(StandardCategoryItemLabelGenerator())
barRenderer.setBaseItemLabelsVisible(True)
#For parameters
#See http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/labels/ItemLabelAnchor.html
#See http://www.jfree.org/jcommon/api/org/jfree/ui/TextAnchor.html and 
itemlabelposition = ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_CENTER, TextAnchor.BOTTOM_CENTER, 0.00)
barRenderer.setBasePositiveItemLabelPosition(itemlabelposition)
#Customize the bar's color so they will be gray with a black outline and no shadow
barRenderer.setBarPainter(StandardBarPainter())#Use StandardBarPainter to avoid the color gradient inside the bar