chartjs / chartjs/Chart.js

`skipNull` is a configuration option, not a dataset field

Open
#12,235 2 comments 0 reactions 0 assignees View on GitHub
type: documentation
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Documentation Is:

- [ ] Missing or needed?
- [x] Confusing
- [ ] Not sure?

### Please Explain in Detail...

`skipNull` is described at `https://github.com/chartjs/Chart.js/blob/master/docs/charts/bar.md` as a "Dataset Property".

Accordingly, I tried variations of `chart.data.datasets[0].skipNull = true;` and was never successful (nulls seem to be treated as zero). I've since enabled type checking and `skipNull` is reported as not a property of `ChartDataSet`.

I stumbled across [this comment](https://github.com/valor-software/ng2-charts/issues/1416#issuecomment-1188717831), which claims "skipNull is actually a controller option".

Sure enough, if I do something like:

```
const config: ChartConfiguration<'bar'> = {
type: 'bar',
options: {
skipNull: true,
},
};
```

I have more success (no type error and nulls seem to be excluded, though I haven't tested thoroughly). So I suppose the documentation is out of date?

### Your Proposal for Changes

I don't quite understand the page structure well enough to be sure, but I think some of the options in the "Dataset" section should be restricted to the "Options" section, so it doesn't look like they can be applied to a dataset. Maybe the "Options" section should more clearly explain the use of "ChartConfiguration"?

### Example

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.