chartjs / chartjs/Chart.js

v3 Regression: Line doesn't draw when points are out of range

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

Description

## Expected Behavior
Line should be drawn as it was in v2.9.4.

## Current Behavior
When we have a line with two points out of X range (min/max), this line is not drawn.

## Steps to Reproduce
For a linear graph:
- Set x.min: 0
- Set x.max: 100
- Set two points laying at x: -10 and x: 100

See [this project](https://stackblitz.com/edit/angular-component-ycgter?file=src/app/app.component.ts)

## Context
We need this in our application, where you can see temperature changes in different zooms levels such as day or hour. With this behaviour, when you move to an hour zoom where temperature has not changed, you see an empty graph which is very ugly.

## Environment
* Chart.js version: 3.5.0
* Link to your project: See [this project](https://stackblitz.com/edit/angular-component-ycgter?file=src/app/app.component.ts)

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.