So, I'm trying to have same data plotted based on a drop down filter, but I haven't gotten past the storing the data to the variable passing to the plotting function. my alert gives object Object, but shouldn't it be totalValue (for this example)?
the html
<select id="performance_chart_filter">
<option value="totalValue">Total by Value</option>
<option value="openValue">Open by Value</option>
<option value="declinedValue">Declined by Value</option>
<option value="acceptedValue">Accepted by Value</option>
</select>
the javascript
$j("#performance_chart_filter").change(function(){
plotWithChoice();
});
function plotWithChoice() {
var d = {
"totalValue": {
label: "Total",
clickable: true,
hoverable: true,
data: <%= @total %>
}
.
.
.
};
var filter = $j("#performance_chart_filter");
var data = [d[filter.val()]];
alert(data);