From 460d51dbd43759f769e9d77016d0e04046ff06c4 Mon Sep 17 00:00:00 2001 From: asterix Date: Tue, 18 Oct 2011 09:28:36 +0000 Subject: [PATCH] Fix potenziometer bar. Enable autoscale for y axis. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5167 38d2e660-2303-0410-9eaa-f027e97ec537 --- .../examples/sam3x-ek_http_server/sd_data/index.htm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/boards/sam3x-ek/examples/sam3x-ek_http_server/sd_data/index.htm b/boards/sam3x-ek/examples/sam3x-ek_http_server/sd_data/index.htm index 5879008a..0d52c0c1 100644 --- a/boards/sam3x-ek/examples/sam3x-ek_http_server/sd_data/index.htm +++ b/boards/sam3x-ek/examples/sam3x-ek_http_server/sd_data/index.htm @@ -82,14 +82,16 @@ 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(); -- 2.25.1