Modulo:Sandbox/Aottolini/Graph: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
v8
Nessun oggetto della modifica
 
(Una versione intermedia di uno stesso utente non è mostrata)
Riga 286:
:css('border-bottom-width', tostring(radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottomright-color', color)
graph:node(div)
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;right:0;top:0')
Riga 293:
:css('border-bottom-width', tostring(radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph:node(div)
elseif quadrante == 2 then -- 50..75 %
Riga 302:
:css('border-bottom-width', 0)
:css('border-left-width', 0)
:css('border-bottomtop-color', color)
graph:node(div)
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
Riga 309:
:css('border-bottom-width', tostring(radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph:node(div)
elseif quadrante == 3 then -- 75..100%
Riga 318:
:css('border-bottom-width', 0)
:css('border-left-width', tostring(radius * math.tan(math.pi * (value - 25) / 50)) .. 'px')
:css('border-bottomleft-color', color)
graph:node(div)
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
Riga 325:
:css('border-bottom-width', tostring(radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph:node(div)
div = mw.html.create('div'):cssText('position:absolute;line-height:0;border-style:solid;left:0;top:0')
Riga 332:
:css('border-bottom-width', tostring(2*radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph:node(div)
else -- 100%
div:css('left', 0)
:css('top', 0)
:css('border-top-width', 0)
:css('border-right-width', tostring(2*radius) .. 'px')
:css('border-bottom-width', tostring(2*radius) .. 'px')
:css('border-left-width', 0)
:css('border-bottom-color', color)
graph:node(div)
end
Riga 356 ⟶ 347:
cumulato = data[#args.values - pos + 1]
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')
:css('height', tostring(args.outer_radius * 2) .. 'px')
:css('border-radius', tostring(args.outer_radius) .. 'px')
:css('background-color', args.colors[#args.values])
for pos = 1,#args.values do
add_slice(graph, data[pos], args.colors[#args.values - pos + 1], args.outer_radius)