mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
svg.js: display date in the value div instead of hour for a year-plot
git-svn-id: https://svn.fhem.de/fhem/trunk@7711 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
944a92d10b
commit
10150c52c5
@ -4,6 +4,7 @@ var svg_b64 ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|||||||
var svg_initialized={};
|
var svg_initialized={};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Base64 encode the xy points (12 bit x, 12 bit y).
|
// Base64 encode the xy points (12 bit x, 12 bit y).
|
||||||
function
|
function
|
||||||
svg_compressPoints(pointList)
|
svg_compressPoints(pointList)
|
||||||
@ -177,6 +178,8 @@ sv_menu(evt, embed)
|
|||||||
|
|
||||||
}, embed);
|
}, embed);
|
||||||
|
|
||||||
|
function pad0(v) { return (v < 10 ? '0'+v :v); }
|
||||||
|
|
||||||
function
|
function
|
||||||
mousemove(e)
|
mousemove(e)
|
||||||
{
|
{
|
||||||
@ -195,9 +198,14 @@ sv_menu(evt, embed)
|
|||||||
|
|
||||||
var y = (((par.y_h-yRaw)/par.y_mul)+par.y_min).toFixed(par.decimals);
|
var y = (((par.y_h-yRaw)/par.y_mul)+par.y_min).toFixed(par.decimals);
|
||||||
|
|
||||||
var d = new Date((((xRaw-par.x_min)/par.x_mul)+par.x_off) * 1000);
|
var d = new Date((((xRaw-par.x_min)/par.x_mul)+par.x_off) * 1000), ts;
|
||||||
var ts = (d.getHours() < 10 ? '0' : '') + d.getHours() + ":"+
|
if(par.x_mul < 0.0001) { // Year
|
||||||
(d.getMinutes() < 10 ? '0' : '') + d.getMinutes();
|
ts = (d.getMonth()+1)+"."+pad0(d.getDate());
|
||||||
|
} else if(par.x_mul < 0.001) { // Month
|
||||||
|
ts = d.getDate()+". "+pad0(d.getHours())+":"+pad0(d.getMinutes());
|
||||||
|
} else {
|
||||||
|
ts = pad0(d.getHours())+":"+pad0(d.getMinutes());
|
||||||
|
}
|
||||||
|
|
||||||
$(par.circle).attr("cx", xRaw).attr("cy", yRaw);
|
$(par.circle).attr("cx", xRaw).attr("cy", yRaw);
|
||||||
var yd = Math.floor((yRaw+par.divoffY) / 20)*20;
|
var yd = Math.floor((yRaw+par.divoffY) / 20)*20;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user