Jump to content

Module:Graph:Chart

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by GKFX (talk | contribs) at 21:30, 30 April 2021 (fix error). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
local graph = require('Module:Graph')

p[''] = function(frame)
	local newFrame = {
	    getParent = function(self)
	    	return frame
	    end,
	    getTitle = function(self)
	    	return 'Template:Graph:Chart'
	    end,
	    args = {}
	}
	setmetatable(newFrame, {
		__index = function(t, k)
			if type(frame[k]) == 'function' then
				return function(...)
					return frame[k](frame, select(2, ...))
				end
			else
				return frame[k]
			end
		end
	})
	return frame:extensionTag{ name='templatestyles', src='Template:Graph:Chart/styles.css' },
		frame:extensionTag('graph', graph.chartWrapper(newFrame))
end

return p