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

Tick for subchart #2626

Closed
mpushki opened this issue Jun 6, 2019 · 3 comments
Closed

Tick for subchart #2626

mpushki opened this issue Jun 6, 2019 · 3 comments

Comments

@mpushki
Copy link

mpushki commented Jun 6, 2019

c3 0.7.1
d3 5.0.0

Tick opt has rotate = 35 and height = 170
Also i have subchart - but i want to hide tick for subchart.
I found next solve:

.c3-axis-x:last-child .tick {
    visibility: hidden;
    display: none !important;
}

But then I have empty space at the bottom
Screenshot from 2019-06-06 15-19-48

@digEmAll
Copy link
Contributor

digEmAll commented Jun 4, 2020

Using collapse instead of hidden should work, i.e. :

.c3-axis-x:last-child .tick {
  visibility: collapse;
  display: none !important;
}

BTW: I think the subchart should have different classes or at least a parent container class to differentiate the selectors.

@digEmAll
Copy link
Contributor

I withdraw what I have said, the space remains also when you use visibility: collapse.

I second the request to be able to hide subchart axis ticks.
Looking at the code, I discovered a property called subchart_axis_x_show that should do what we're asking, but it doesn't seem to work in the last version (0.7.18).

Here's an attached jsfiddle: https://jsfiddle.net/g06n2fsw/13/

IMHO, this feature is very useful because often the labels are very long and you just want to see them in the main chart.

At the very least, could it be possible to add some argument to the callbacks (e.g. the axis.tick.x.format), in order to distinguish if the call has been done while drawing the main chart or the sub-chart ?

Thanks a lot for your efforts on this library

@digEmAll
Copy link
Contributor

Added a PR restoring (and documenting) the parameter subchart_axis_x_show.

Note that when subchart_axis_x_show = false, the x axis, the ticks and ticks labels are hidden.
If you want to still show the x axis line, you can use this css :

/* make the x-axis line visible again */
.c3-axis-x:last-child {
    visibility: visible !important;
}

/* hide the ticks labels*/
.c3-axis-x:last-child .tick {
    visibility: hidden !important;
    display: none !important;
}

@mpushki mpushki closed this as completed Feb 15, 2022
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

2 participants