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

How can we specify that only whole numbers(multiples of 100) should be present in the tick values #2210

Open
keshav1007 opened this issue Oct 27, 2017 · 5 comments

Comments

@keshav1007
Copy link

Hi,

Now in C3 the y-axis tick values are automatically plotted based on the yaxis values. Say i need to show only the tick values having multiples of 100.

For example - my y-axis will range between 10000 to 50000

and I want to show only the tick values like - 20000, 21000, 21100 but i should not get values like 21010 something which is not a multiple of 100.

How can i achieve this?

@aleksey-korotkevich
Copy link

@keshav1007
I think you should look into this function:
http://c3js.org/reference.html#axis-x-tick-values

@keshav1007
Copy link
Author

@aleksey-korotkevich - this is for x axis values. Also we can use axiy.y.tick.values but there we need to specify the exact values. But in my case i need the dynamic values with only whole numbers.

@aleksey-korotkevich
Copy link

@keshav1007
So... You need to calculate those values array and pass it to axis.y.tick.values field

@crauliuc
Copy link

crauliuc commented Nov 6, 2017

How can I update/reload the x axis tick values? I have a chart and when it is on a small width I show only 5 tick values on the x axis. I would like when enlarged to fullscreen to display 15 tick values instead of 5. Any ideas?

@crauliuc
Copy link

crauliuc commented Nov 6, 2017

chart_name.internal.config.axis_x_tick_values=['08/01/2017'];
chart_name.flush();

Worked for me right now.

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

3 participants