We're implementing a jet chart with 3 series. In javascript callback function of chart region (apex), we execute this code for hiding one serie:
function( options ) {
options.dataFilter = function( data ) {
data.series\[ 2 \].visibility = "hidden";
data.series\[ 2 \].displayInLegend = "off";
return data;
};
return options;
}
This code runs ok:

We have 3 series (Metric1, Metric2 and hidden SystemMetricShadow). Now, we want to make visible this last serie when press a button.
We're trying with this code but it doesn't run ok:
-- Dynamic Action with execute javascript
$("#SystemMetrics_jet").ojChart(
{
series: \[{ id:2, "visibility":"visible"}\]
}
);
I've read ojChart options and I know that series is an array of objects.
Can somebody help me about how-to write the correct code for achieving this?
A lot of thanks