-
Notifications
You must be signed in to change notification settings - Fork 353
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
The option to delete the axis #26
Comments
Good point! If you need to get rid axis nodes, just simply remove nodes // in case of x axis
d3.selectAll(".bb-axis.bb-axis-x").remove();
// in case of y axis
d3.selectAll(".bb-axis.bb-axis-y").remove(); I'll take considering this issue if can be more nice way to implement. Thanks anyway. |
Thanks for your answer. Obviously, the axis does hide when I remove the axis as like your answer. The thing is ... The white space still remains. I'd like to place the chart right above the bottom line, like below. Could you give me a tip for a solution, please ? |
well, I think this issue isn't really attached on chart functionality. Just one of the way will be defining bb.generate({
data: {
columns: [
["data1", 5, 10, 15],
["data2", 20, 3, 8]
],
type: "bar"
},
axis: {
x: {
show: false
},
y: {
show: false
}
},
legend: {
show: false
}
});
// to get the chart area size
var rect = d3.select(".bb-zoom-rect");
// set viewBox attribute
d3.select("#chart svg").attr("viewBox", [
0,0,rect.attr("width"), rect.attr("height")
].join(" ")) This example will make chart element to fit on exact svg viewport. |
Thank you for giving me a solution. It's been very helpful. |
Description
I’m trying to render a chart w/o y and x axis.
The chart supposed to be rendered on the very lower side without any space, as I expected.
But the axis still does exist, even after adding the ‘axis.x.show = false’ & ‘axis.y.show = false’.
The axis’s visibility is set hidden, meaning still occupying the space.
So the solution what I am having is like below.
When I render a chart w/o the axis, I repeatedly do this and feel knackered.
I am hoping you to have a plan regarding the bothering works I mentioned above.
Thanks :)
Steps to check or reproduce
The text was updated successfully, but these errors were encountered: