1 Reply Latest reply on Oct 22, 2009 2:26 AM by Subeesh Arakkan

    Customising Flex Cloumn Chart

    Preetham Hegde Level 1

      Hi All,

       

      I have a requirement, where I should place a image on the top of Flex Cloumn Chart Bar depending on the data.

      Below i have attached a image, which will clearly explain my requirement.

      Please guide me to achieve this. I tried to insert image using labelFunction, but it didnt work bcos it will return only string.

      Untitled-1.png

       

      Thanks

      Preetham Hegde

        • 1. Re: Customising Flex Cloumn Chart
          Subeesh Arakkan Level 4

          You can use ItemRenderer for ColumnSeries. Try this basic renderer example.

          package
          {
          import mx.containers.Box;

          public class MyRenderer extends Box
          {
            public function MyRenderer()
            {
             super();
            }
           
            import mx.controls.Image;
           
            private var image:Image;
           
            override protected function createChildren():void
            {
             super.createChildren();
             image = new Image();
             image.source = "image.png";
             addChild(image);
            }
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            {
             image.height = 30;
             image.width = 30;
            
             image.move((unscaledWidth - image.width)/2,0);
             super.updateDisplayList(unscaledWidth, unscaledHeight);
             graphics.lineStyle(2,0x000000);
             graphics.beginFill(0x0000FF,0.5);
             graphics.drawRect(0,30,unscaledWidth,unscaledHeight);
             graphics.endFill();
            }
           
          }
          }