@@ -374,21 +374,25 @@ DataController.prototype.resetRawData = function () {
374
374
if ( ! _ . controller . CONFIG [ "pivotProperties" ] ) return rawData ;
375
375
var x , y , i , xEnd = rawData [ 0 ] . length ,
376
376
colLevels = _ . controller . getPivotProperty ( [ "columnLevels" ] ) ,
377
+ rowLevels = _ . controller . getPivotProperty ( [ "rowLevels" ] ) ,
377
378
formatColumn = {
378
379
// "<spec>": { style: "<style>" }
379
380
} ;
380
381
var fillLevels = function ( obj ) {
381
382
if ( typeof obj === "undefined" ) return ;
382
383
for ( var i in obj [ "childLevels" ] ) {
383
- if ( obj [ "childLevels" ] [ i ] [ "spec" ] && obj [ "childLevels" ] [ i ] [ "levelStyle" ] ) {
384
- formatColumn [ obj [ "childLevels" ] [ i ] [ "spec" ] ] =
385
- { style : obj [ "childLevels" ] [ i ] [ "levelStyle" ] } ;
384
+ if ( obj [ "childLevels" ] [ i ] && obj [ "childLevels" ] [ i ] [ "spec" ] ) {
385
+ formatColumn [ ( obj [ "childLevels" ] [ i ] [ "spec" ] || "" ) . replace ( / [ ^ . ] * $ / , "" ) ] = {
386
+ style : obj [ "childLevels" ] [ i ] [ "levelStyle" ] || "" ,
387
+ headStyle : obj [ "childLevels" ] [ i ] [ "levelHeaderStyle" ] || ""
388
+ } ;
386
389
}
387
390
fillLevels ( obj [ "childLevels" ] [ i ] ) ;
388
391
}
389
392
} ;
390
393
for ( i in colLevels ) {
391
- fillLevels ( colLevels [ i ] ) ;
394
+ fillLevels ( { childLevels : [ colLevels [ i ] ] } ) ;
395
+ fillLevels ( { childLevels : [ rowLevels [ i ] ] } ) ;
392
396
}
393
397
for ( y = 0 ; y < rawData . length ; y ++ ) {
394
398
for ( x = 0 ; x < xEnd ; x ++ ) {
@@ -398,10 +402,14 @@ DataController.prototype.resetRawData = function () {
398
402
if ( rawData [ y ] [ x ] . source && rawData [ y ] [ x ] . source [ "path" ] ) {
399
403
for ( i in formatColumn ) {
400
404
if ( rawData [ y ] [ x ] . source [ "path" ] . indexOf ( i ) >= 0 ) {
401
- for ( var yy = y + 1 ; yy < rawData . length ; yy ++ ) {
405
+ var yy ;
406
+ for ( yy = y ; yy < rawData . length ; yy ++ ) {
402
407
if ( ! rawData [ yy ] [ x ] . isCaption ) {
403
- rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
408
+ if ( formatColumn [ i ] . style ) rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
404
409
+ formatColumn [ i ] . style || "" ;
410
+ } else {
411
+ if ( formatColumn [ i ] . headStyle ) rawData [ yy ] [ x ] . style = ( rawData [ yy ] [ x ] . style || "" )
412
+ + formatColumn [ i ] . headStyle || "" ;
405
413
}
406
414
}
407
415
break ;
0 commit comments