Chart.js: [v.2.0] - how to remove points?

Created on 8 Mar 2016  ·  5Comments  ·  Source: chartjs/Chart.js

Hi,

I've switched to v.2.0 and suprisingly there is no option to remove bullets from line charts.
Is this desired situation? Or this one is just skipped in documentation and works different way?
Honestly I would like expansion of functionality not cuts ;-)

Best regards

support

Most helpful comment

oh, sorry.

The easiest way is to set the radius of the points to 0. Using the latest from the v2.0-dev branch the points will not draw.

In your config:

{
    elements: {
        point: {
            radius: 0
        }
    }
}

You can set the radius per dataset as well

data = {
    datasets: [{
        radius: 0, // radius is 0 for only this dataset
    }]
}

All 5 comments

@KonradDeskiewicz to remove points, simply remove them from the data you passed into the chart. Then you can call update() and the chart will update.

I wasn't precise enough.. how to turn off dots on chart.
There was
pointDot: false,
in V.1 but it doesn't work anymore.

oh, sorry.

The easiest way is to set the radius of the points to 0. Using the latest from the v2.0-dev branch the points will not draw.

In your config:

{
    elements: {
        point: {
            radius: 0
        }
    }
}

You can set the radius per dataset as well

data = {
    datasets: [{
        radius: 0, // radius is 0 for only this dataset
    }]
}

:) Many thanks :)

helped a lot.

Was this page helpful?
0 / 5 - 0 ratings