1

I have a chart and a table which I want to make them aware of a selector option, then selecting the corresponding data source. That will avoid me to put in three tables and three charts to display the same information, but grouped and ordered differently.

Chart is called: MainBar

My data sources are: get_Line get_Category get_Type

The parameter, selector and listener are: "metric"

Reading here and there, I managed to put a Pre Execution javascript to try to make this work, but it isn't. This is the javascript

function changeData(){
var cadDataSource="get_"+metric;
this.chartDefinition.dataAccessId = cadDataSource;
render_MainBar.update();
}

I used two alerts (before and after the change) to debug it, and I can see that is actually changing the variable this.ChartDefinition.dataAccessId according to the parameter. But still the chart refreshes, but only shows the default Data Source, the one that is set on the chart definition.

This is just for the chart. For the table, I'm completely lost. I don't know which variables to set.

Any ideas?

Martin Ocando
  • 914
  • 2
  • 8
  • 18
  • 1
    Never mind. Found the solution. I just added the following to both the Table and Bar Chart Pre Execution definitions: function(){ this.chartDefinition.dataAccessId = "get_"+metric; } – Martin Ocando Nov 13 '12 at 17:20

0 Answers0