tag:blogger.com,1999:blog-279772059074318326.post5838165814228060953..comments2023-12-30T11:14:38.564-08:00Comments on D3.js Tips and Tricks: Setting up axes in d3.jsD3 Noobhttp://www.blogger.com/profile/00927635217604611354noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-279772059074318326.post-5109566380518900852016-01-09T13:20:36.059-08:002016-01-09T13:20:36.059-08:00Hmm... This kind of depends on what you're try...Hmm... This kind of depends on what you're trying to achieve. d3 does an automatic selection of what it considers to be the best interval and from there the spacing is determined by the width of the graph. I suggest that if you have a specific need that d3 isn't satisfying, you could either set ordinal values for the axis possibly. The first thing I would suggest is having a read over the official documentation (https://github.com/mbostock/d3/wiki/SVG-Axes) and you may also get a different perspective from Dashing D3.js (https://www.dashingd3js.com/d3js-axes) or Scott Murray's excellent blogs (http://alignedleft.com/tutorials/d3/axes). Have a good read, experiment a bit and see how you get on. Good luck.D3noobhttps://www.blogger.com/profile/03091573479428198379noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-73960920078117684332016-01-01T00:47:11.038-08:002016-01-01T00:47:11.038-08:00Is there a way to set distance (or gap) between ti...Is there a way to set distance (or gap) between ticks? Please help.Anonymoushttps://www.blogger.com/profile/12270465027311107624noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-89990934327014833412015-12-25T09:54:27.515-08:002015-12-25T09:54:27.515-08:00If I understand your question properly, the range ...If I understand your question properly, the range doesn't have to be changed. The examples above are just for illustration. Your suggestion for an example where we could set ticks on a sliding scale or something similar is genius! use the following information and you should be able to mash up a simple graph with an HTML input to illustrate what you're talking about http://www.d3noob.org/2014/04/using-html-inputs-with-d3js.html. Great suggestionD3noobhttps://www.blogger.com/profile/03091573479428198379noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-9159789789820866482015-12-25T00:20:02.035-08:002015-12-25T00:20:02.035-08:00That's a really good question that when I firs...That's a really good question that when I first read it I thought it would be a simple answer, but I have to say that I don't know what it is! A quick googling (which I assume you have done as well) did not give an answer, but I can see that it's not as straight forward as the question of removing the final tick (which is the common thread). I therefore think that this would be a great question to ask on Stack Overflow where there is a great range of people who would be interested in breaking new ground on an interesting d3.js question. Thanks for the great thought.D3noobhttps://www.blogger.com/profile/03091573479428198379noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-3642377303031361222015-11-16T03:04:22.472-08:002015-11-16T03:04:22.472-08:00Could it be possible to show values for the first ...Could it be possible to show values for the first and the last ticks?Anonymoushttps://www.blogger.com/profile/00875061247001156179noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-62876467631046446642015-10-30T08:37:35.070-07:002015-10-30T08:37:35.070-07:00I don't understand. Why does the range has to ...I don't understand. Why does the range has to be changed? Range is set on what the height/width of the chart is for specific axis, and the charts heigh/width stays the same. Is it possible to see a working example, where you set how many ticks you want?Anonymoushttps://www.blogger.com/profile/07982073739105926326noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-80264322526591245252015-03-18T12:04:54.487-07:002015-03-18T12:04:54.487-07:00This comment has been removed by the author.tj lensinghttps://www.blogger.com/profile/14625794926000662458noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-17359149395085487192015-03-16T10:03:24.927-07:002015-03-16T10:03:24.927-07:00This comment has been removed by the author.tj lensinghttps://www.blogger.com/profile/14625794926000662458noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-88337388563813471512015-03-05T22:51:58.533-08:002015-03-05T22:51:58.533-08:00Thank you very-very much!
Thank you very-very much!<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-29745183495391832552015-01-28T05:15:35.258-08:002015-01-28T05:15:35.258-08:00Exactly what i want. thank u...Exactly what i want. thank u...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-25325854280891692072013-06-28T11:14:39.780-07:002013-06-28T11:14:39.780-07:00If I understand your question correctly, I think i...If I understand your question correctly, I think it's because they represent the already scaled range that was defined earlier in the code (http://www.d3noob.org/2012/12/setting-scales-domains-and-ranges-in.html) That way, the axes will scale to the correct extent. Hopefully that makes sense.D3noobhttps://www.blogger.com/profile/03091573479428198379noreply@blogger.comtag:blogger.com,1999:blog-279772059074318326.post-45554155718445002732013-06-28T07:36:26.420-07:002013-06-28T07:36:26.420-07:00What are x,y the parameters to the scale call?What are x,y the parameters to the scale call?Michael O'Brienhttps://www.blogger.com/profile/01162669720181192584noreply@blogger.com