chartjs / chartjs/Chart.js

When developing a real-time chart, the x-axis does not move to the left.

Open
#11,166 1 comment 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

We want to add real-time data by changing the maximum and minimum values of the x-axis at intervals of 2 seconds.

### Current behavior

1. The x-axis moves well to the left at 2-second intervals (ex, 56s, 58s).
2. If I add data from second 00 (e.g. 46:00, 47:00 | hour:minute), the x-axis does not move.
3. If data is added at 00 seconds, the x-axis moves about 20 seconds after that.

![image](https://user-images.githubusercontent.com/2518021/221412824-bbf52e50-5cc1-4abd-92c5-d616bc7ad001.png)

### Reproducible sample

https://github.com/JangCool/sample-nuxt

### Optional extra steps/info to reproduce

https://github.com/JangCool/sample-nuxt

Please refer to the sample project.

yarn install
yarn dev

### Possible solution

I think we need to check how the x-axis is processed when data is added in 00 seconds.

### Context

"https://nagix.github.io/chartjs-plugin-streaming/latest/"

see : /pages/index.vue

Since the project doesn't seem to be updated, I want to implement a real-time chart myself.

### chart.js version

v4.2.1

### Browser name and version

Chrome

### Link to your project

https://github.com/JangCool/sample-nuxt

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.