mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Update beforeDraw as inline plugin
This commit is contained in:
parent
29772f8144
commit
9dc2a67d70
@ -48,19 +48,18 @@ let config = {
|
||||
centerText: {
|
||||
display: true,
|
||||
text: linkQ + "%"
|
||||
},
|
||||
plugins: [{
|
||||
beforeDraw: function(chart) {
|
||||
if (chart.config.centerText.display !== null &&
|
||||
typeof chart.config.centerText.display !== 'undefined' &&
|
||||
chart.config.centerText.display) {
|
||||
drawLinkQ(chart);
|
||||
}
|
||||
}
|
||||
}]
|
||||
};
|
||||
|
||||
//Chart.Chart.pluginService.register({
|
||||
// beforeDraw: function(chart) {
|
||||
// if (chart.config.centerText.display !== null &&
|
||||
// typeof chart.config.centerText.display !== 'undefined' &&
|
||||
// chart.config.centerText.display) {
|
||||
// drawLinkQ(chart);
|
||||
// }
|
||||
// }
|
||||
//});
|
||||
|
||||
function drawLinkQ(chart) {
|
||||
|
||||
let width = chart.chart.width;
|
||||
@ -82,7 +81,6 @@ function drawLinkQ(chart) {
|
||||
|
||||
window.onload = function() {
|
||||
let ctx = document.getElementById("divChartLinkQ").getContext("2d");
|
||||
window.myDoughnut = new Chart(ctx, config);
|
||||
//drawLinkQ(Chart);
|
||||
var chart = new Chart(ctx, config);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user