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

multiple Y axis #92

Open
olelis opened this issue Apr 12, 2023 · 4 comments
Open

multiple Y axis #92

olelis opened this issue Apr 12, 2023 · 4 comments

Comments

@olelis
Copy link

olelis commented Apr 12, 2023

Hello,

it would be nice to have feature where you can select which scales should be used for stackings.

Case:
I have some data that needs to be stacked (scale Y1), - they should be presented as bars.
And I have some data that should be presented as line (scale Y2).

For example:
https://www.chartjs.org/docs/latest/samples/other-charts/combo-bar-line.html

Currently, this plugin stacks all data, including ones that should not be stacked.

@y-takey
Copy link
Owner

y-takey commented Apr 13, 2023

Hello @olelis ,

Thank you for taking the time to share your suggestion with us. We appreciate your feedback and your desire to enhance our plugin's functionality.

We agree that the ability to select which scales should be used for stackings would be a useful feature for many users, and we will certainly consider adding it to our roadmap for future development. We understand the importance of this feature and will do our best to prioritize it in our development plan.

We also appreciate the example you provided and will use it as a reference as we continue to work on improving our plugin.

Thank you again for your contribution to our project. Please feel free to reach out to us if you have any further suggestions or feedback in the future. We aim to address this issue as soon as possible.

y-takey added a commit that referenced this issue Apr 24, 2023
@y-takey
Copy link
Owner

y-takey commented Apr 24, 2023

@olelis Thank you for your request. :)
We have added the axisId option, which allows you to stack only specific axes when there are multiple axes. We have released version 1.4.0 on npm, so please give it a try.

You can also see the sample in action in "Case-12, 13" on https://y-takey.github.io/chartjs-plugin-stacked100/

Please feel free to provide feedback if you notice anything.

@olelis
Copy link
Author

olelis commented Apr 28, 2023

Hello @y-takey

can you give me an example how this should be used?

I have multiple datasets, each has "yAxisID": "y"
One has "yAxisID": "y2"
I have following in plugins:
"stacked100": { "enable": true, "axisId": "y" },

However, some bars are not 100% because of data from y2 dataset.

@y-takey
Copy link
Owner

y-takey commented Apr 28, 2023

Hello @olelis

Here is the sample code: https://github.com/y-takey/chartjs-plugin-stacked100/blob/master/examples/demo/index.ts#L350-L389

Do you want to stack both axes? If so, is there any problem with removing the yAxisId from both datasets? and remove axisId from the plugin options.

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