score:7
This is due to a bug in the that version (2.8.0) of Chart.js (Values on Tooltip of Radar Chart is not shown).
You can fix it by upgrading to 2.9.0.
Updated working Fiddle with version 2.9.0
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.0"> </script>
score:1
I am using the version 2.8, and i got the same problem, to fix
tooltips: {
enabled: true,
callbacks: {
label: function(tooltipItem, data) {
return data.datasets[tooltipItem.datasetIndex].label + ' : ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
}
}
}
See the issue
https://github.com/chartjs/Chart.js/issues/6188#issuecomment-497251833
score:2
As far as I can tell I had the same problem a while ago, maybe, because I'll need to research a little more about this issue, the problem is due to a previous version of Chart.js. In any case here is a CodePen
with a solution to your problem RadarChart Example. Hope this helps. Cheers, sigfried.
UPDATE Since this is not only about the answers here is the link from the documentation of Chart.js that I used to solve the tooltips issue Label Callbacks.
score:2
I tried to re-create the problem you have but it looks all good to me.(A number after "total")
Since you only post part of your code, I am not sure where you are confused. So I attached the full code I created here. Compare it to your code and let me know if you still can't generate the figure you want.
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript chart</h2>
<p>Radar Chart Demo </p>
<canvas id="radar-chart" width="800" height="600"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js">
</script>
<script>
function radarChart(categories, totals, averages, chartToPopulate, chartTitle) {
var chartDisplay = chartToPopulate;
var newChart = new Chart(chartDisplay, {
type: 'radar',
data: {
labels: categories,
datasets: [
{
data: averages,
pointBackgroundColor: ["rgba(199,54,54,1)", "rgba(199,54,122,1)", "rgba(199,54,154,1)", "rgba(146,54,199,1)", "rgba(69,54,199,1)", "rgba(54,103,199,1)", "rgba(54,165,199,1)", "rgba(54,199,180,1)"],
pointBorderColor: ["rgba(199,54,54,1)", "rgba(199,54,122,1)", "rgba(199,54,154,1)", "rgba(146,54,199,1)", "rgba(69,54,199,1)", "rgba(54,103,199,1)", "rgba(54,165,199,1)", "rgba(54,199,180,1)"],
pointRadius: 15,
pointStyle: "cross",
pointHoverRadius: 25,
pointHoverBorderWidth: 3,
pointRotation: 45,
pointBorderWidth: 1.2,
backgroundColor: "rgba(61,49,225,0.5)",
borderColor: "rgba(61,49,225,1)",
label: "Averages",
fill: true
},
{
data: totals,
pointBackgroundColor: ["rgba(199,54,54,1)", "rgba(199,54,122,1)", "rgba(199,54,154,1)", "rgba(146,54,199,1)", "rgba(69,54,199,1)", "rgba(54,103,199,1)", "rgba(54,165,199,1)", "rgba(54,199,180,1)"],
pointBorderColor: ["rgba(199,54,54,1)", "rgba(199,54,122,1)", "rgba(199,54,154,1)", "rgba(146,54,199,1)", "rgba(69,54,199,1)", "rgba(54,103,199,1)", "rgba(54,165,199,1)", "rgba(54,199,180,1)"],
pointRadius: 15,
pointStyle: "cross",
pointHoverRadius: 25,
pointHoverBorderWidth: 3,
pointRotation: 45,
pointBorderWidth: 1.2,
backgroundColor: "rgba(225,49,52,0.35)",
borderColor: "rgba(225,49,52,1)",
label: "Totals",
fill: true
},
]
},
options: {
maintainAspectRation: false,
title: {
display: true,
text: chartTitle,
fontSize: 16
}
}
})
return chartDisplay;
}
var Chart = radarChart(["1","2","3","4"], [100,200,300,400], [10,20,30,40],
document.getElementById("radar-chart"), "TEST")
document.getElementById("radar-chart").innerHTML = Chart;
</script>
</body>
</html>
Source: stackoverflow.com
Related Query
- Why can I not see a data value when hovering over a point on the radar chart?
- Charts with previous data appear when hovering the cursor over the chart in Chart.js
- Moving vertical line when hovering over the chart using chart.js
- ChartJS: Highlight dataset in a stacked bar chart when hovering over the legend?
- Chart.js How can I embed additional values to each data point in radar chart
- Why is the data from my API not displaying on my chart.js chart in React?
- Moving vertical line when hovering over the chart using chart.js in v2.9.4
- chart does not change the values when the variable changes the value
- Chart is not populating when getting the data from AJAX call
- I am using chart js to draw a chart. I did everything right but i don't know why the x axis and y axis label is not comming in chart. code below
- Chart.js returns a console error and does not display the chart when using variables as data input
- Chart JS: Donut/Doughnut Chart: Tooltip to be shown always for all the data. All tooltip is not shown when multiple data are with 0 data
- Chartjs Bar Chart showing old data when hovering
- ng2-charts customize data and whole html content of tooltip displayed when hovering on bar chart
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- Chart JS display Data Value on the top of the Bar
- Can I use a gradient in Chart.js without accessing the chart context when the chart is created?
- Angular chart how to show the legend data value by default along with legend name
- canvas fill text vanishes when hovering over chartjs pie chart
- Echars can not render a smooth line when it process alot of data
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
- How can I show percentages when hovering over my chart?
- Chart.JS: How can I only display data labels when the bar width is big enough for the text?
- How can I change the label name when you hover your data in Chart.js?
- How can I show a subset of data on pie pieces in Chart.JS while still displaying the superset when hovering?
- Highlight chart element when hovering over its corresponding legend Item
- Chart.js - Fill Text only appearing when hovering over one part of the doughnut
- Chart.JS: How can I only display data labels when the doughnut size is big enough for the text?
- How to show tooltip value of all data falling on the same axis in chart js?
- How can i move a point through both x-axis and y-axis while the curve is not changed in a chart.js line graph?
More Query from same tag
- How to make ticks evenly spaced with Chart.js
- Populating javascript chart with Razor model data
- Ng2-charts Time xAxes : unwanted high zoom on click
- Chart.js only appears randomly, and disappears on page refresh
- hide label on doughnut chart of chartjs
- Can't draw pie chart using chartjs - TypeError: Cannot create property '_meta' on number '16'
- Chart.JS how to change order of y-axis
- Chart.js - Creating multiple charts on one page
- Different color for each bar in a bar chart; ChartJS
- Chart.js How to make a sample math axis?
- Chart.js v2 formatting time labels
- Two chartjs charts on page throwing data undefined error
- Chartjs time plot xAxis shows year 1970
- Chart.js line chart display decimal values on Y axis
- Chart.js showing nothing on canvas
- chart.js line for only part of the labels
- How to set the number of of rows in a line chart in chart.js?
- Chartsjs only showing two data points
- I want to draw a horizontal line
- ChartJS doughnut legend click
- How to set static value in y-axis in chart.js?
- How can I calculate a value and place it inside the last bar in a Chart.JS bar chart?
- How can I draw dotted line using chartjs?
- How to remove bars for those bars with zero value in Chartjs bar chart?
- How to get data from JSON ReactJs
- ChartJS and require: Chart is undefined
- how can plot graph using json data
- Modifying values in a radar chart.js based on user input
- Multidimensional Charts.js (array of arrays)
- How to convert an array of strings to float in Javascript