Lucile
Posts: 1
Joined: Tue May 04, 2021 4:02 pm

Add buttons to select parameters

Hi,

First, I am sorry if the answer is obvious or already been given, although I have already scanned the forum. Second, I still have not used Highcharts, that is why I ask the question before investing time in it., so I may not be familiar with every concept, sorry for that !

I am willing to insert a chart (stacked bars) that changes according to parameters that the user selects. Example : the chart shows the food budget of a person, and it changes depending on the quantities of food purchased, the share of organic products purchased, the price of organic products, etc.

Is it possible to do that ? So far, I have only seen examples where users could select different years https://www.highcharts.com/demo/column-comparison, but is it possible to add more parameters ? Ideally, I would insert 4 different buttons allowing to scroll down different options for each parameter.

Thank you very much !
Lucile
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Add buttons to select parameters

Hello Lucile!

Welcome to our forum and thanks for contacting us with your question!

Of course, it's possible. We can add more buttons and define their functionalities. I've made a simple POC, so you can see how it works. In the demo below you can select from what region countries should be displayed (if you want more of them to be displayed you need to add data to the dataRegion array and dataPrevRegion array, lines 54 and 122).

Demo: https://jsfiddle.net/BlackLabel/m132yfn4/

Feel free to ask any further questions.
Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Stock”