I am doing a research paper on stock market volatility. I want to create a chart that lets the user customize the criteria for percentage moves in the stock market. The distribution chart is a histogram of shifts in the S&P 500 index. I want to create a chart where users can specify what percentage change occured in the market, and what the market did a specified amount of days after.

I would like to create 2 buttons, one which let's the viewer change the percentage move in the market (from -10%,-9%...9%,10%), and one that let's the viewer change the the number of days (1-30) following that move to be displayed in the distribution.

For example, I would like to the user to be able to customize the chart see the distribution of stock market moves 21 days after a 5% decline in the market, and easily change the criteria to see the distribution of market movements 5 days after a 2% increase. Changing these criteria with buttons would automatically update the graph.

Any ideas how to do this