Skip to content

Line chart ignores beginAtZero if no y-values are present #2476

@bart-blommaerts

Description

@bart-blommaerts

In ChartJS 2.1.0 a line chart ignores the beginAtZero option, if no y-values are present. This was also mentioned in #1581 (comment) . I want to avoid having negative values.

Config:

                type: 'line',
                options: {
                    scales: {
                        yAxes: [{
                            ticks: {
                                beginAtZero: true
                            }
                        }],
                        xAxes: [{
                            gridLines: {
                                display: false
                            }
                        }]
                    },
                    responsive: true,
                    maintainAspectRatio: false
                }

Screenshot:

capture

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions