Module:ModernisationChart

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Module:ModernisationChart/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:ModernisationChart/doc. [edit]
Module:ModernisationChart requires Module:Chart data.
Module:ModernisationChart requires strict.
Function list
L 6 — p.main
require("strict")
local chart = require( 'Module:Chart data' )

local p = {}

function p.main()
    local plot = chart.newChart{ type = 'scatter' }
        :setDimensions( '50vw', '10vh', 300, 300, true )
        :setXLabel('Level')
        :setXLimits(0,150,5)
        :setYLabel('Damage')
        
    local series1 = plot:newDataSet()
        series1.label = 'old'
    local series2 = plot:newDataSet()
        series2.label = 'new'

    for i = 0,145 do
        series1:addDataPoint({x=i,y=2.5*i})
        series2:addDataPoint({x=i,y=math.floor(2.5*145*(math.log(1+0.6*i/145)/math.log(1.6))*10)/10})
    end

    return plot
end

return p