Originally I set the fill color for each point to be completely transparent. If I run my mouse over the graph, the points pop up. I want to hide all points so that the line graph is smooth.
Asked
Active
Viewed 1.1e+01k times
4 Answers
220
You can achieve this by setting point's radius property in configuration options as follows:
var chartConfig = {
type: 'line',
options: {
elements: {
point:{
radius: 0
}
}
}
}
Tooltips for the points will also gone off.

Shiv
- 3,069
- 1
- 24
- 17
-
6this config is global, but I got a chart which included 3 lines chart, I just wanna disable one of them – fifth May 16 '17 at 01:56
-
3@fifth you can set the `pointRadius` property on each individual dataset object. See @Alexander's answer below. – raychz Aug 20 '19 at 17:26
137
You can set the pointRadius
to zero.
var myChart = new Chart(
ctx, {
type: 'line',
data: {
labels: [...]
datasets: [
{
data: [...],
pointRadius: 0, # <<< Here.
}
]
},
options: {}
})

Alexander
- 105,104
- 32
- 201
- 196
-
3I've added "borderWidth: 1" and "pointRadius: 0.5" because I also needed a fine line and tiny dots to hover over them. – Marcello Silva Jan 10 '20 at 18:28
-
3
-
@throrin19 What did not work? It is fully documented per the link above. – Alexander Jan 09 '21 at 02:05
-
Oups sorry. I think I have disabled my click. My problem was with vue-chartjs. Options have not sync correctly with chartJS – throrin19 Jan 15 '21 at 10:15
4
I had the same problem, but I wanted to keep the hover option active. There is my solution:
const config = {
type: 'line',
data: {
datasets:[{
label: 'Température',
borderColor: 'rgb(255, 99, 132)',
data: tempE,
pointStyle: 'rect',
}]
},
options: {
elements:{
point:{
borderWidth: 0,
radius: 10,
backgroundColor: 'rgba(0,0,0,0)'
}
}
}
};

tortupizza
- 41
- 1
0
What actually worked for me to remove the points and keep the tooltip with the version 4 was to set the pointStyle property to false. Is the last option in the list provided in the official docs.
The code could be something like this:
const chart = new Chart('canvas-id', {
type: 'line',
data: {
label: 'Some label',
data: [...],
pointStyle: false
}
});

cybering
- 778
- 7
- 19