@GaryZ Unfortunately you can't go from chart to table. Look at the XML and you will see that <chart> or <table> are completely separate XML types and have a whole different bunch of configuration o...
See more...
@GaryZ Unfortunately you can't go from chart to table. Look at the XML and you will see that <chart> or <table> are completely separate XML types and have a whole different bunch of configuration options. The token replacement mechanism simply replaces the <option name="charting.chart">$chart$</option> with the appropriate piece of text - all other options being equal, the replacement will work. The way to solve this problem is to have both panels, one for charts and one for table and use token dependency to switch between the panels, like this example. Note that it uses a base search which is used to populate both searches, so no duplication. You can then use any post processing in a panel that requires additional processing to suit the visualisation. <form version="1.1">
<label>Visualisation Selection</label>
<search id="base_panel_data">
<query>
| makeresults count=5000
| eval car=mvindex(split("Volvo,Mercedes,VW,Porsche,Jaguar,Tesla,BYD,Toyota,Suzuki",","), ((random() % 97) * (random() % 71)) % 9)
| stats count by car
</query>
</search>
<fieldset submitButton="false"></fieldset>
<row>
<panel>
<input type="dropdown" token="viz_type" searchWhenChanged="true">
<label>What viz type</label>
<choice value="pie">Pie</choice>
<choice value="bar">Bar</choice>
<choice value="line">Line</choice>
<choice value="column">Column</choice>
<choice value="table">Table</choice>
<change>
<condition value="table">
<unset token="show_chart"></unset>
<set token="show_table"></set>
</condition>
<condition>
<set token="show_chart"></set>
<unset token="show_table"></unset>
</condition>
</change>
</input>
<chart depends="$show_chart$">
<search base="base_panel_data">
<query>
</query>
</search>
<option name="charting.chart">$viz_type$</option>
<option name="charting.drilldown">all</option>
</chart>
<table depends="$show_table$">
<search base="base_panel_data">
<query>
</query>
</search>
</table>
</panel>
</row>
</form>