javascript: object Object instead of value from set =(
<p>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 <code>object Object</code>, but shouldn't it be <code>totalValue</code> (for this example)?</p>

<p>the html</p>

<pre><code>   &lt;select id="performance_chart_filter"&gt;
  &lt;option value="totalValue"&gt;Total by Value&lt;/option&gt;
  &lt;option value="openValue"&gt;Open by Value&lt;/option&gt;
  &lt;option value="declinedValue"&gt;Declined by Value&lt;/option&gt;
  &lt;option value="acceptedValue"&gt;Accepted by Value&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>the javascript</p>

<pre><code>$j("#performance_chart_filter").change(function(){
    plotWithChoice();
});



function plotWithChoice() {
   var d = {
        "totalValue": {
            label: "Total",
            clickable: true,
            hoverable: true,
            data: &lt;%= @total %&gt;
        }
.
.
.
};

    var filter = $j("#performance_chart_filter");
    var data = [d[filter.val()]];
alert(data);
</code></pre>
