File tree 1 file changed +46
-0
lines changed
1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -236,3 +236,49 @@ describe('Test shapes:', function() {
236
236
} ) ;
237
237
} ) ;
238
238
} ) ;
239
+
240
+ describe ( 'Test shapes: a plot with shapes and an overlaid axis' , function ( ) {
241
+ 'use strict' ;
242
+
243
+ var gd , data , layout ;
244
+
245
+ beforeEach ( function ( ) {
246
+ gd = createGraphDiv ( ) ;
247
+
248
+ data = [ {
249
+ 'y' : [ 1934.5 , 1932.3 , 1930.3 ] ,
250
+ 'x' : [ '1947-01-01' , '1947-04-01' , '1948-07-01' ] ,
251
+ 'type' : 'scatter'
252
+ } ] ;
253
+
254
+ layout = {
255
+ 'yaxis' : {
256
+ 'type' : 'linear'
257
+ } ,
258
+ 'xaxis' : {
259
+ 'type' : 'date'
260
+ } ,
261
+ 'yaxis2' : {
262
+ 'side' : 'right' ,
263
+ 'overlaying' : 'y'
264
+ } ,
265
+ 'shapes' : [ {
266
+ 'fillcolor' : '#ccc' ,
267
+ 'type' : 'rect' ,
268
+ 'x0' : '1947-01-01' ,
269
+ 'x1' : '1947-04-01' ,
270
+ 'xref' : 'x' ,
271
+ 'y0' : 0 ,
272
+ 'y1' : 1 ,
273
+ 'yref' : 'paper' ,
274
+ 'layer' : 'below'
275
+ } ]
276
+ } ;
277
+ } ) ;
278
+
279
+ afterEach ( destroyGraphDiv ) ;
280
+
281
+ it ( 'should not throw an exception' , function ( done ) {
282
+ Plotly . plot ( gd , data , layout ) . then ( done ) ;
283
+ } ) ;
284
+ } ) ;
You can’t perform that action at this time.
0 commit comments