区域图表

    1 在2.2.0版中引入了数据集填充模式2 2.6.0之前的版本, 边界值为 'zero', 'top', 'bottom' (已废弃)3 对于向后兼容性, fill: true (默认值) 相当于fill: 'origin'

    示例

    配置

    选项类型默认值描述
    Booleantrue隐藏数据集时的填充

    如果为true,则填充区域将递归地扩展到由隐藏数据集目标的fill值所定义的可见目标:

    1. new Chart(ctx, {
    2. data: {
    3. datasets: [
    4. {fill: 'origin'}, // 0: fill to 'origin'
    5. {fill: 1}, // 2: fill to dataset 1
    6. {fill: false}, // 3: no fill
    7. {fill: '-2'} // 4: fill to dataset 2
    8. ]
    9. },
    10. options: {
    11. plugins: {
    12. propagate: true
    13. }
    14. }
    15. }
    16. })

    propagate: true:

    • 如果数据集2被隐藏,则数据集4将填充到数据集1