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

[Feature request] Add an option for culling to also hide ticks, along with tick labels. #2478

Closed
ImADrafter opened this issue Dec 28, 2021 · 1 comment
Labels

Comments

@ImADrafter
Copy link

Description

I have an use case where the chart should handle both large and small datasets. I found that my solution could be use culling, but also, hide ticks along with the tick labels.

For large data sets, if you specify culling, the ticks will end overlapping one with each other.

Other possibilities that I've tried so far:

The configuration specified at X Axis Tick Timeseries, may look good when the dataset is large. But it falls short when you have less entries than the number specified by axis.x.count, because it shows more ticks than data points. This seems OK on area charts, but it feels weird for line charts.

If you change the size of the dataset with previous configuration ({fit: false, count:5}) an strange behavior occurs, ignores the specified count. Please take a look at bellow images.

image
image

If fit: false is specified, then the x axis labels will no longer be positioned according to the data, as the documentation indicates.

So, I tried different configuration possibilities. One of them was using culling: { max: 5 }, which works nice, but with large datasets, the x axis looks really bad, since all the ticks are overlapping.

image

It would be nice to have the option of also, hide the tick along with the label while using culling. Maybe this was the original idea from count? What am I missing here?

Thank you for taking the time to read this issue. Please let me know how should I proceed.

Steps to check or reproduce

In this codeSandbox you can change the length of the dataSet and check what I described before.

@netil
Copy link
Member

netil commented Jan 3, 2022

If fit: false is specified, then the x axis labels will no longer be positioned according to the data, as the documentation indicates.

The description for fit was described in opposite way, which was fixed now, e504bdd

From the latest release with some option combination, you can limit x axis ticks appearance as below.

I think, with the option count=5, will fulfill your needs. But if want to make ticks to be displayed as the last screenshot without tick lines, you can control the visibility by style.

<div id="cullingChart"></div>
#cullingChart .bb-axis-x .tick line {
    display: none;
}
const chart = bb.generage({
    ...
    axis: {
        x: {
            culling: {
            max: 5,
        }
    },
    bindto: "#cullingChart"
});

@netil netil closed this as completed in aad8c45 Jan 3, 2022
github-actions bot pushed a commit that referenced this issue Jan 5, 2022
# [3.3.0-next.2](3.3.0-next.1...3.3.0-next.2) (2022-01-05)

### Bug Fixes

* **event:** fix touch event handling on arc ([d3d2e05](d3d2e05)), closes [#2477](#2477)
* **types:** Fix plugin's type definition ([f3690f9](f3690f9)), closes [#2483](#2483)

### Features

* **axis:** alow user to hide tick lines while using culling ([aad8c45](aad8c45)), closes [#2478](#2478) [#2480](#2480)
* **bar:** Intent to ship bar.indices.removeNull ([b16605d](b16605d)), closes [#1687](#1687)
github-actions bot pushed a commit that referenced this issue Jan 14, 2022
# [3.3.0](3.2.2...3.3.0) (2022-01-14)

### Bug Fixes

* **api:** Ensure svg nodes to be removed from memory  ([f49ed83](f49ed83)), closes [#2489](#2489)
* **event:** fix touch event handling on arc ([d3d2e05](d3d2e05)), closes [#2477](#2477)
* **text:** Fix text position with candlestick type combination ([f84ab3e](f84ab3e)), closes [#2436](#2436)
* **tooltip:** fix candlestick tooltip display with xs option ([0278067](0278067)), closes [#2434](#2434)
* **types:** Fix axis types definition ([92fb033](92fb033)), closes [#2499](#2499)
* **types:** Fix plugin's type definition ([f3690f9](f3690f9)), closes [#2483](#2483)

### Features

* **axis:** alow user to hide tick lines while using culling ([aad8c45](aad8c45)), closes [#2478](#2478) [#2480](#2480)
* **bar:** add non zero based bar chart ([3588abe](3588abe)), closes [#2408](#2408) [#2438](#2438)
* **bar:** Implement stacking bar radius ([8f14d1a](8f14d1a)), closes [#2428](#2428)
* **bar:** Intent to ship bar.indices.removeNull ([b16605d](b16605d)), closes [#1687](#1687)
* **option:** Enhance padding to be removed completely ([2052a19](2052a19)), closes [#2367](#2367)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants