Hopefully fixes #2548. --------- Signed-off-by: George Araujo <george.gcac@gmail.com> Signed-off-by: George Araújo <george.gcac@gmail.com>
15 lines
419 B
JavaScript
15 lines
419 B
JavaScript
$(document).ready(function () {
|
|
var $canvas = null,
|
|
$this = null,
|
|
_ctx = null,
|
|
_text = "";
|
|
$(".language-chartjs").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);
|
|
});
|
|
});
|