Widget:Chartjs pie: Difference between revisions
Jump to navigation
Jump to search
No edit summary Tags: Reverted 2017 source edit |
No edit summary Tags: Reverted 2017 source edit |
||
Line 37: | Line 37: | ||
let dataSeries = makeItemsArray('<!--{$data_series|default:''}-->'); | let dataSeries = makeItemsArray('<!--{$data_series|default:''}-->'); | ||
let title = '<!--{$title|default:''}-->'; | let title = '<!--{$title|default:''}-->'; | ||
dataIdentifier = dataIdentifier.trim(); | dataIdentifier = dataIdentifier.trim(); | ||
title = title.trim(); | title = title.trim(); | ||
function drawPieChart(ctx, labels, dataIdentifier, colors, dataSeries, title) { | |||
function drawPieChart(ctx, labels, dataIdentifier, colors, dataSeries | |||
//console.log('ctx: ' + ctx); | //console.log('ctx: ' + ctx); | ||
//console.log('labels: ' + labels); | //console.log('labels: ' + labels); | ||
Line 55: | Line 48: | ||
//console.log('dataSeries: ' + dataSeries); | //console.log('dataSeries: ' + dataSeries); | ||
//console.log('title: ' + title); | //console.log('title: ' + title); | ||
new Chart(ctx, { | new Chart(ctx, { | ||
type: 'pie', | type: 'pie', | ||
Line 67: | Line 59: | ||
}, | }, | ||
options: { | options: { | ||
legend: { display: | legend: { display: legend }, | ||
title: { | title: { | ||
display: true, | display: true, | ||
Line 76: | Line 68: | ||
} | } | ||
window.drawPieChart = drawPieChart(ctx, labels, dataIdentifier, colors, dataSeries | window.drawPieChart = drawPieChart(ctx, labels, dataIdentifier, colors, dataSeries, title); | ||
}); | }); |
Revision as of 10:17, 19 March 2024
This widget allows you to add ... widget to your wiki page.
Created by [idea-sketch.com idea-sketch.com]
Using this widget[edit source]
For information on how to use this widget, see ...
Copy to your site[edit source]
To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Chartjs pie.