chartjs / chartjs/Chart.js

Chartjs v2.8 removes latest label on line chart

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

Description

Hi,

Chartjs 2.8 removes latest label which makes it harder to understand the chart. I can confirm that this behaviour started with version 2.8. I added two codepens for v2.7 and v2.8 so you can see the difference.

We do not use time scale. Date comes as string from backend and we handle the zooming operations from backend as well.

Here is how it looks in our product:

v2.7:
![image](https://user-images.githubusercontent.com/928600/54744261-c60f2580-4bc6-11e9-9aeb-b6cd1fce44be.png)

v2.8:
![image](https://user-images.githubusercontent.com/928600/54744296-e343f400-4bc6-11e9-81ad-7b71179b852a.png)

## Expected Behavior
User should see latest label on line chart.

Here is the correct view from v2.7:
https://codepen.io/yusufozturk/pen/NJEKpw

I see latest label here:
![image](https://user-images.githubusercontent.com/928600/54744764-16d34e00-4bc8-11e9-9f04-79f9f20b8343.png)

## Current Behavior
Chartjs 2.8 removes the latest label, and so there is an empty space at the end of the labels.

Here is the issue from v2.8:
https://codepen.io/yusufozturk/pen/Lagwvo

Label is visible on chart but not on the axis:
![image](https://user-images.githubusercontent.com/928600/54744808-336f8600-4bc8-11e9-961a-c6e9488da1e9.png)

## Possible Solution
I will revert back to v2.7. I don't have any other solution at the moment.

## Steps to Reproduce (for bugs)
Create a chart with lots of data points and try to limit width of the chart. So Chartjs will remove some of the labels to fit all labels in to the chart area. But latest version will also remove the latest label.

## Environment
* Chart.js version: 2.8
* Browser name and version: Chrome 72.0.3626.121

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.