I am passing PHP session variables to a Google chart object. The following works fine:
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Descriptor', 'Items checked/Total number of items', { role: 'annotation' }],
['Attention', <?php echo $_SESSION["A"];?>, <?php echo $_SESSION["A"];?>],
['Auditory', <?php echo $_SESSION["AUD"];?>, <?php echo $_SESSION["AUD"];?>]
]);
Everything works fine when the $_SESSION["A"] variable is by itself, and will print an interger in the chart ie. 12. However, when I try to concatenate '/12' to the $_SESSION["A"] variable in hopes of echoing '12/12' in the chart, I end up getting '1' in the chart (it is doing the math on 12/12). Here is the faulty code:
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Descriptor', 'Items checked/Total number of items', { role: 'annotation' }],
['Attention', <?php echo $_SESSION["A"];?>, <?php echo $_SESSION["A"]."/12";?>],
['Auditory', <?php echo $_SESSION["AUD"];?>, <?php echo $_SESSION["AUD"]."/12";?>]
]);
How do I concatenate "/12" to an integer without it doing the math?