Results 1 to 2 of 2

Thread: noob needs help

  1. #1
    chris666uk1 is offline Member
    Join Date
    Oct 2011
    Posts
    1
    Rep Power
    0

    Default noob needs help

    please could you help me i am using highcharts and cant get the dates to show at the bottom from mysql over 5 days please could some one help me with this

    thank you
    here is the chart

    database layout

    code

    Java Code:
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
           <head>
           <title>Daily Temperature 8 Conv</title>
              <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
              <script src="./js/highcharts.js" type="text/javascript"></script>
              <script type="text/javascript" src="js/theme-wsl.js"></script>
           </head>
           
              <div id="container" style="width: 800px; height: 400px; margin: 0 auto"></div>
                 <?php
                 $db = @mysql_connect("localhost", "8conv", "*******") or die("Connection Error: " . mysql_error());
                 mysql_select_db("tempmonitor") or die("Error connecting to db.");
    
                 $sql = "SELECT * FROM `8conv`";
                 $result = mysql_query($sql);
                 $data = array();
                 while ($row = mysql_fetch_array($result)) {
                    $temp1[] = (int)$row['temp1'];
    				$temp2[] = (int)$row['temp2'];
    				$time[] = $row['timestamp'];
                 }
                 $temp1 = json_encode($temp1);
    			 $temp2 = json_encode($temp2);
    			 $time = json_encode($time);
                 ?>
                 
                 
                 
                 <script type="text/javascript">
                 var chart = new Highcharts.Chart({
                      chart: {
                        renderTo: 'container'
                    },
    					title: {
    						text: 'Weekly Temperature',
    						x: -20 //center
    				},						
    				    subtitle: {
    						text: 'Source: 8 conveyor',
    						x: -20
    					},
    					tooltip: {
    						formatter: function() {
    				                return '<b>'+ this.series.name +'</b><br/>'+
    								this.x +': '+ this.y +' oC ';
    						}
    					},
    					xAxis: {
    	                        type: 'datetime',
                                tickPixelInterval: 150,
                                maxZoom: 20 * 1000
    					},
    					yAxis: {
    						title: {
    							text: 'Temperature ( oC )'
    						},
    					plotLines: [{
    							value: 0,
    							width: 1,
    							color: '#808080'
    						}]
    					},
                            series: [{
                            name: 'Temp 1',
                            data:<?php echo $temp1; ?>,
                       },
                       {
                            name: 'Temp 2',
                            data:<?php echo $temp2; ?>,
    	
                    }]
                 });
    			 
    			 
    			 
                 </script>
    	</head>
    				
    	</body>
    </html>
    thanks

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: noob needs help

    How does this have to do with Java programming? Could you be mixing up JavaScript with Java? You know that they are about as similar as ham is to hamster.

Similar Threads

  1. Noob here
    By Iron Lion in forum Introductions
    Replies: 1
    Last Post: 11-15-2010, 06:50 PM
  2. Noob Here
    By Salamander in forum Introductions
    Replies: 1
    Last Post: 08-03-2010, 09:19 AM
  3. Very noob, but need help!!!
    By Guilbertda in forum New To Java
    Replies: 2
    Last Post: 02-01-2010, 11:32 PM
  4. Help im a noob.. a super noob on java..
    By critdevil in forum New To Java
    Replies: 12
    Last Post: 03-07-2009, 04:17 AM
  5. Please help a noob :)
    By Bays in forum New To Java
    Replies: 15
    Last Post: 06-17-2008, 07:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •