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

Implementing of the "begin-zero" option #262

Closed
ddydeveloper opened this issue Nov 27, 2017 · 6 comments
Closed

Implementing of the "begin-zero" option #262

ddydeveloper opened this issue Nov 27, 2017 · 6 comments

Comments

@ddydeveloper
Copy link

ddydeveloper commented Nov 27, 2017

Expected Behavior

When I have some positive data I want to see zero value on values axis:

Actual Behavior

image

Use HorizontalBar in this way:
<vue-horizontal-bar-chart :chart-data="ordersChartData" :beginzero="true"></vue-horizontal-bar-chart>

Environment

  • vue.js version: "^2.5.8"
  • vue-chart.js version: "^3.0.2"
  • npm version: "5.5.1"
@ddydeveloper ddydeveloper changed the title Implementing "begin-zero" option Implementing of the "begin-zero" option Nov 27, 2017
@ddydeveloper ddydeveloper mentioned this issue Dec 3, 2017
Closed
1 task
@apertureless
Copy link
Owner

I don't really get the problem.
Why don't you pass just the

ticks: {
  beginAtZero: true
 },

to your options?

@ddydeveloper
Copy link
Author

@apertureless sorry, it is my mistake, I just forgot pass the begin zero option like a property of the ticks object and done it in this way:

options: {
   responsive: false,
   beginAtZero: true
}

and I was confused by result. Thank you for help. Close the issue.

@icangku
Copy link

icangku commented Jul 23, 2018

I did something like this,

<bar-chart :chart-data="barData" :height="100" :options="{responsive: false, maintainAspectRatio: false, ticks : {beginAtZero : true}}"></bar-chart>

But it goes for nothing, help me please

@apooslr
Copy link

apooslr commented Oct 5, 2018

I have the same problem. I have tried
:options="{maintainAspectRatio: false, ticks : {beginAtZero : true}}"
and
:options="{maintainAspectRatio: false, beginAtZero : true}"
but the y-axis still starts at the value of the lowest data point. How can I get it to start at zero?

@miguel-rod
Copy link

@icangku @AndreaRylander
you have to put it in the y or x axis option
see this post

#272 (comment)

@apooslr
Copy link

apooslr commented Oct 23, 2018

@miguel-rod Yes, I tried and it worked, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants