15 lines
520 B
HTML
15 lines
520 B
HTML
|
<script>
|
||
|
window.Lazyload.js(['/assets/js/jquery.min.js', 'https://cdn.jsdelivr.net/npm/chart.js'], function() {
|
||
|
var $canvas = null, $this = null, _ctx = null, _text = '';
|
||
|
$('.language-chart').each(function(){
|
||
|
$this = $(this);
|
||
|
$canvas = $('<canvas></canvas>');
|
||
|
_text = $this.text();
|
||
|
$this.text('').append($canvas);
|
||
|
_ctx = $canvas.get(0).getContext('2d');
|
||
|
(_ctx && _text) && (new Chart(_ctx, JSON.parse(_text)) && $this.attr('data-processed', true));
|
||
|
});
|
||
|
});
|
||
|
</script>
|
||
|
|