0 Replies Latest reply on Dec 31, 2006 12:33 AM by sf_dougco

    labelFunction gets error due to argument count

    sf_dougco
      I am using charts with the linechart and DateTimeAxis. When I pass the date object to the labelFunction the Flash application will hang when run and when I debug I get:


      quote:

      ArgumentError: Error #1063: Argument count mismatch on totvGraph/myDateLabel(). Expected 4, got 3.
      at mx.charts::DateTimeAxis/mx.charts:DateTimeAxis::buildLabelCache()[C:\dev\GMC\sdk\framewor ks\mx\charts\DateTimeAxis.as:1387]
      at mx.charts.chartClasses::NumericAxis/getLabelEstimate()[C:\dev\GMC\sdk\frameworks\mx\chart s\chartClasses\NumericAxis.as:626]
      at mx.charts::AxisRenderer/mx.charts:AxisRenderer::measureLabels()[C:\dev\GMC\sdk\frameworks \mx\charts\AxisRenderer.as:1588]
      at mx.charts::AxisRenderer/mx.charts:AxisRenderer::calcRotationAndSpacing()[C:\dev\GMC\sdk\f rameworks\mx\charts\AxisRenderer.as:1317]
      at mx.charts::AxisRenderer/adjustGutters()[C:\dev\GMC\sdk\frameworks\mx\charts\AxisRenderer. as:1188]
      at mx.charts.chartClasses::CartesianChart/mx.charts.chartClasses:CartesianChart::updateAxisL ayout()[C:\dev\GMC\sdk\frameworks\mx\charts\chartClasses\CartesianChart.as:1317]
      at mx.charts.chartClasses::CartesianChart/mx.charts.chartClasses:CartesianChart::updateDispl ayList()[C:\dev\GMC\sdk\frameworks\mx\charts\chartClasses\CartesianChart.as:963]
      at mx.core::UIComponent/validateDisplayList()[C:\dev\GMC\sdk\frameworks\mx\core\UIComponent. as:5672]
      at mx.managers::LayoutManager/mx.managers:LayoutManager::validateDisplayList()[C:\dev\GMC\sd k\frameworks\mx\managers\LayoutManager.as:594]
      at mx.managers::LayoutManager/mx.managers:LayoutManager::doPhasedInstantiation()[C:\dev\GMC\ sdk\frameworks\mx\managers\LayoutManager.as:646]
      at Function/ http://adobe.com/AS3/2006/builtin::apply()
      at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher2()[C:\dev\GMC\sdk\framework s\mx\core\UIComponent.as:7789]
      at mx.core::UIComponent/mx.core:UIComponent::callLaterDispatcher()[C:\dev\GMC\sdk\frameworks \mx\core\UIComponent.as:7732]


      And the code is:

      quote:

      public function myDateLabel(curlbl:Object, prevlbl:Object, axis:DateTimeAxis, ref:Object):String {
      return "2006";
      }



      I can fix the problem, however, by removing the "axis:DateTimeAxis" argument. Of course, the Flex docs show all 4 args as required for the function, so this is odd.

      Any ideas/input as to whether this is a documentation bug or in the builder?

      thanks