Hi Ken,
You could try writing your own number parsing function that does not
return 0 for null values and assigning it as the parser in your
responseSchema.
Below is a proof of concept using the existing logic of the
DataSource's number parser. You may need to write and test your own
function.
YAHOO.example.parseNumber = function ( oData )
{
//return null if the data will not parse as a number
if(isNaN(parseInt(oData))) return null;
//Convert to number
var number = oData * 1;
// Validate
if(YAHOO.lang.isNumber(number)) {
return number;
}
else {
return null;
}
return parseInt(oData);
}
graphDataSource.responseSchema =
{
resultsList: "Results",
fields: ["Week",
{key:"numTowers",parser:YAHOO.example.parseNumber},
{key:"numProjects",parser:YAHOO.example.parseNumber},
{key:"numSensors",parser:YAHOO.example.parseNumber}
]
};
Hope this helps.
Thanks,
Tripp
--- In ydn-javascript@yahoogroups.com, Ken Loomis <kloomis@...> wrote:
>
> tripp.bridges wrote:
> > Hi Ken,
> > The DataSource class has a built-in number parser that you can declare
> > when you set up your response schema. This will solve the issue.
> > http://developer.yahoo.com/yui/datasource/#parsers
> >
> Tripp:
>
> That worked well (enabling dynamic sizing of the cart), however it has
> introduced another problem.
> If the data is parsed as a number, the chart draws a line to and
creates
> a point for NULL data as zero. No point is created if the data is not
> parsed as a number (and this is the behavior I would like). Fiddling
> with the connectDiscontinuousPoints doesn't seem to solve the problem.
>
> Any ideas?
>
> Thanks,
>
> Ken
>