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

未关闭 适合新手
#12,235 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@puneetdixit200 已经在做这个了。

开始于 2026年6月4日。

  • #12264 来自 @puneetdixit200 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
冷清
技术栈
javascript
领域
documentation

调研方向

打开 docs/charts/bar.md,检查 skipNull 是如何在数据集属性和图表选项中列出的。根据 ChartConfiguration<'bar'> 示例验证文档所述的位置,并明确说明它是配置/控制器选项,而不是数据集字段。完成的标准是:页面不再指导用户设置 chart.data.datasets[0].skipNull,并清楚说明适用的选项部分。

由索引模型根据 Issue 内容生成。

描述

type: documentation
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

主要语言
JavaScript
星标
67.8k
派生
12k
平均合并
6 小时 15 分钟
30 天内合并 PR
3

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

chartjs/Chart.js 的其他 Issue

查看 chartjs/Chart.js 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。