Reputation: 27886
How can a third-party javascript library be made available for client-side use in Atlasboard? require
doesn't work in widgets, and I don't want to have to import the whole library into every widget that uses the library.
Upvotes: 0
Views: 536
Reputation: 27886
Chart.min.js
) in assets/javascripts/
.layout.customJS
array:Example:
{
"title": "My Dashboard",
"titleVisible": false,
"description": "a neat dashboard",
"layout": {
"gridSize" : { "columns" : 20, "rows" : 12 },
"customJS" : ["Chart.min.js"],
"widgets" : [
...
]
},
"config": {
...
}
}
Nothing special needs to be done in the Widget. You can just use the library:
var graph = new Chart(ctx).Radar(data);
Upvotes: 3