Fix potenziometer bar. Enable autoscale for y axis.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 18 Oct 2011 09:28:36 +0000 (09:28 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 18 Oct 2011 09:28:36 +0000 (09:28 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5167 38d2e660-2303-0410-9eaa-f027e97ec537

boards/sam3x-ek/examples/sam3x-ek_http_server/sd_data/index.htm

index 5879008abe0b040491714f7ba02fea79dabc5ccc..0d52c0c177f64e8b740cd9ecf4143e31c2885d09 100644 (file)
                                          dataType :'json',
                                          success: function(data){
 
-                                                $('#potentiometer').width(200*(parseInt(data['volt'])/4096));
+                                                $('#potentiometer').width(200*(parseInt(data['volt'])/4095));
                                                 $('#uptime').text(data['up_time'] +' sec');
                                                 $('#temperature').text(data['temp']+' °C');
                                                 temperature_data.push([data['up_time'],data['temp']]);
 
-                                                var o = plot_temperature.getAxes().xaxis.options;
-                                                o.max = Math.max(25,data['up_time']);
-                                                o.min = Math.max(0,(o.max - 25));
+                                                var x = plot_temperature.getAxes().xaxis.options;
+                                                var y = plot_temperature.getAxes().yaxis.options;
+                                                x.max = Math.max(25,data['up_time']);
+                                                x.min = Math.max(0,(x.max - 25));
+                                                y.autoscale = true;
                                                 plot_temperature.setData([temperature_data]);
                                                 plot_temperature.setupGrid();
                                                 plot_temperature.draw();