Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
YUI Charts   Message List  
Reply | Forward Message #38866 of 52114 |
Re: Charts No Y series JSON Data

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
>





Tue Oct 7, 2008 5:35 pm

tripp.bridges
Offline Offline
Send Email Send Email

Forward
Message #38866 of 52114 |
Expand Messages Author Sort by Date

I have some stats calling data externally via data polling. It was working on all browsers a week ago. Now FireFox and Opera it doesn't work. Specifically, I...
jrbramble
Online Now Send Email
May 9, 2008
8:42 pm

The charts themselves, even the Flash part, never interact with XMLHttpRequest directly. Something must be going wrong at the DataSource or Connection Manager...
Josh Tynjala
joshtynjala
Offline Send Email
May 9, 2008
10:35 pm

Thanks Josh. I'll be working on it on Monday. The weird thing is it works in IE and Safari, but not in FireFox and Opera....
jrbramble
Online Now Send Email
May 10, 2008
4:09 am

I have 6 charts up and running so far. I'm working on customizing the data tip. When I make changes to the data tip function it doesn't update to the chart....
jrbramble
Online Now Send Email
May 27, 2008
9:18 pm

Hi Jason, You will not need separate swf instances but I will need some more information to help you further. Please send me some sample code and I'll help...
tripp.bridges
Offline Send Email
May 30, 2008
9:52 pm

Hi, I am trying to build an logarithmic X axis and well, I am completely lost as the code probably shows. What I have is the size on the X axis, that should...
Jordi Boggiano
j.boggiano@...
Send Email
Oct 1, 2008
2:41 pm

Hi, Your problem is in your data array. You have string values defined. Change to this: var siebkurve = [ { size: 0.315, value: 97}, { size: 0.200, value: 6}, ...
tripp.bridges
Offline Send Email
Oct 1, 2008
11:28 pm

Hi: I'm having a devil of a time with charts. First: I couldn't see the YUI Examples in FireFox 3.0. When I tried to download the latest version of FlashPlayer...
Ken Loomis
kloomis@...
Send Email
Oct 2, 2008
4:11 am

Hi, Charts display properly in FF3 with Flash 9.0.124.0. You might have had a corrupt install. If you upgrade your version it should still work. If not, you...
tripp.bridges
Offline Send Email
Oct 2, 2008
3:56 pm

Tripp: Thank you VERY much for your reply. Please see my comments/questions in line: ... Yup. I did some more installs (there's a separate version for FF?)...
Ken Loomis
kloomis@...
Send Email
Oct 3, 2008
2:31 pm

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. ...
tripp.bridges
Offline Send Email
Oct 5, 2008
5:56 pm

... 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...
Ken Loomis
kloomis@...
Send Email
Oct 6, 2008
4:32 pm

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. ...
tripp.bridges
Offline Send Email
Oct 7, 2008
5:35 pm

... Sweet! Now I just need to get the minor grid lines working and I'll be all set. Thanks, Tripp. Ken...
Ken Loomis
kloomis@...
Send Email
Oct 8, 2008
10:41 pm

... Thank you, works fine. I just have one small problem, but I am not sure whether it's possible to fix this. I would like to have my LineChart draw lines not...
Jordi Boggiano
j.boggiano@...
Send Email
Oct 2, 2008
8:37 am

Hi, There currently is not an option for curved lines in YUI Charts. It has been requested before and will be considered for a future enhancement. Thanks, ...
tripp.bridges
Offline Send Email
Oct 2, 2008
2:43 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help