Menu

coloring bar chart

Anonymous
2003-10-24
2013-01-13
  • Anonymous

    Anonymous - 2003-10-24

    hi,
    i would like to put a specific color on one and only one bar of my bar chart which contains only one serie.  is it possible? i have found a lot of examples allowing to color a complete serie but this is not what i am trying to do.

    thanks a lot

     

     
    • Gvijayar

      Gvijayar - 2005-02-13

      You will have to extend the BarRenderer and use that class to modify the color of the bars.

       
    • Travis Reeder

      Travis Reeder - 2005-06-21

      How do you change the BarRenderrer?

       
    • BKA

      BKA - 2005-11-09

      public class ExtendedStackedXYBarRenderer extends StackedXYBarRenderer
      {
        /** Farben fr die Items */
        private Paint[][]         paintArray           = null;

        /** Sollen die Farben der einzelnen Items genutzt werden? */
        private boolean           isPaintArray         = false;

        public void setItemPaint(Paint paint, int row, int column)
        {
          this.paintArray[row][column] = paint;
        }

        public Paint getItemPaint(int row, int column)
        {
          Paint returnPaint = null;

          if (this.isPaintArray)
          {
            returnPaint = this.paintArray[row][column];
          }
          else
          {
            returnPaint = super.getItemPaint(row, column);
          }
          return returnPaint;
        }

      }

       

Log in to post a comment.