2 Replies Latest reply on Mar 26, 2009 7:06 AM by vikasn

    Labels not created by calling a function

    vikasn
      i m trying to create labels dynamically on each series in a Bar Chart.....
      canvas1.addDataChild(columnLabel,new CartesianCanvasValue(s, labelOffset),new CartesianCanvasValue(n, labelOffset));
      canvas is not adding a labels...
      any help/suggestion will be appreciated....
        • 1. Re: Labels not created by calling a function
          matthew horn Level 3
          The addDataChild method is expecting arguments in the following order:

          1 - the DisplayObject to add to the canvas
          2 - the left coordinate
          3 - the top coordinate

          The example you copied some of this from used a column chart, not a bar chart, so the coordinates should be reversed.

          Change this:
          canvas1.addDataChild(columnLabel,new CartesianCanvasValue(s, labelOffset),new CartesianCanvasValue(n, labelOffset));

          To this:
          canvas1.addDataChild(columnLabel,new CartesianCanvasValue(n, labelOffset),new CartesianCanvasValue(s, labelOffset));

          You might have to play with the layout of the labels a little more, but this should get you going in the right direction.

          hth,
          matt horn
          flex docs
          • 2. Re: Labels not created by calling a function
            vikasn Level 1
            thanks....now it is working!!!