@ -163,6 +163,7 @@
// axis
var _ _axis _rotated = getConfig ( [ 'axis' , 'rotated' ] , false ) ,
_ _axis _x _type = getConfig ( [ 'axis' , 'x' , 'type' ] , 'indexed' ) ,
_ _axis _x _utc = getConfig ( [ 'axis' , 'x' , 'utc' ] , true ) ,
_ _axis _x _categories = getConfig ( [ 'axis' , 'x' , 'categories' ] , [ ] ) ,
_ _axis _x _tick _centered = getConfig ( [ 'axis' , 'x' , 'tick' , 'centered' ] , false ) ,
_ _axis _x _tick _format = getConfig ( [ 'axis' , 'x' , 'tick' , 'format' ] ) ,
@ -281,16 +282,17 @@
var defaultColorPattern = [ '#1f77b4' , '#ff7f0e' , '#2ca02c' , '#d62728' , '#9467bd' , '#8c564b' , '#e377c2' , '#7f7f7f' , '#bcbd22' , '#17becf' ] , //same as d3.scale.category10()
color = generateColor ( _ _data _colors , notEmpty ( _ _color _pattern ) ? _ _color _pattern : defaultColorPattern , _ _data _color ) ;
var defaultTimeFormat = ( function ( ) {
var xTimeFormat = _ _axis _x _utc ? d3 . time . format . utc : d3 . time . format ,
defaultTimeFormat = ( function ( ) {
var formats = [
[ d3 . time . f ormat( "%Y/%-m/%-d" ) , function ( ) { return true ; } ] ,
[ d3 . time . f ormat( "%-m/%-d" ) , function ( d ) { return d . getMonth ( ) ; } ] ,
[ d3 . time . f ormat( "%-m/%-d" ) , function ( d ) { return d . getDate ( ) !== 1 ; } ] ,
[ d3 . time . f ormat( "%-m/%-d" ) , function ( d ) { return d . getDay ( ) && d . getDate ( ) !== 1 ; } ] ,
[ d3 . time . f ormat( "%I %p" ) , function ( d ) { return d . getHours ( ) ; } ] ,
[ d3 . time . f ormat( "%I:%M" ) , function ( d ) { return d . getMinutes ( ) ; } ] ,
[ d3 . time . f ormat( ":%S" ) , function ( d ) { return d . getSeconds ( ) ; } ] ,
[ d3 . time . f ormat( ".%L" ) , function ( d ) { return d . getMilliseconds ( ) ; } ]
[ xTimeF ormat( "%Y/%-m/%-d" ) , function ( ) { return true ; } ] ,
[ xTimeF ormat( "%-m/%-d" ) , function ( d ) { return d . getMonth ( ) ; } ] ,
[ xTimeF ormat( "%-m/%-d" ) , function ( d ) { return d . getDate ( ) !== 1 ; } ] ,
[ xTimeF ormat( "%-m/%-d" ) , function ( d ) { return d . getDay ( ) && d . getDate ( ) !== 1 ; } ] ,
[ xTimeF ormat( "%I %p" ) , function ( d ) { return d . getHours ( ) ; } ] ,
[ xTimeF ormat( "%I:%M" ) , function ( d ) { return d . getMinutes ( ) ; } ] ,
[ xTimeF ormat( ":%S" ) , function ( d ) { return d . getSeconds ( ) ; } ] ,
[ xTimeF ormat( ".%L" ) , function ( d ) { return d . getMilliseconds ( ) ; } ]
] ;
return function ( date ) {
var i = formats . length - 1 , f = formats [ i ] ;
@ -641,7 +643,7 @@
if ( typeof _ _axis _x _tick _format === 'function' ) {
format = _ _axis _x _tick _format ;
} else if ( isTimeSeries ) {
format = function ( date ) { return d3 . time . f ormat( _ _axis _x _tick _format ) ( date ) ; } ;
format = function ( date ) { return xTimeF ormat( _ _axis _x _tick _format ) ( date ) ; } ;
}
}
return format ;