mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-06 08:24:05 +01:00
Merge pull request #438 from Miosss/templateEnchanceme
Alternative scale templating. Passing function as template.
This commit is contained in:
@@ -405,6 +405,12 @@
|
||||
//Templating methods
|
||||
//Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/
|
||||
template = helpers.template = function(templateString, valuesObject){
|
||||
// If templateString is function rather than string-template - call the function for valuesObject
|
||||
if(templateString instanceof Function)
|
||||
{
|
||||
return templateString(valuesObject);
|
||||
}
|
||||
|
||||
var cache = {};
|
||||
function tmpl(str, data){
|
||||
// Figure out if we're getting a template, or if we need to
|
||||
|
||||
Reference in New Issue
Block a user