Commit f43bcb49 authored by Hervé  MENAGER's avatar Hervé MENAGER
Browse files

correct the "disapeared radar chart" problem

parent 100c0b71
Pipeline #20198 passed with stages
in 10 minutes and 15 seconds
......@@ -77,6 +77,13 @@
"pointHoverBorderColor":"rgb(255, 99, 132)"}],
"options":{"elements":{"line":{"tension":0,"borderWidth":3}}}
};
var canvasEl = document.getElementById(canvasId);
var height = canvasEl.getAttribute('data-radarh');
var width = canvasEl.getAttribute('data-radarw');
canvasEl.height = height;
canvasEl.width = width;
canvasEl.style.height = height;
canvasEl.style.width = width;
var myRadar = new Chart(document.getElementById(canvasId).getContext("2d"),
{type: 'radar',
data: radarChartData,
......
......@@ -126,9 +126,11 @@
<h5 class="card_title">Radar chart</h5>
<div class="card_border">
{% if compound.molecular_weight is not None %}
<canvas id="radar"></canvas>
<canvas id="radar" data-radarh="500px" data-radarw="500px"></canvas>
<script>
drawCompoundDescriptorRadarChart('radar', {{ compound.molecular_weight }}, {{ compound.a_log_p }}, {{ compound.nb_donor_h }}, {{ compound.nb_acceptor_h }}, {{ compound.tpsa }}, {{ compound.nb_rotatable_bonds }}, {{ compound.nb_benzene_like_rings }}, {{ compound.fsp3 }}, {{ compound.nb_chiral_centers }});
$('a.second_nav').on('shown.bs.tab', function (e) {
drawCompoundDescriptorRadarChart('radar', {{ compound.molecular_weight }}, {{ compound.a_log_p }}, {{ compound.nb_donor_h }}, {{ compound.nb_acceptor_h }}, {{ compound.tpsa }}, {{ compound.nb_rotatable_bonds }}, {{ compound.nb_benzene_like_rings }}, {{ compound.fsp3 }}, {{ compound.nb_chiral_centers }});
});
</script>
{% else %}
<p class="text-secondary">Compound properties unavailable</p>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment