@@ -1947,6 +1947,19 @@ nv.models.cumulativeLineChart = function() {
1947
1947
chart . update ( ) ;
1948
1948
} ) ;
1949
1949
1950
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
1951
+ //Double clicking should always enable current series, and disabled all others.
1952
+ data . forEach ( function ( d ) {
1953
+ d . disabled = true ;
1954
+ } ) ;
1955
+ d . disabled = false ;
1956
+
1957
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
1958
+ dispatch . stateChange ( state ) ;
1959
+ chart . update ( ) ;
1960
+ } ) ;
1961
+
1962
+
1950
1963
/*
1951
1964
//
1952
1965
legend.dispatch.on('legendMouseover', function(d, i) {
@@ -3456,6 +3469,19 @@ nv.models.historicalBarChart = function() {
3456
3469
selection . transition ( ) . call ( chart ) ;
3457
3470
} ) ;
3458
3471
3472
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
3473
+ //Double clicking should always enable current series, and disabled all others.
3474
+ data . forEach ( function ( d ) {
3475
+ d . disabled = true ;
3476
+ } ) ;
3477
+ d . disabled = false ;
3478
+
3479
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
3480
+ dispatch . stateChange ( state ) ;
3481
+ chart . update ( ) ;
3482
+ } ) ;
3483
+
3484
+
3459
3485
/*
3460
3486
legend.dispatch.on('legendMouseover', function(d, i) {
3461
3487
d.hover = true;
@@ -4671,6 +4697,19 @@ nv.models.lineChart = function() {
4671
4697
chart . update ( ) ;
4672
4698
} ) ;
4673
4699
4700
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
4701
+ //Double clicking should always enable current series, and disabled all others.
4702
+ data . forEach ( function ( d ) {
4703
+ d . disabled = true ;
4704
+ } ) ;
4705
+ d . disabled = false ;
4706
+
4707
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
4708
+ dispatch . stateChange ( state ) ;
4709
+ chart . update ( ) ;
4710
+ } ) ;
4711
+
4712
+
4674
4713
/*
4675
4714
legend.dispatch.on('legendMouseover', function(d, i) {
4676
4715
d.hover = true;
@@ -5113,6 +5152,19 @@ nv.models.linePlusBarChart = function() {
5113
5152
chart . update ( ) ;
5114
5153
} ) ;
5115
5154
5155
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
5156
+ //Double clicking should always enable current series, and disabled all others.
5157
+ data . forEach ( function ( d ) {
5158
+ d . disabled = true ;
5159
+ } ) ;
5160
+ d . disabled = false ;
5161
+
5162
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
5163
+ dispatch . stateChange ( state ) ;
5164
+ chart . update ( ) ;
5165
+ } ) ;
5166
+
5167
+
5116
5168
dispatch . on ( 'tooltipShow' , function ( e ) {
5117
5169
if ( tooltips ) showTooltip ( e , that . parentNode ) ;
5118
5170
} ) ;
@@ -7246,6 +7298,19 @@ nv.models.multiBarChart = function() {
7246
7298
chart . update ( ) ;
7247
7299
} ) ;
7248
7300
7301
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
7302
+ //Double clicking should always enable current series, and disabled all others.
7303
+ data . forEach ( function ( d ) {
7304
+ d . disabled = true ;
7305
+ } ) ;
7306
+ d . disabled = false ;
7307
+
7308
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
7309
+ dispatch . stateChange ( state ) ;
7310
+ chart . update ( ) ;
7311
+ } ) ;
7312
+
7313
+
7249
7314
controls . dispatch . on ( 'legendClick' , function ( d , i ) {
7250
7315
if ( ! d . disabled ) return ;
7251
7316
controlsData = controlsData . map ( function ( s ) {
@@ -8121,6 +8186,18 @@ nv.models.multiBarHorizontalChart = function() {
8121
8186
chart . update ( ) ;
8122
8187
} ) ;
8123
8188
8189
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
8190
+ //Double clicking should always enable current series, and disabled all others.
8191
+ data . forEach ( function ( d ) {
8192
+ d . disabled = true ;
8193
+ } ) ;
8194
+ d . disabled = false ;
8195
+
8196
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
8197
+ dispatch . stateChange ( state ) ;
8198
+ chart . update ( ) ;
8199
+ } ) ;
8200
+
8124
8201
controls . dispatch . on ( 'legendClick' , function ( d , i ) {
8125
8202
if ( ! d . disabled ) return ;
8126
8203
controlsData = controlsData . map ( function ( s ) {
@@ -10838,6 +10915,19 @@ nv.models.scatterChart = function() {
10838
10915
chart . update ( ) ;
10839
10916
} ) ;
10840
10917
10918
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
10919
+ //Double clicking should always enable current series, and disabled all others.
10920
+ data . forEach ( function ( d ) {
10921
+ d . disabled = true ;
10922
+ } ) ;
10923
+ d . disabled = false ;
10924
+
10925
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
10926
+ dispatch . stateChange ( state ) ;
10927
+ chart . update ( ) ;
10928
+ } ) ;
10929
+
10930
+
10841
10931
/*
10842
10932
legend.dispatch.on('legendMouseover', function(d, i) {
10843
10933
d.hover = true;
@@ -11447,6 +11537,19 @@ nv.models.scatterPlusLineChart = function() {
11447
11537
chart . update ( ) ;
11448
11538
} ) ;
11449
11539
11540
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
11541
+ //Double clicking should always enable current series, and disabled all others.
11542
+ data . forEach ( function ( d ) {
11543
+ d . disabled = true ;
11544
+ } ) ;
11545
+ d . disabled = false ;
11546
+
11547
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
11548
+ dispatch . stateChange ( state ) ;
11549
+ chart . update ( ) ;
11550
+ } ) ;
11551
+
11552
+
11450
11553
/*
11451
11554
legend.dispatch.on('legendMouseover', function(d, i) {
11452
11555
d.hover = true;
@@ -12740,6 +12843,18 @@ nv.models.stackedAreaChart = function() {
12740
12843
chart . update ( ) ;
12741
12844
} ) ;
12742
12845
12846
+ legend . dispatch . on ( 'legendDblclick' , function ( d ) {
12847
+ //Double clicking should always enable current series, and disabled all others.
12848
+ data . forEach ( function ( d ) {
12849
+ d . disabled = true ;
12850
+ } ) ;
12851
+ d . disabled = false ;
12852
+
12853
+ state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
12854
+ dispatch . stateChange ( state ) ;
12855
+ chart . update ( ) ;
12856
+ } ) ;
12857
+
12743
12858
controls . dispatch . on ( 'legendClick' , function ( d , i ) {
12744
12859
if ( ! d . disabled ) return ;
12745
12860
0 commit comments