Thursday, 18 April 2019

Why can I not see a data value when hovering over a point on the radar chart?

I have created a Radar Chart using ChartJS as follows:

HTML:

<canvas id="radarChartTest" width="800" height="600"></canvas>
<script>
    radarChartTest(["A", "B", "C", "D"], [5, 10, 15, 20], document.getElementById("radarChartTest"));
</script>

JS:

function radarChartTest(categories, totals, chartToPopulate) {
    var chartDisplay = chartToPopulate;
    var newChart = new Chart(chartDisplay, {
        type: 'radar',
        data: {
            labels: categories,
            datasets: [
                {
                    data: totals,
                    label: "test"
                }
            ]
        }
    })
}

JSFiddle

The chart draws and populates fine. However, when I hover over a radar point, it does not display the value:

broken chart

There should be a number after test:.

I am expecting something similar to this:

working radar chart

Am I missing an attribute or something? I have checked the documentation but could not spot anything for it. I have also compared my code to where I found (a working example), but could not spot anything there either.



from Why can I not see a data value when hovering over a point on the radar chart?

No comments:

Post a Comment