Skip to content

Commit

Permalink
fix: fix non display for zero values on log scale
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanguy-Boisset committed Nov 13, 2023
1 parent 3ff6d61 commit 957779e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ad_miner/sources/html/templates/cards_modal_header.html
Expand Up @@ -71,6 +71,7 @@ <h5 class="modal-title" id="cardsModalLabel">Indicators of exposure</h5>
function changeScale() {
if (logScale) {
allCharts.forEach(chart => {
chart.data.datasets[0].data = chart.data.datasets[0].data.map(value => value === 0.1 ? 0 : value);
chart.options.scales.y = {
type: 'linear'
};
Expand All @@ -80,8 +81,12 @@ <h5 class="modal-title" id="cardsModalLabel">Indicators of exposure</h5>
}
else {
allCharts.forEach(chart => {
chart.data.datasets[0].data = chart.data.datasets[0].data.map(value => value === 0 ? 0.1 : value);
chart.options.scales.y = {
type: 'logarithmic'
type: 'logarithmic',
ticks: {
callback: (value, index) => index === 0 ? '0' : value
}
};
chart.update();
})
Expand Down

0 comments on commit 957779e

Please sign in to comment.