Thanks Dan!  I got it to work, and searched the manual on this one, and 
found nothing, so I'll test your skills on this one. First I might as well 
get past the generic starting point.

Same concept of single row data....except..

instead of the table names running horizontally, they run 
vertically.....can this be done?

The obvious reasons being one column vertical tables would be mobile 
friendly in that a user could simply scroll up and down, rather than have 
the table not fit the screen....

Ex.  Instead of this:

Header   |  col1     |   col2     |   col3     |   col4      |  col5     | 
 col6    |  col7     |   col8     |   col9     |
data       |  data1   |   data2   |   data3   |    data4   |  data5   | 
data6   |  data7   |   data8   |   data9   |


Get this:

  Header   |    data    |
  row1       |   data1   |
  row2       |   data2   |   
  row3       |   data3   |
  row4       |   data4   | 
  row5       |   data5   |  
  row6       |   data6   |
  row7       |   data7   |   
  row8       |   data8   | 
  row9       |   data9   |

 I tried the obvious of swapping the  col and row data but haven't been 
successful with it yet. I'm basically wondering if it is possible. I 
created individual blocks to stack, 

and at one point changed all the "c" data  to "r" thinking the c denoted 
column..oh my...I have not yet tried reversing v data and c data....dont 
want to waste the effort however...be right back...

$temp9[] = array('v' => [$ebitda]); 
$cols9[] = array(*'c*' => $temp9);


$table3 = array();
$table3['rows'] = array(array('label' => 'EPS', 'type' => 'number'));
$table3['cols'] =array();
$table4 = array();
$table4['rows'] = array(array('label' => 'EPS Est Yr', 'type' => 'number'));
$table4['cols'] =  array();
$table5 = array();
$table5['rows'] = array(array('label' => 'EPS Est Nxt Yr', 'type' => 
'number'));
$table5['cols'] =  array();
$table6 = array();
$table6['rows'] = array(array('label' => 'EPS Est Nxt Qtr', 'type' => 
'number'));
$table6['cols'] = array();
$table7 = array();
$table7['rows'] = array(array('label' => 'Revenue', 'type' => 'string'));
$table7['cols'] = array();
$table8 = array();
$table8['rows'] = array(array('label' => 'Book Value', 'type' => 'number'));
$table8['cols'] = array();
$table9 = array();
$table9['rows'] = array(array('label' => 'EBITDA', 'type' => 'number'));
$table9['cols'] = array();
$table10 = array();
$table10['rows'] = array(array('label' => 'PEG Ratio', 'type' => 
'number'));   
$table10['cols'] = array();
$table11 = array();
$table11['rows'] = array(array('label' => 'PE Ratio', 'type' => 'number'));
$table11['cols'] = array();
$table12 = array();
$table12['rows'] = array(array('label' => 'Market Capitalization', 'type' 
=> 'number')); 
$table12['cols'] = array();
$table13 = array();
$table13['rows'] = array(array('label' => 'Float Shares', 'type' => 
'number'));
$table13['cols'] = array();
$table14 = array();
$table14['rows'] = array(array('label' => 'Shares Outstanding', 'type' => 
'number'));
$table14['cols'] = array();
$table15 = array();
$table15['rows'] = array(array('label' => 'Pr/Sales', 'type' => 'number'));
$table15['cols'] = array();
$table16 = array();
$table16['rows'] = array(array('label' => 'Pr/Book', 'type' => 'number'));
$table16['cols'] = array();
$table17 = array();
$table17['rows'] = array(array('label' => 'Price/EPS Est Cur Yr', 'type' => 
'number'));
$table17['cols'] = array();
$table18 = array();
$table18['rows'] = array(array('label' => 'Price/EPS Est Nxt Yr', 'type' => 
'number'));
$table18['cols'] = array();
$table19 = array();
$table19['rows'] = array(array('label' => 'Short Ratio', 'type' => 
'number'));
$table19['cols'] = array();
$File ="myfile";
$Data = file_get_contents($File);
$Data = str_replace('%', '', $Data);
$Data = str_replace('\n', '', $Data);
$Data = str_replace('"', '', $Data);
$Data = str_replace('/', '', $Data);
$Datapcs= explode(',', $Data);
$eps1a = $DataRT3pcs[0];
$eps2b= $DataRT3pcs[1];
$eps3c = $DataRT3pcs[2];
$eps4d = $DataRT3pcs[3];
$revnuz = $DataRT3pcs[4];
$bookval = $DataRT3pcs[5];
$ebitda = $DataRT3pcs[6];
$pegrat = $DataRT3pcs[7];
$peratio = $DataRT3pcs[8];
$marcap = $DataRT3pcs[9];
$floatsh = $DataRT3pcs[10];
$shouts = $DataRT3pcs[11];
$prsls= $DataRT3pcs[12];
$prbook = $DataRT3pcs[13];
$prepscurr = $DataRT3pcs[14];
$prepsnxt = $DataRT3pcs[15];
$shratio= $DataRT3pcs[16];
$temp3[] = array('v' => [$eps1a]);
$cols3[] = array('c' => $temp3);
$temp4[] = array('v' => [$eps2b]);
$cols4[] = array('c' => $temp4);
$temp5[] = array('v' => [$eps3c]);
$cols5[] = array('c' => $temp5);
$temp6[] = array('v' => [$eps4d]);
$cols6[] = array('c' => $temp6);
$temp7[] = array('v' => [$revnuz]);
$cols7[] = array('c' => $temp7);
$temp8[] = array('v' => [$bookval]);
$cols8[] = array('c' => $temp8);
$temp9[] = array('v' => [$ebitda]); 
$cols9[] = array('c' => $temp9);
$temp10[] = array('v' => [$pegrat]);
$cols10[] = array('c' => $temp10);
$temp11[] = array('v' => [$peratio]);
$cols11[] = array('c' => $temp11);
$temp12[] = array('v' => [$marcap]);
$cols12[] = array('c' => $temp12);
$temp13[] = array('v' => [$floatsh]);
$cols13[] = array('c' => $temp13);
$temp14[] = array('v' => [$shouts]);
$cols14[] = array('c' => $temp14);
$temp15[] = array('v' => [$prsls]);
$cols15[] = array('c' => $temp15);
$temp16[] = array('v' => [$prbook]);
$cols16[] = array('c' => $temp16);
$temp17[] = array('v' => [$prepscurr]); 
$cols17[] = array('c' => $temp17);
$temp18[] = array('v' => [$prepsnxt]);
$cols18[] = array('c' => $temp18);
$temp19[] = array('v' => [$shratio]);



On Monday, July 6, 2015 at 8:21:30 AM UTC-4, Daniel LaLiberte wrote:
>
> Brandon,
>
> There is no reason I know of for a Table chart to fail to display a single 
> row of data.  Here is a simple example showing that it can be done using 
> your data: https://jsfiddle.net/dlaliberte/qv66nq92/2/
>
> To figure out what you are seeing, we can't do much with your PHP code 
> except make guesses about what might be happening.  It would be better if 
> you could look in your browser's javascript debugger and copy the script 
> code that is generated on your server side.  You might see the problem just 
> by doing that.
>
> Also note if there are any javascript errors displayed in the console.
>
>
> On Mon, Jul 6, 2015 at 5:38 AM, Brandon Matthews <[email protected] 
> <javascript:>> wrote:
>
>> I have an unusual dilemma, and I think the crux of my problem stems from 
>> having only a single table row of data. I've exhausted every possibility I 
>> can think of, and then some. Why only a single row of data? Well I want the 
>> data in the row to be uniform with the google charts and tables already in 
>> place. The particular row I'm trying to add, will showcase current market 
>> data, as opposed to the delayed data I produce already. I wanted to add a 
>> single column table across the top or down the sidebar to highlight things 
>> like "price', volume, up $, down$, etcetera.
>>
>> Now I can get the data, and I can convert it to JSON, and when I echo the 
>> json data, I instantly get the JSON formatted results I sought....
>>
>> Yet as soon as I attempt to put the google chart code in my header, my 
>> site goes into a tailspin. The page will no longer load, and inevitably 
>> results in a completely white screen...not even the page around the div 
>> being called, is shown....remove the chart /table codes, and the page loads 
>> instantly...I should add i have something to the tune of 40 charts and 
>> tables that do not do this, and the code is basically copy/paste at this 
>> point. The only difference that  I can see, is that the table I want has 
>> only one data row.
>>
>>
>>
>> $rtsql="SELECT 
>> `symbol`,`name`,`change`,`change_pct`,`lasttrade`,`volume`, `bid`, 
>> `ask`,`52wkhi`,`52wklw` FROM `realtimedata` WHERE `symbol` = '$query'";
>> $res= mysql_query($rtsql);
>> $table = array();
>> $table['cols'] = array(
>>     array('label' => 'Symbol', 'type' => 'string'),
>>     array('label' => 'Name', 'type' => 'string'),
>>     array('label' => 'Change', 'type' => 'number'),
>>     array('label' => 'Change Pct', 'type' => 'number'),
>>     array('label' => 'Last Trade', 'type' => 'number'), 
>>     array('label' => 'Volume', 'type' => 'number'), 
>>     array('label' => 'Bid', 'type' => 'number'), 
>>     array('label' => 'Ask', 'type' => 'number'), 
>>     array('label' => '52 Wk High', 'type' => 'number'),
>>     array('label' => '52 wk Low', 'type' => 'number')
>>     );
>> $table['rows'] =array();
>> while($rT=mysql_fetch_assoc($resdataRT)) {
>> $temp = array();
>> $temp[] = array('v' => $rT['symbol']);
>> $temp[] = array('v' => $rT['name']);
>> $temp[] = array('v' => (float) $rT['change']);
>>         $temp[] = array('v' => (float) $rT['change_pct']);
>>         $temp[] = array('v' => (float)$rT['lasttrade']); 
>> $temp[] = array('v' => $rT['volume']); 
>> $temp[] = array('v' => (float)$rT['bid']);
>> $temp[] = array('v' => (float)$rT['ask']);
>>   $temp[] = array('v' => (float)$rT['52wkhi']);
>> $temp[] = array('v' => (float)$rT['52wklw']);
>> $rows[] = array('c' => $temp);
>>    };
>> $table['rows'] = $rows;
>> $rtddata = json_encode($table);
>> echo $rtddata;
>>
>> Here are the results to be 'tabled'
>>
>> {"cols":[{"label":"Symbol","type":"string"},{"label":"Name","type":"string"},{"label":"Change","type":"number"},{"label":"Change
>>  
>> Pct","type":"number"},{"label":"Last 
>> Trade","type":"number"},{"label":"Volume","type":"number"},{"label":"Bid","type":"number"},{"label":"Ask","type":"number"},{"label":"52
>>  
>> Wk High","type":"number"},{"label":"52 wk 
>> Low","type":"number"}],"rows":[{"c":[{"v":"GOOG"},{"v":"Google 
>> Inc"},{"v":1.56},{"v":0.3},{"v":523.4},{"v":"1235913"},{"v":513.33},{"v":522},{"v":598.01},{"v":486.23}]}]}
>>
>>
>> <script type="text/javascript">
>>    if (window.location.pathname == "/rtdata/") { <?php 
>> if(is_page('rtdata')) { include("script.php");}?>
>>    google.load('visualization', '1', {packages: ['table']});
>>    google.setOnLoadCallback(drawTable);
>>    function drawTable() {
>>     var data = new google.visualization.DataTable(<?=$rtddata?>); 
>>     var table= new 
>> google.visualization.Table(document.getElementById('table_div'));
>>     table.draw(data);
>>     }
>> }
>>
>> of course div is on page.....it should simply produce a single line of 
>> dataq with a header...yet it simply crashes the entire system ..
>>
>> If I'm missing the obvious, I'd love to hear it because I am out of 
>> answers..Has anyone ever tried making a single row table?
>>
>> (also tried doing a single column, multi row version with same result as 
>> well as breaking the table into two separate tables in case a container 
>> size problem existed, and got the same result...even changed page names, 
>> removed the if location clauses, and deleted it all and started again, all 
>> to no avail)
>>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Visualization API" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> [email protected] <javascript:>   5CC, Cambridge MA
> [email protected] <javascript:> 9 Juniper Ridge Road, Acton MA
>  

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to