-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Box plot y axis extent is too large on small numbers #1120
Comments
My bad, it seems that this can be controlled by tweaking the setting .yAxisPadding('10%') produces sane figures. Although it's weird the default value would be so high considering the docs mention the default value to be |
Yeah, we've run into this before. I think this chart was tuned for its example and it contains the suspicious lines // default padding to handle min/max whisker text
_chart.yAxisPadding(12); https://github.com/dc-js/dc.js/blob/develop/src/box-plot.js#L54-L55 ... which may work great for that example but it's not great to adjust the domain in order to fit some text in range coordinates. I don't think we currently have range padding (?) but that's what's needed here. At least there is access to the thing you need to override. |
Another issue, if you have very small values as @amergin does, the https://github.com/dc-js/dc.js/blob/develop/src/box-plot.js#L204-209 |
I have been thinking through this for the last hour. @gordonwoodhull has anything every come of this? Why was this closed? |
It's still open. It's actually not that hard to compute elastic manually - just add a preRender & preRedraw handler. I guess the tricky part is computing the text height (in range coordinates) and transforming it to domain coordinates, without already having the scale calculated. |
Here is the work that I am performing on boxPlot. Below is the current output from the dc.js boxplot for 4 different datasets. As discussed the hardcoding of the yAxisPadding=12 causes issues with smaller range charts. Below is a fix to dynamically calculate the yAxisPadding within the boxPlot code. It still allows the users to add additional yAxisPadding if needed. Finally I had a requirement to render the data within the boxPlot. The idea came from the following stackoverflow question. This is what I am currently working on. I have some code cleanup and a couple of additional actions to complete. Currently the developer can provide the following:
I would like to allow the developer to define the symbol for outliers, but might leave this for later. Any thoughts? |
Those look great! I hope you will consider contributing a PR. |
I will definitely be happy to contributing a PR. I have never contributed before so I will need to determine the process. |
It's not too hard, just start out by forking the repo and then creating a branch with the changes you want to contribute. When you push that branch to GitHub and visit your repo's page, github will ask you if you want to do a PR. There are some annoying details after that, but that's enough to share your work with others. The branch is so you can separate changes that you want to contribute from ones you don't. |
My bad, it seems the 3 digits after the decimal can be done by setting the tickFormat: .tickFormat(d3.format('.3f')) |
@cwolcott |
Fixed by #1370 in 3.0.4, which introduces |
I'm seeing an issue where my data is somewhere between [0, 0.5] yet the chart is drawn with a clearly larger extent:
Any way around this without having to override the domain manually - that is, to have to recompute the extent whenever the chart filter is triggered?
?
The text was updated successfully, but these errors were encountered: