Yes, but parseInt() takes two inputs, the number and the radix (base). The radix for typical numbers is 10 as they are base 10. Hex would be base 16.
http://www.w3schools.com/jsref/jsref_parseInt.asp Sincerely, Joseph On Thu, Apr 9, 2009 at 5:32 AM, sh al <[email protected]> wrote: > Joseph > > do u mean like this ?? > > data.setValue(parseInt(x,<%=counter%>),parseInt(y, > 0),<%=db.rs.getString(3)%>); > data.setValue(parseInt(x,<%=counter%>),parseInt(y,1),parseInt( > <%=db.rs.getFloat(1)%>)); > data.setValue(parseInt(x,<%=counter%>), parseInt(y,2), > parseInt(<%=db.rs.getFloat(2)%>)); > <%counter++; > > > > > On Thu, Apr 9, 2009 at 2:20 AM, Joseph R Lust <[email protected]>wrote: > >> One thing I found when doing this is you must cast the values into ints >> first. ASP (which I disdain by must work with) is likely rending your values >> to just strings. The following worked for me when reading JSON from mySQL. >> >> For instance >> >> dtbl.AddRow(x,y) >> >> Must be >> >> dtbl.AddRow(parseInt(x,10),parseInt(y,10)); >> >> Or you can build JS eval() statements too. >> Hope that helps. >> >> >> Sincerely, >> >> >> Joseph >> >> >> ~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* >> Joseph R Lust >> Massachusetts General Hospital >> Division of Surgical Oncology >> Health Communications Technology >> Warren Bldg., 4th Floor >> 55 Fruit Street >> Boston, MA 02114 >> 617-726-4174 >> >> >> >> On Wed, Apr 8, 2009 at 4:58 PM, sh al <[email protected]> wrote: >> >>> i tried to applied data from mysql to Line chat, but there are no values >>> any one can help??? >>> >>> >>> >>> >>> *google*.*load*( >>> "visualization", "1", { >>> >>> packages : [ >>> "imagelinechart" ] >>> >>> }); >>> >>> *google*.setOnLoadCallback(*drawChart*); >>> >>> *function* drawChart() { >>> >>> *var* data = *new* google.visualization.DataTable(); >>> >>> data.addColumn( >>> 'string', 'month'); >>> >>> data.addColumn( >>> 'number', 'Temperature'); >>> >>> data.addColumn( >>> 'number', 'Humidity'); >>> >>> <%*int* counter = 0; >>> >>> *try* {%> >>> >>> <%*while* (db.rs.next()) {%> >>> >>> data.setValue( >>> <%=counter%>, 0,<%=db.rs.getInt(6)%>+""); // Row 0, column 0 >>> >>> data.setValue( >>> <%=counter%>, 1, <%=db.rs.getFloat(1)%>); >>> >>> data.setValue( >>> <%=counter%>, 2, <%=db.rs.getFloat(2)%>); >>> >>> <%counter++; >>> >>> } >>> >>> } >>> *catch* (Exception e) { >>> >>> } >>> %> >>> >>> >>> On 4/7/09, Doomsday <[email protected]> wrote: >>>> >>>> >>>> Sorry VizBoy but I wasn't very clear on what I wanted. I posted before >>>> thinking... >>>> I don't think you can do this as I can not see an option for it in the >>>> api. >>>> My x-axis labels for each point are getting very cluttered in my chart >>>> line. >>>> Is there a way that I can display a label on the x-axis on every nth >>>> point. >>>> So for example only display a date on every 4th point on the x-axis. >>>> I can hack it by only populating every forth row -> cell 1. But then >>>> of course I do not get the date in my tooltip for these rows. >>>> >>>> Thanks. >>>> >>>> >>>> On Apr 5, 2:33 am, VizBoy <[email protected]> wrote: >>>> > If you are talking about a linechart then the x-axis is simply labels, >>>> i.e., >>>> > they shouldn't be dates, but rather string values. You can put just >>>> "01" and >>>> > "08" in them and no need to put the entire date there.. >>>> > >>>> > I hope this helps. >>>> > If not, please clarify/elaborate and i'll try to fruther assist you. >>>> > >>>> > - VizBoy. >>>> > >>>> > On Thu, Apr 2, 2009 at 8:02 AM, Doomsday <[email protected]> >>>> wrote: >>>> > >>>> > > Hi all, >>>> > > Ok so I want to make a line chart. The x-axis represents time, for >>>> > > example weeks. >>>> > >>>> > > Along the x-axis you would have: >>>> > > 01/Jan/2009 >>>> > > 08/Jan/2009 >>>> > > 15/Jan/2009 >>>> > > 22/Jan/2009 >>>> > >>>> > > This begins to look really cluttered. Is there a way that I can get >>>> it >>>> > > to only display the start of each month. >>>> > >>>> > > Is this something that I should implement in my dataTable by only >>>> > > populating every forth row with a generic month date? >>>> > >>>> > > I did have a look at the annotated timeline chart but it looks like >>>> > > overkill for what I want... >>>> > >>>> > > For those familiar with google analytics I want to reproduce >>>> something >>>> > > similar to their charts. >>>> > >>>> > > Any suggestions would be appreciated. >>>> > > Thanks. >>>> >>>> >>> >>> >>> >> >> >> > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en -~----------~----~----~----~------~----~------~--~---
