0 Replies Latest reply on Oct 20, 2008 5:47 AM by RBKB

    Data label showing null value

    RBKB
      When I do following it sometimes shows null in the datalabel insidet the series of a barchart eg. "0.null" (the value is actually 0.06)

      private function setCustomLabel(element:ChartItem, series:Series):String {
      // Get a refereence to the current data element.
      var data:BarSeriesItem = BarSeriesItem(element);

      // Get a reference to the current series.
      var currentSeries:BarSeries = BarSeries(series);

      // Create a return String and format the number.
      return data.xNumber.toString()+" %";
      }

      And in the chart I have

      <mx:BarSeries color="black" labelFunction="setCustomLabel" labelPosition="inside" yField="Name" xField="Rank" />

      Why does it show null value? (this happens only sometimes), and any solution to this?

      Thanks