MediaWiki:Wikia.js

importScriptPage("MediaWiki:Chart.js", "dev"); // Manually load the script because ImportJS fails setTimeout(function {       clearInterval(interval);    }, 30000);                                 // But don't wait more than 30 seconds function startCharts { var ctx = document.getElementById('myChart'); var ctx2 = document.createElement('canvas'); // Manually create a tag from the div with id="myChart" ctx.appendChild(ctx2).getContext('2d'); ctx = ctx2.getContext('2d');
 * (function( $, mw, Chart ) {                  // Wait for huge script to load

var chart = new window.Chart(ctx, {           // The type of chart we want to create            type: 'line',           // The data for our dataset            data: {                labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60'],                datasets: [{                    label: 'EXP required for rank',                    borderColor: 'rgb(68, 85, 90)',                    showLine: true,                    data: [165, 335, 660, 1490, 2645, 4130, 5950, 8000, 10100, 12200, 14300, 16400, 18500, 20600, 22700, 24800, 26900, 29000, 31100, 33200, 35300, 37400, 39500, 41600, 43700, 45800, 47900, 50000, 52100, 54200, 56300, 58400, 60500, 62600, 64700, 66800, 68900, 71000, 73100, 75200, 77300, 79400, 81500, 83600, 85700, 87800, 89900, 92000, 94100, 96200, 98300, 100400, 102500, 104600, 106700, 108000, 110900, 113000, 115100, 117200], fill: false, }]           },

// Configuration options go here options: {} });   }    interval = setInterval(function { if (window.Chart && $("#myChart").length) { startCharts; clearInterval(interval); }   }, 500); })(jQuery, mediaWiki, window.Chart);