ABSTRACT (by Federico Levis ) Category: RS
RS Tip: Dynamically change Chart Type. E.g. :
Bar Chart
Line Chart
Pie Chart
1. Goal
Select Chart Type with a Prompt, to allow to the user selecting different Chart Type:
![](https://static.wixstatic.com/media/24acbd_c760b64465dc450c9258c08fab8b01da.png/v1/fill/w_643,h_235,al_c,q_85,enc_avif,quality_auto/24acbd_c760b64465dc450c9258c08fab8b01da.png)
Same QueryResult displayed with Bar Chart and Pie Chart
![](https://static.wixstatic.com/media/24acbd_7000e35475274d079cc063eb96123412.png/v1/fill/w_325,h_78,al_c,q_85,enc_avif,quality_auto/24acbd_7000e35475274d079cc063eb96123412.png)
Chart Type Prompt
2. RS Implementation Steps
Add a Value prompt with parameter=ChartType and following Static Choice to select the possible BarChart Size:
![](https://static.wixstatic.com/media/24acbd_7000e35475274d079cc063eb96123412.png/v1/fill/w_325,h_78,al_c,q_85,enc_avif,quality_auto/24acbd_7000e35475274d079cc063eb96123412.png)
Add 3 Boolean Variable bBarChart, bLineChart, bPieChart, each one True depending on the relative ChartType ParamValue. For exampe for bChartType:
![](https://static.wixstatic.com/media/24acbd_9113f5a7ab504e388b344d570c1f95d9.png/v1/fill/w_221,h_233,al_c,q_85,enc_avif,quality_auto/24acbd_9113f5a7ab504e388b344d570c1f95d9.png)
In your Report Insert the 3 Charts (Bar, Line, Pie), each one in a Block with Style Variable = ChartBooleanVar defined in previous Step; then with Conditional Explorer Set BoxType=none for the "No" Value. For example the BarChart is following Block:
![](https://static.wixstatic.com/media/24acbd_00997b7ba03a4e7e8ebb81f590e39b21.png/v1/fill/w_542,h_245,al_c,q_85,enc_avif,quality_auto/24acbd_00997b7ba03a4e7e8ebb81f590e39b21.png)
That's All: depending on the ChartType selected only the relative Block will be displayed