Skip to content

skipNull is a configuration option, not a dataset field #12235

@hraftery

Description

@hraftery

Documentation Is:

  • Missing or needed?
  • 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, 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions