File tree 1 file changed +47
-0
lines changed
1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -5681,6 +5681,53 @@ describe('Test axes', function() {
5681
5681
} ) ;
5682
5682
} ) ;
5683
5683
5684
+ [
5685
+ {
5686
+ range : [ '2019-12-10' , '2020-01-10' ] ,
5687
+ positions : [ '2019-12-16 12:00' , '2020-01-10' ] ,
5688
+ labels : [ '2019-Dec' , ' ' ]
5689
+ } ,
5690
+ {
5691
+ range : [ '2019-12-20' , '2020-01-20' ] ,
5692
+ positions : [ '2019-12-20' , '2020-01-16 12:00' ] ,
5693
+ labels : [ ' ' , '2020-Jan' ]
5694
+ } ,
5695
+ {
5696
+ range : [ '2020-01-20' , '2019-12-20' ] ,
5697
+ positions : [ '2020-01-20' , '2020-01-16 12:00' ] ,
5698
+ labels : [ ' ' , '2020-Jan' ]
5699
+ }
5700
+ ] . forEach ( function ( t ) {
5701
+ it ( 'should position labels with monthly tickformat when auto dtick is weekly | range:' + t . range , function ( done ) {
5702
+ Plotly . newPlot ( gd , {
5703
+ data : [ {
5704
+ x : [
5705
+ '2020-01-01' ,
5706
+ '2020-01-02'
5707
+ ] ,
5708
+ mode : 'lines+text' ,
5709
+ text : [
5710
+ 'Jan 01' ,
5711
+ 'Jan 02'
5712
+ ]
5713
+ } ] ,
5714
+ layout : {
5715
+ width : 600 ,
5716
+ xaxis : {
5717
+ range : t . range ,
5718
+ ticklabelmode : 'period' ,
5719
+ tickformat : '%Y-%b'
5720
+ }
5721
+ }
5722
+ } )
5723
+ . then ( function ( ) {
5724
+ _assert ( '' , t . positions , t . labels ) ;
5725
+ } )
5726
+ . catch ( failTest )
5727
+ . then ( done ) ;
5728
+ } ) ;
5729
+ } ) ;
5730
+
5684
5731
[
5685
5732
{
5686
5733
range : [ '2020-12-15' , '2084-12-15' ] ,
You can’t perform that action at this time.
0 commit comments