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 update chart.js using Javascript
- Can I make Y axis begin at specific value in ChartJS?
- Chart.js. Edit bar width -v2.5-
- Chartjs plugin label in Angular app moving unexpectedly at hover
- How to show bar labels in legend in Chart.js 2.1.6?
- Replace Chart.js Data during `onClick` causes _meta error
- Is it possible to scale Chart.js background Image
- Getting the postion of the y-axis labels in chartJS
- How to store a chart.js chart options in another file in AngularJS
- Display Chart(.js) when mouse hover over: TypeError: t is null
- Chart.js bar chart: show tooltip on label hover
- Display with Month name in the Tooltip
- Emphasize a point in Chart.js
- Charts Area JS v2: How to set units?
- How to pass dynamic values as objects inside data in line chart?
- Chart JS dynamic chart
- Chartjs barchart group dataset by label
- how to change point style legend to diamond in chart js
- ChartJS: Horizontal Bar with multiple datasets not showing Bars
- Show/Hide data from Barchart with Chart.js
- Show all values in Chart js y axis
- code works fine on jsfiddle but one function is not working on website
- How to use Chart.js to draw mixed Financial / Candlestick and Bar Chart?
- Need help styling chart JS Radar chart
- Chart.js tooltip not showing on line chart
- Unable to display HH:mm:ss data in Chart.js
- ChartJS does not display the legend
- chart.js custom legend - make legend items clickable to select/deselect data
- How to convert a bar legend to line legend in chart.js 2.7.2?
- TypeError: Cannot read property 'legend' of undefined | Angular + ng2-charts