@ -432,11 +432,11 @@ nv.models.axis = function() {
axisLabel . exit ( ) . remove ( ) ;
switch ( axis . orient ( ) ) {
case 'top' :
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' )
. attr ( 'text-anchor' , 'middle' )
. attr ( 'y' , 0 ) ;
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' ) ;
var w = ( scale . range ( ) . length == 2 ) ? scale . range ( ) [ 1 ] : ( scale . range ( ) [ scale . range ( ) . length - 1 ] + ( scale . range ( ) [ 1 ] - scale . range ( ) [ 0 ] ) ) ;
axisLabel
. attr ( 'text-anchor' , 'middle' )
. attr ( 'y' , 0 )
. attr ( 'x' , w / 2 ) ;
if ( showMaxMin ) {
var axisMaxMin = wrap . selectAll ( 'g.nv-axisMaxMin' )
@ -479,11 +479,11 @@ nv.models.axis = function() {
. attr ( 'transform' , function ( d , i , j ) { return 'rotate(' + rotateLabels + ' 0,0)' } )
. attr ( 'text-anchor' , rotateLabels % 360 > 0 ? 'start' : 'end' ) ;
}
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' )
. attr ( 'text-anchor' , 'middle' )
. attr ( 'y' , xLabelMargin ) ;
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' ) ;
var w = ( scale . range ( ) . length == 2 ) ? scale . range ( ) [ 1 ] : ( scale . range ( ) [ scale . range ( ) . length - 1 ] + ( scale . range ( ) [ 1 ] - scale . range ( ) [ 0 ] ) ) ;
axisLabel
. attr ( 'text-anchor' , 'middle' )
. attr ( 'y' , xLabelMargin )
. attr ( 'x' , w / 2 ) ;
if ( showMaxMin ) {
//if (showMaxMin && !isOrdinal) {
@ -518,11 +518,11 @@ nv.models.axis = function() {
break ;
case 'right' :
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' )
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' ) ;
axisLabel
. attr ( 'text-anchor' , rotateYLabel ? 'middle' : 'begin' )
. attr ( 'transform' , rotateYLabel ? 'rotate(90)' : '' )
. attr ( 'y' , rotateYLabel ? ( - Math . max ( margin . right , width ) + 12 ) : - 10 ) ; //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
axisLabel
. attr ( 'y' , rotateYLabel ? ( - Math . max ( margin . right , width ) + 12 ) : - 10 ) //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
. attr ( 'x' , rotateYLabel ? ( scale . range ( ) [ 0 ] / 2 ) : axis . tickPadding ( ) ) ;
if ( showMaxMin ) {
var axisMaxMin = wrap . selectAll ( 'g.nv-axisMaxMin' )
@ -560,11 +560,11 @@ nv.models.axis = function() {
if ( labelPadding > width ) width = labelPadding ;
} ) ;
* /
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' )
axisLabel . enter ( ) . append ( 'text' ) . attr ( 'class' , 'nv-axislabel' ) ;
axisLabel
. attr ( 'text-anchor' , rotateYLabel ? 'middle' : 'end' )
. attr ( 'transform' , rotateYLabel ? 'rotate(-90)' : '' )
. attr ( 'y' , rotateYLabel ? ( - Math . max ( margin . left , width ) + 12 ) : - 10 ) ; //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
axisLabel
. attr ( 'y' , rotateYLabel ? ( - Math . max ( margin . left , width ) + 12 ) : - 10 ) //TODO: consider calculating this based on largest tick width... OR at least expose this on chart
. attr ( 'x' , rotateYLabel ? ( - scale . range ( ) [ 0 ] / 2 ) : - axis . tickPadding ( ) ) ;
if ( showMaxMin ) {
var axisMaxMin = wrap . selectAll ( 'g.nv-axisMaxMin' )
@ -5928,8 +5928,8 @@ nv.models.multiBarChart = function() {
if ( rotateLabels )
xTicks
. selectAll ( 'text' )
. attr ( 'transform' , function ( d , i , j ) { return 'rotate(' + rotateLabels + ' 0,0)' } )
. attr ( 'text-transform ', rotateLabels > 0 ? 'start' : 'end' ) ;
. attr ( 'transform' , 'rotate(' + rotateLabels + ' 0,0)' )
. attr ( 'text-anchor ', rotateLabels > 0 ? 'start' : 'end' ) ;
g . select ( '.nv-x.nv-axis' ) . selectAll ( 'g.nv-axisMaxMin text' )
. style ( 'opacity' , 1 ) ;
@ -8233,7 +8233,7 @@ nv.models.pieChart = function() {
//------------------------------------------------------------
// Display No Data message if there's nothing to show.
if ( ! data || ! data . length ) {
if ( ! data [ 0 ] || ! data [ 0 ] . length ) {
var noDataText = container . selectAll ( '.nv-noData' ) . data ( [ noData ] ) ;
noDataText . enter ( ) . append ( 'text' )
@ -11296,6 +11296,9 @@ nv.models.stackedAreaChart = function() {
return d
} ) ;
state . disabled = data . map ( function ( d ) { return ! ! d . disabled } ) ;
dispatch . stateChange ( state ) ;
//selection.transition().call(chart);
chart ( selection ) ;
} ) ;