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

[Question] Can the y axis be set on a range? #3518

Open
TheTimKiely opened this issue Nov 8, 2023 · 5 comments
Open

[Question] Can the y axis be set on a range? #3518

TheTimKiely opened this issue Nov 8, 2023 · 5 comments
Labels

Comments

@TheTimKiely
Copy link

TheTimKiely commented Nov 8, 2023

I've done some digging, but I haven't found how to set the y axis on a region.
I have a time series dataset with some boolean data points that I'd like to display as regions. If values overlap on the x axis, the chart gets difficult to read.
I'd like to "stack" the different datapoint on the y axis, so that they don't overlap.

Is this in anyway possible with billboard.js? Could I set a region's y values in a callback?

Thanks

@netil netil added the question label Nov 9, 2023
@netil
Copy link
Member

netil commented Nov 9, 2023

Hi @TheTimKiely, could you provide some visual example to get more undestanding about it?

@TheTimKiely
Copy link
Author

I was thinking of something like this:
chart_with_regions

The green and blue rectangles at the bottom would be regions that have y values of something like 0-10 and 10-20. This way I could "stack" different boolean data points without them obscuring each other. Since the data points are boolean, the y value is not significant so it can be used for layout.

Another approach that occurs to me is adding a secondary chart with the same x axis. Something like what matplotlib supports with subplots:

matplotlib_subplots

Does that make sense?
Thanks again!

@netil
Copy link
Member

netil commented Nov 10, 2023

@TheTimKiely, it can't be implemented by one instance.
to achieve this, it needs generate multiple chart instances as you need to stack

https://jsfiddle.net/netil/k2eaLs7q/

@TheTimKiely
Copy link
Author

Thanks. And is setting the 'y' axis values on a range not an option?
-Tim

@netil
Copy link
Member

netil commented Nov 15, 2023

And is setting the 'y' axis values on a range not an option?

It means the way to not set y axis value range as below?

axis: {
  y: {
    tick: {
      values: [-1, 0, 1]
    }
  }
}

If so, you can, but the y axis value will show the range of data range bound.
image

If your data's range are -1 ~ 1, it's better specifying y tick values to simplify readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants