Skip to content

Instantly share code, notes, and snippets.

@slawekkolodziej
Created November 12, 2012 11:13
Show Gist options
  • Save slawekkolodziej/4058747 to your computer and use it in GitHub Desktop.
Save slawekkolodziej/4058747 to your computer and use it in GitHub Desktop.
Connect multiple series visibility in Highcharts
Highcharts.Series.prototype.toggleConnected = function(visible) {
var visibility = visible || !this.visible,
series = this.options.connectedSeries,
l = series.length,
serie;
while (l--) {
serie = this.chart.get(series[l]);
serie.setVisible(visibility, false);
serie.checkbox && (serie.checkbox.checked = visibility);
}
this.setVisible(!visibility);
this.checkbox && (this.checkbox.checked = visibility);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment