score:2
Accepted answer
Tooltips can be modified thus
<Line
data={{
<snip>
options={{
maintainAspectRatio: false,
title: {
display: true,
text: "Hello",
fontSize: 20
},
plugins: {
tooltip: {
callbacks: {
label: function(context) {
var label = context.dataset.label || '';
if (context.parsed.y !== null) {
label += ' ' +context.parsed.y + '%';
}
return label;
}
}
}
},
scales: {
y: {
min: 0,
max: 100,
ticks: {
stepSize: 20,
callback: function (value, index, values) {
return value + " %";
}
}
}
},
legend: {
labels: {
fontSize: 25
}
}
}}
/>
score:1
You can edit the ticks
property like this:
scales: {
y: {
min: 0,
max: 100,
ticks: {
stepSize: 20,
callback: function(value, index, values) {
return value + " %";
}
}
}
},
Found that here: https://www.chartjs.org/docs/latest/axes/labelling.html#creating-custom-tick-formats
Seems to do the trick:
Source: stackoverflow.com
Related Query
- How can I display the percentage symbol inside the chartjs?
- How can I display the percentage inside the graph and on hover?
- How can I display a set amount of ticks on the Y Axis?
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How can I datalabels and Sum display in the same time on a stacked bar
- How can I load multiple Chartjs charts with different data on the same page?
- how can i send a list of numbers from views.py to a chartjs file im using for the front?
- Chart.JS: How can I only display data labels when the bar width is big enough for the text?
- How can I force the ".0" portion of a value to explicitly display (Chart.JS)?
- How can I change the cursor on pie chart segment hover in ChartJS 3?
- how can i remove the grid lines in chartJs
- Chart.JS: How can I only display data labels when the doughnut size is big enough for the text?
- How to take a set of Date objects and display the frequency based on time of day using ChartJS
- ChartJS - How can I skip certain minutes on the X-Axis
- How can I calculate a value and place it inside the last bar in a Chart.JS bar chart?
- How to display the values inside the pie chart of PrimeNG (chart) using JavaScript or Angular
- How can I display `Null` value data on Y Axis using the Primitive dataset format in Chart.js V3.7.0?
- How can I pass the data into the chartjs label?
- How can I move chartJs legend left side and change the width and Hight of the chart?
- how can I show only 2 numbers on the xAxe in Chartjs having more than two numbers on the chart? (line chart)
- How can I style ChartJS to always be at the bottom of a div?
- How can I scale my dataset values as a percentage of the index in chart.js?
- Chartjs - how to make line position to vertical center and how to display dotted sharp in the backround?
- How can I put my label on the right hand side of my chart in Chartjs
- Angular how to display data inside every part of doughnut chartjs
- How to display the more then one value inside tooltip in bar chart.js?
- Laravel - How to Display both count and percentage (%) in chartjs pie chart
- How i can i reduce the borderwidth of a chartjs dougnut chart
- How can I set 3 color to the same chartjs bar?
- How can I draw lines inside the bars in charts.js?
More Query from same tag
- Extending Existing Chart Types angular chart js using chart js 2.0
- Chart js sum of grouped bars
- Chart.js how to change point radius of scatter charts on resize events?
- How to create a rounded rectangle using ChartJS
- Chart.js bar chart labels do not valign
- Custom tooltip in Chart.js
- How can I create a bar chart that has multiple yAxes scales?
- Chart.js Stacked Group Bar model after updating version Chart.js 2.9.4 -> Chart.js 3.5.0
- Django admin/ Chart js error - super() takes at least 1 argument (0 given)
- How to dynamically update Chartjs legend label colors?
- How to filter chart.js by month
- Chart JS Displays Only Bigger Dataset But Has Both Datasets?
- How to get click event in Chart.js
- How I can add the predict data and the actual data in the same graph with ChartJS?
- How to display Tooltip without hovering pie chart with Chart.JS
- chart.js not allowing y axis steps with logarithmic scale
- Show multiple line graphs on the same chart using chart JS
- How to remove labels from ng2-chart(chart.js)
- findOne returns undefined in onRendered
- Show only nth tick LINE on x-axis for Chart.js diagram
- Is there a way to display a chart label that has no data behind it in Chart.js
- ChartJs in ionic Framework
- How to reload a jQuery element when a button is pressed
- Update Chart JS data dynamically and add new data, remove old data to create timeline "like" chart
- Data Visualization DataTables.js using chart.js
- How can I show chartjs datalabels only last bar?
- How can I divide this Object.values with the total?
- How to fix [<br /> when trying to enter data through php in data (chart.js)
- How to update chart when state changes in vue?
- SCRIPT438: Object doesn't support property or method 'values'