Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logarithmic Line chart: line segments not displayed if starting or ending at y=0 #9978

Closed
sboggs-trs opened this issue Dec 9, 2021 · 1 comment

Comments

@sboggs-trs
Copy link

Expected Behavior

(This seems related to, maybe overlaps, Refine logarithmic scaling / tick generation #9166)
(This also seems related to v3 Regression: Line doesn't draw when points are out of range #9564)

In a line chart with logarithmic y scale, gridline/tick y=0 should be displayed at all times (at least an option to, as in version 2), and all line segments should be displayed - even if the segment originates or ends at y=0.

Current Behavior

In a line chart with logarithmic y scale, any line segment will not be displayed if the segment originates or ends at y=0.
This might be due to the chart not including a tick at y=0.

Possible Solution

In chartjs 2, we were able to display a chart with the Y-axis starting at 0, by setting beginAtZero like so:

     y: {
         ticks: {
                  beginAtZero: true,
         },
     }

Adding this property might make the most sense.

Steps to Reproduce

Here is a Stackblitz. Notice that the 1st line segment (originating at (0, 0) ) does not display.

Context

Currently unable to update from chartjs2 until this (and some issues probably handled by Refine logarithmic scaling / tick generation #9166) is not an issue. Here is a screenshot capturing the desired appearance, from a (stepped Line) chartjs-2 created by someone else:
image

Environment

  • Chart.js version: 3.6.2
@LeeLenaleee
Copy link
Collaborator

Duplicate of #9629

@LeeLenaleee LeeLenaleee marked this as a duplicate of #9629 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants