Widget:StatsGraph: Difference between revisions
Jump to navigation
Jump to search
m Fixed some variable names |
Removed logging |
||
Line 5: | Line 5: | ||
var oldY = (max-min) == 0 ? 0 : (300 / (max-min)) * (val - min); | var oldY = (max-min) == 0 ? 0 : (300 / (max-min)) * (val - min); | ||
if ( | if (degree == 0) { | ||
return [oldX, Math.floor(oldY)]; | return [oldX, Math.floor(oldY)]; | ||
} | } | ||
Line 35: | Line 35: | ||
svg.setAttribute('preserveAspectRatio', "none"); | svg.setAttribute('preserveAspectRatio', "none"); | ||
svg.setAttribute('version', "1.1"); | svg.setAttribute('version', "1.1"); | ||
/* Inline styling; maybe export to common.css? */ | /* Inline styling; maybe export to common.css? */ | ||
var style = document.createElementNS(svgNS, 'style'); | var style = document.createElementNS(svgNS, 'style'); | ||
Line 100: | Line 100: | ||
gDrawing.appendChild(datapresentation); | gDrawing.appendChild(datapresentation); | ||
} | } | ||
svg.appendChild(gDrawing); | svg.appendChild(gDrawing); |