score:50
Accepted answer
here you go:
jsfiddle: http://jsfiddle.net/1v9fy5mz/
code:
html
<canvas id="canvas"></canvas>
js:
var ctx = document.getelementbyid("canvas").getcontext("2d");
var data = {
labels: ['january', 'february', 'march'],
datasets: [{
data: [1, 2, 3]
}]
};
var mylinechart = new chart(ctx, {
type: 'line',
data: data,
options: {
showalltooltips: true,
tooltips: {
custom: function(tooltip) {
if (!tooltip) return;
// disable displaying the color box;
tooltip.displaycolors = false;
},
callbacks: {
// use label callback to return the desired label
label: function(tooltipitem, data) {
return tooltipitem.xlabel + " :" + tooltipitem.ylabel;
},
// remove title
title: function(tooltipitem, data) {
return;
}
}
}
}
});
score:6
tooltips: {
displaycolors: false,
callbacks: {
// use label callback to return the desired label
label: function(tooltipitem, data) {
return tooltipitem.xlabel + " :" + tooltipitem.ylabel;
},
// remove title
title: function(tooltipitem, data) {
return;
}
}
}
score:68
add this in your options
object
tooltips: {
displaycolors: false
}
update for version 3 or greater (from @hanumandev below):
remove 's' from tooltips
tooltip: {
displaycolors: false
}
Source: stackoverflow.com
Related Query
- How to remove square label from tooltip and make its information in one line?
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How to remove background color and color example from tooltip in Chart.js?
- chart.js - how to draw and manage line when only one label present in chart js Linechart
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- How can I remove extra whitespace from the bottom of a line chart in chart.js?
- How to display only one label in a multi line char?
- How do I keep chart.js charts in one JS file, and not get errors when the ID from the JS file don't exist on one specific html page?
- How to change the label and grid line position on a timeseries chart in Chart.js 3?
- How to make aspecific API call from within a Line Chart class in ReactJS using react-chartjs-2?
- How could I skip drawing empty/zero value and its value on tooltip
- How to sort XY line chart tooltip items based on value and add thousands separators?
- How to make lines in line charts from ng2-charts straight lines?
- Remove label from line chart - react-chartjs-2
- how can i use chart.js to create a chart that has one time series line and one linear line on it at the same time?
- How to remove colored label square
- How to remove all gridlines and ticks all lines in lines chart in javascript taken from cdn)
- How to get line x value from Label chart js
- Is there any way to remove extra space and Horizontal line from Bar chart of Chart.js?
- Charts.js line chart, how to hide y-axis start and end label if data is same
- How to put static pointDots and make vertical line in Chart.js
- How to show tick marks and labels with grid line for the specific one on the X axis with Chart.js?
- how to make Dashed and Solid Line Donut Chart.js
- How to remove only one specific dataset label chartJS?
- How to remove left and right padding from the canvas/chart?
- Chartjs - how to make line position to vertical center and how to display dotted sharp in the backround?
- How to remove header square from chart.js?
- How to limit chart JS hover to take only one value from each line chart when zoomed out?
- How to remove a vertical line from the canvas of react-chartjs-2?
- How to remove Grid lines except for zero line and border Chartjs?
More Query from same tag
- How to put rounded corners on a Chart.js Bar chart
- chart.js line chart and "correct" spacing between points? (i.e. horizontal position based on percent of width, not fixed)
- SAPUI5 using chart.js
- graph (chartjs.org) does not stretch properly when sidebar(menu) is collapsed
- Is there a way to change the react-chart-js tooltip only on a graph?
- break y axis in line chart chart.js
- Chart.js x-axes not working?
- vue js bar-chart gradient color not showing
- Edit styles for axes in ChartJS bar chart, when gridlines are hidden
- How to implement scattered chart using chart.js which is not available by default?
- Chart.js scatter chart plot data joins start and finish points together
- How to make chart with chartjs.?
- How remove duplicates xAxis labels and show all values on chart
- How to show slice value inside of slice in pie chart using chart.js
- Pie chart.js - display a no data held message
- ChartJS for 1 and 0 values display true or false
- VueJs + Chart.js - Avoid ref for reactive updates
- Chart JS Dynamic number of datasets
- Charts doesn't appear
- JavaScript Chart.JS - Custom tooltips to add description of specific data point when hovering
- My chartJS axios.get is fired twice causing chart to render twice too and i don't know why. I'm using react-chartjs-2
- Setting dynamic state data in Chart.JS + React
- How to plot date/time on X but display only dates in Chart.js?
- ReactJS Components Not loading unless you reload the site for the 2nd time
- Chart JS - Grid colors and gradient fill not showing
- Type 'import("/@types/chart.js/index.d.ts")' is missing the following properties from type 'any[]': length, pop, push, concat, and 26 more
- Vue3 Chart.js not rendering
- How do you use user input as data values in chart.js?
- Chart.js legend is undefined
- How to add a custom event on legend click