question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Negative Y Axis when data series is all zero

See original GitHub issue

Hi,

if there some way to not show negative y-axis values when the data series is all set to zero?

I have tried setting

ticks: {
    beginAtZero:true,
    min: 0
}

for the y-axis scale but it doesn’t appear to do the trick.

chart-negative-y-axis

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

21reactions
agrublevcommented, Apr 13, 2017
$scope.chart_line_options = {
                scales: {
                    yAxes: [
                        {
                            id: 'y-axis-1',
                            type: 'linear',
                            display: true,
                            position: 'left',
                            ticks: {
                                beginAtZero: true
                            }
                        }
                    ]
                }
            };
11reactions
FabianKoestringcommented, Aug 4, 2016

But what is if you dont know max? Why is this closed? The bug still exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Negative values ​on the y axis when all points have a ...
I have a chart where the values ​​can be 0 or 1, and in chartJs 2 or lower it works perfect, but I...
Read more >
Negative values are appearing on the Y-axis of a chart ...
Negative values are displayed on the Y-axis of a chart when no data available even after changing the primary axis' range to manual....
Read more >
How ensure zero value in Y-axis range while allowing ...
I've got the need to display a combination of possibly positive and negative values in a simple chart while I always want the...
Read more >
Suppress negative y-axis in ListLinePlot even if all values ...
If you want some set "floor" in this case, a construct like ListLinePlot[data, PlotRange -> {Full, {0, Max[1, Max@data]}}].
Read more >
negative values not displaying in y axis or data labels on chart
However, the y axis will not display labels that are less than zero and formatted as a time value. Nor will the data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found