Modulo:Sandbox/Aottolini/Graph: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
fix |
v4 |
||
Riga 278:
:css('border-left-width', tostring(radius * math.cos(math.pi * value / 50)) .. 'px')
:css('border-bottom-color', color)
graph
elseif quadrante == 1 then -- 25..50 %
div:css('right', tostring(radius) .. 'px')
Riga 287:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;right:0;top:0')
:css('border-top-width', 0)
Riga 294:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
elseif quadrante == 2 then -- 50..75 %
div:css('right', tostring(radius) .. 'px')
Riga 303:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
:css('border-top-width', 0)
Riga 310:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
elseif quadrante == 3 then -- 75..100%
div:css('left', tostring(radius) .. 'px')
Riga 319:
:css('border-left-width', tostring(radius * math.tan(math.pi * (value - 25) / 50)) .. 'px')
:css('border-bottom-color', color)
graph
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
:css('border-top-width', 0)
Riga 326:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
:css('border-top-width', 0)
Riga 333:
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph
else -- 100%
div:css('left', 0)
Riga 355:
cumulato = data[pos]
end
local graph = mw.html.create('div'):addClass('mw-no-invert'):cssText('background-color:white;margin:auto;position:relative;overflow:hidden;border:1px solid black;transform:scaleX(-1)rotate(-90deg)')
:css('width', tostring(args.outer_radius * 2) .. 'px')
Riga 367 ⟶ 362:
add_slice(graph, data[pos], args.colors[#args.values - pos + 1], args.outer_radius)
end
return outer
end
|