Hide points in ChartJS LineGraph

I initially set the fill color for each point to be completely transparent. If I find the mouse pointer over the graph, the dots pop up. I want to hide all the points so that the line graph is smooth.

+5
source share
3 answers

This can be done by setting the point radius property in the configuration parameters as follows:

var chartConfig = { type: 'line', options: { elements: { point:{ radius: 0 } } } } 

Tips for glasses will also disappear.

+7
source

include showTooltips: false with your options for the chart. This will prevent the tooltip from hovering over the mouse.

See parameter settings at http://www.chartjs.org/docs/

+1
source

You can set pointRadius to zero.

 var myChart = new Chart(ctx, { type: 'line', data: { labels: [...] datasets: [ { data: [...], pointRadius: 0, } ] }, options: {} }) 
+1
source

Source: https://habr.com/ru/post/1241765/


All Articles