diff --git a/planet/templates/expression_profile.html b/planet/templates/expression_profile.html index a4dfd6b..2ed0f8f 100644 --- a/planet/templates/expression_profile.html +++ b/planet/templates/expression_profile.html @@ -50,15 +50,10 @@

{{t.name}}

{% block extrajs %} {% endblock %} \ No newline at end of file diff --git a/planet/templates/macros/chartjs.html b/planet/templates/macros/chartjs.html new file mode 100644 index 0000000..47bf2ea --- /dev/null +++ b/planet/templates/macros/chartjs.html @@ -0,0 +1,20 @@ +{% macro expression_profile(target, url) -%} +$( document ).ready(function() { + $.getJSON( "{{ url}}", function( data ) { + var ctx = document.getElementById("{{ target }}").getContext("2d"); + data['options']['responsive'] = true; + data['options']['maintainAspectRatio'] = false; + data['options']['tooltips'] = { + enabled: true, + mode: 'single', + callbacks: { + label: function(tooltipItems, data) { + return tooltipItems.yLabel.toFixed(2); + } + } + } + console.log(data); + var myChart = new Chart(ctx, data); + }); +}); +{%- endmacro %} \ No newline at end of file diff --git a/planet/templates/modals/expression_profile.html b/planet/templates/modals/expression_profile.html index cea2fd2..a1fd659 100644 --- a/planet/templates/modals/expression_profile.html +++ b/planet/templates/modals/expression_profile.html @@ -14,11 +14,7 @@