@Override public void drawItem(Graphics2D g2,CategoryItemRendererState state,Rectangle2D dataArea,CategoryPlot plot,CategoryAxis domainAxis,ValueAxis rangeAxis,CategoryDataset dataset,int row,int column,int pass){
  if (!getItemVisible(row,column)) {
    return;
  }
  int visibleRow=state.getVisibleSeriesIndex(row);
  if (visibleRow < 0) {
    return;
  }
  int visibleRowCount=state.getVisibleSeriesCount();
  PlotOrientation orientation=plot.getOrientation();
  MultiValueCategoryDataset d=(MultiValueCategoryDataset)dataset;
  List values=d.getValues(row,column);
  if (values == null) {
    return;
  }
  int valueCount=values.size();
  for (int i=0; i < valueCount; i++) {
    double x1;
    if (this.useSeriesOffset) {
      x1=domainAxis.getCategorySeriesMiddle(column,dataset.getColumnCount(),visibleRow,visibleRowCount,this.itemMargin,dataArea,plot.getDomainAxisEdge());
    }
 else {
      x1=domainAxis.getCategoryMiddle(column,getColumnCount(),dataArea,plot.getDomainAxisEdge());
    }
    Number n=(Number)values.get(i);
    double value=n.doubleValue();
    double y1=rangeAxis.valueToJava2D(value,dataArea,plot.getRangeAxisEdge());
    Shape shape=getItemShape(row,column);
    if (orientation == PlotOrientation.HORIZONTAL) {
      shape=ShapeUtilities.createTranslatedShape(shape,y1,x1);
    }
 else     if (orientation == PlotOrientation.VERTICAL) {
      shape=ShapeUtilities.createTranslatedShape(shape,x1,y1);
    }
    if (getItemShapeFilled(row,column)) {
      if (this.useFillPaint) {
        g2.setPaint(getItemFillPaint(row,column));
      }
 else {
        g2.setPaint(getItemPaint(row,column));
      }
      g2.fill(shape);
    }
    if (this.drawOutlines) {
      if (this.useOutlinePaint) {
        g2.setPaint(getItemOutlinePaint(row,column));
      }
 else {
        g2.setPaint(getItemPaint(row,column));
      }
      g2.setStroke(getItemOutlineStroke(row,column));
      g2.draw(shape);
    }
  }
}

@ Override public void drawItem ( Graphics2D g2 , CategoryItemRendererState state , Rectangle2D dataArea , CategoryPlot plot , CategoryAxis domainAxis , ValueAxis rangeAxis , CategoryDataset dataset , int row , int column , int pass ) { if ( ! getItemVisible ( row , column ) ) { return ; } int visibleRow = state . getVisibleSeriesIndex ( row ) ; if ( visibleRow < 0 ) { return ; } int visibleRowCount = state . getVisibleSeriesCount ( ) ; PlotOrientation orientation = plot . getOrientation ( ) ; MultiValueCategoryDataset d = ( MultiValueCategoryDataset ) dataset ; List values = d . getValues ( row , column ) ; if ( values == null ) { return ; } int valueCount = values . size ( ) ; for ( int i = 0 ; i < valueCount ; i ++ ) { double x1 ; if ( this . useSeriesOffset ) { x1 = domainAxis . getCategorySeriesMiddle ( column , dataset . getColumnCount ( ) , visibleRow , visibleRowCount , this . itemMargin , dataArea , plot . getDomainAxisEdge ( ) ) ; } else { x1 = domainAxis . getCategoryMiddle ( column , getColumnCount ( ) , dataArea , plot . getDomainAxisEdge ( ) ) ; } Number n = ( Number ) values . get ( i ) ; double value = n . doubleValue ( ) ; double y1 = rangeAxis . valueToJava2D ( value , dataArea , plot . getRangeAxisEdge ( ) ) ; Shape shape = getItemShape ( row , column ) ; if ( orientation == PlotOrientation . HORIZONTAL ) { shape = ShapeUtilities . createTranslatedShape ( shape , y1 , x1 ) ; } else if ( orientation == PlotOrientation . VERTICAL ) { shape = ShapeUtilities . createTranslatedShape ( shape , x1 , y1 ) ; } if ( getItemShapeFilled ( row , column ) ) { if ( this . useFillPaint ) { g2 . setPaint ( getItemFillPaint ( row , column ) ) ; } else { g2 . setPaint ( getItemPaint ( row , column ) ) ; } g2 . fill ( shape ) ; } if ( this . drawOutlines ) { if ( this . useOutlinePaint ) { g2 . setPaint ( getItemOutlinePaint ( row , column ) ) ; } else { g2 . setPaint ( getItemPaint ( row , column ) ) ; } g2 . setStroke ( getItemOutlineStroke ( row , column ) ) ; g2 . draw ( shape ) ; } } }
draw a single data item .
