Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chart.js 2.0.0-beta2 disable points on line Charts

Tags:

chart.js

Is it possible to disable point display on 2.0.0-beta2 line type charts?

How?

I have a weekly graph with time scale where data is hourly. All works well but there are too many points. I would prefer a graph with just lines and without points. I searched the documentation but I haven't seen any option about it.

like image 467
Julen Landa Alustiza Avatar asked Jan 22 '16 11:01

Julen Landa Alustiza


1 Answers

Maybe a bit late but still. I had this same issue & searched the Source code for this (Because It used to be: pointDot: false which isn't working anymore)

There are 2 ways of doing this now:

  1. Use the options (This is in the documentation nnick.github Chartjs & Search for point.radius)

    options: { elements: { point: { radius: 1, hitRadius: 1, hoverRadius: 4 } } }

  2. Use the property from the line dataset itself

        data: {                
            datasets: [{
                radius: 0,
    

Small remark: when using radius: 0 it's hard to find the point when mouseover

like image 155
Zarkos Avatar answered Nov 14 '22 17:11

Zarkos