Hmm, I don't see it a problem. The core issue is here:

TypeError: Error #1006: value is not a function.
at mx.charts::DateTimeAxis/mapCache()[C:\Work\flex\dmv_automation
\projects\datavisualisation\src\mx\charts\DateTimeAxis.as:1403]

DateTimeAxis is trying to call something as a function when it's not
really a function. For example,

var foo:* = function():void { trace("I am a function"); };
var bar:* = "not a function";

// Will trace "I am a function"
foo();
// Will throw Error #1006
bar()

I think my charting version is different from yours since line 1403 does
not correspond to any function call (certainly not a function call of
anything passed in by the user), but the mapCache() method does
reference DateTimeAxis.parseFunction, and that's why I thought that
might be involved.

It looks like you're not setting that function, though, so I'm not sure
what the issue is. It could be another user-supplied function that's not
really a function. Are fullTimeLabelFunction and formatVertLabel really
functions? Any other properties you're setting on the axis object that
might not be Functions? If you've extracted the data visualization
source code
( http://blogs.adobe.com/flexdoc/2008/04/extracting_data_visualization.html ), 
can you tell us what's at line 1403 of DateTimeAxis in your version?

-- 
Maciek Sakrejda
Truviso, Inc.
http://www.truviso.com

-----Original Message-----
From: netdeep <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: [flexcoders] Re: appending to a dataprovider in actionscript
Date: Fri, 21 Nov 2008 18:35:21 -0000

Ok, I'm not sure what code you're looking for, so here is the function
which I believe is triggering the error. 
I've edited out as much as I could (things like display settings) to
trim it down and here is what remains:

public function makeDateChart(genericChart:CartesianChart,
genericLegend:Legend, chartPanel:ChartPanel, 
chart:ChartObject):void {

var axisList:ArrayCollection = chart.getAxisList();
var renderers:ArrayCollection = new ArrayCollection();
var seriesArray:ArrayCollection = new ArrayCollection();
var hAxis:DateTimeAxis = new DateTimeAxis(); 
// define each axis
for (var i:int=0; i<axisList.length; i++) {
var axis:AxisObject = axisList.getItemAt(i) as AxisObject;
if (axis.getID() == "x Axis") { 
var start:Date = axis.start;
var end:Date = axis.end; 
hAxis.labelFunction = fullTimeLabelFunction;
// more formating of the horizontal axis
var ar:AxisRenderer = new AxisRenderer();
ar.axis = hAxis;
ar.placement = "bottom";
genericChart.horizontalAxisRenderers = [ar];
genericChart.horizontalAxis = hAxis; 
}
else {
// Define vertical axis
var vAxis:LinearAxis = new LinearAxis(); 
vAxis.autoAdjust = true;
vAxis.baseAtZero = false;
genericChart.verticalAxis = vAxis;
vAxis.labelFunction = formatVertLabel;
vAxis.title = axis.title;
// more formatting of the axis
var axr:AxisRenderer = new AxisRenderer();
axr.axis = vAxis;

for (var j:int=0; j<axis.getSeriesList().length; j++) {
var ser:SeriesObject = axis.getSeriesList().getItemAt(j) as
SeriesObject;
// define series 
if (ser.getPlotType() == "Line") {
var lineSeries:LineSeries = new LineSeries();
BindingUtils.bindProperty(lineSeries, "dataProvider", ser, "pointList");

ser.pointList.addEventListener(CollectionEvent.COLLECTION_CHANGE,updateHandler);
lineSeries.verticalAxis = vAxis;
lineSeries.horizontalAxis = hAxis;
lineSeries.xField="point1";
lineSeries.yField="point2";
lineSeries.verticalAxis = vAxis;
seriesArray.addItem(lineSeries);
}
}
renderers.addItem(axr); 
}
}
genericChart.series = seriesArray.toArray().reverse();
genericChart.verticalAxisRenderers = renderers.toArray();
genericLegend.dataProvider = genericChart; 
chartPanel.horizontalScrollPolicy = "off";
chartPanel.addChild(genericChart);
if (chart.getShowLegend()) chartPanel.addChild(genericLegend);
}






 


Reply via email to