יחידה:גרפים: הבדלים בין גרסאות בדף

אופסי
ניסוי
שורה 423: שורה 423:
     function drawXlegends()
     function drawXlegends()
         local setOffset, setWidth
         local setOffset, setWidth
        local rotationTransform = xrotation and '-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);'..
         local legendDivStyleFormat = "position:absolute;left:%spx;top:20px;min-width:%spx;max-width:%spx;text-align:center;veritical-align:top;padding:0 0.3em;"
            '-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)'
            or ''
         local legendDivStyleFormat = "position:absolute;left:%spx;top:20px;min-width:%spx;max-width:%spx;text-align:center;veritical-align:top;%s"
         local tickDivstyleFormat = "position:absolute;left:%spx;height:10px;width:1px;border-left:1px solid black;"
         local tickDivstyleFormat = "position:absolute;left:%spx;height:10px;width:1px;border-left:1px solid black;"
         for i = 1, numValues do
         for i = 1, numValues do
             if not nulOrWhitespace( xlegends[i] ) then
             if not nulOrWhitespace( xlegends[i] ) then
                 setOffset, setWidth = groupBounds( i )
                 setOffset, setWidth = groupBounds( i )
                -- setWidth = 0.85 * setWidth
                 table.insert( res, mw.text.tag( 'div',  
                 table.insert( res, mw.text.tag( 'div', { style = string.format( legendDivStyleFormat, setOffset, setWidth - 10, setWidth - 10,  rotationTransform ) }, xlegends[i] or '' ) )
                    {  
                        class = xrotation and 'rot90', -- assigning null to a key means "do not use this key"
                        style = string.format( legendDivStyleFormat, setOffset, setWidth, setWidth )  
                    }, xlegends[i] or '' )
                )
                 table.insert( res, mw.text.tag( 'div', { style = string.format( tickDivstyleFormat, setOffset + setWidth / 2 ) }, '' ) )
                 table.insert( res, mw.text.tag( 'div', { style = string.format( tickDivstyleFormat, setOffset + setWidth / 2 ) }, '' ) )
             end
             end