public BufferedImage drawBarGraphWithStdDev(String graphTitle,String xLabel,String yLabel,HashMap<ComparableLabel,Integer[]> barDataPoints,String[] barLabels,Long stdDevHigh,Long stdDevLow,Long graphMaxValue){
  BufferedImage bi=new BufferedImage(this.WIDTH,this.HEIGHT,BufferedImage.TYPE_INT_ARGB);
  Graphics2D g2d=bi.createGraphics();
  RenderingHints renderHints=new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g2d.setRenderingHints(renderHints);
  drawChartAndGraphRectangles(g2d);
  drawBarLegend(g2d,"Legend",barLabels,stdDevHigh,stdDevLow);
  drawTitleAndLabels(g2d,graphTitle,xLabel,yLabel);
  Collection<Integer[]> valueCollection=barDataPoints.values();
  Set<ComparableLabel> dateKeySet=barDataPoints.keySet();
  long maxValue=0;
  for (  Integer[] intArray : valueCollection) {
    for (    Integer intValue : intArray) {
      if (maxValue < intValue) {
        maxValue=intValue;
      }
    }
  }
  long yMaxMark=0;
  int yLabelXOffset=50;
  yMaxMark=determineYMaxMark(maxValue,stdDevHigh,graphMaxValue);
  drawYAxisDivisions(g2d,yMaxMark,yLabelXOffset);
  ArrayList<ComparableLabel> orderedDateSet=new ArrayList<ComparableLabel>();
  orderedDateSet.addAll(dateKeySet);
  Collections.sort(orderedDateSet);
  drawXAxisDivisions(g2d,orderedDateSet);
  drawBarsOnGraph(g2d,orderedDateSet,barDataPoints,yMaxMark);
  if (stdDevHigh != null) {
    drawStdDevLine(g2d,stdDevHigh,yMaxMark,this.stdDevHighColor);
  }
  if (stdDevLow != null) {
    drawStdDevLine(g2d,stdDevLow,yMaxMark,this.stdDevLowColor);
  }
  return bi;
}

public BufferedImage drawBarGraphWithStdDev ( String graphTitle , String xLabel , String yLabel , HashMap < ComparableLabel , Integer [ ] > barDataPoints , String [ ] barLabels , Long stdDevHigh , Long stdDevLow , Long graphMaxValue ) { BufferedImage bi = new BufferedImage ( this . WIDTH , this . HEIGHT , BufferedImage . TYPE_INT_ARGB ) ; Graphics2D g2d = bi . createGraphics ( ) ; RenderingHints renderHints = new RenderingHints ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_ON ) ; g2d . setRenderingHints ( renderHints ) ; drawChartAndGraphRectangles ( g2d ) ; drawBarLegend ( g2d , "Legend" , barLabels , stdDevHigh , stdDevLow ) ; drawTitleAndLabels ( g2d , graphTitle , xLabel , yLabel ) ; Collection < Integer [ ] > valueCollection = barDataPoints . values ( ) ; Set < ComparableLabel > dateKeySet = barDataPoints . keySet ( ) ; long maxValue = 0 ; for ( Integer [ ] intArray : valueCollection ) { for ( Integer intValue : intArray ) { if ( maxValue < intValue ) { maxValue = intValue ; } } } long yMaxMark = 0 ; int yLabelXOffset = 50 ; yMaxMark = determineYMaxMark ( maxValue , stdDevHigh , graphMaxValue ) ; drawYAxisDivisions ( g2d , yMaxMark , yLabelXOffset ) ; ArrayList < ComparableLabel > orderedDateSet = new ArrayList < ComparableLabel > ( ) ; orderedDateSet . addAll ( dateKeySet ) ; Collections . sort ( orderedDateSet ) ; drawXAxisDivisions ( g2d , orderedDateSet ) ; drawBarsOnGraph ( g2d , orderedDateSet , barDataPoints , yMaxMark ) ; if ( stdDevHigh != null ) { drawStdDevLine ( g2d , stdDevHigh , yMaxMark , this . stdDevHighColor ) ; } if ( stdDevLow != null ) { drawStdDevLine ( g2d , stdDevLow , yMaxMark , this . stdDevLowColor ) ; } return bi ; }
draws a line graph with the standard deviation high and low lines
