File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 49
49
50
50
// aggregate all json data for the beer
51
51
$ renderedRow = false ;
52
+ $ cols = "" ;
52
53
echo "{ \"rows \":[ " ;
53
54
foreach ( $ fileNames as $ fileName ) {
54
55
$ contents = file_get_contents (dirname (__FILE__ ) . '/ ' . $ fileName );
59
60
echo get_list_between ($ contents , '"rows": ' , ']}] ' );
60
61
$ renderedRow = true ;
61
62
62
- $ colsThisFile = get_list_between ($ contents , '"cols": ' , '] ' );
63
- if (strlen ($ colsThisFile ) > strlen ($ cols )){
63
+ if ($ cols == "" ){
64
64
// use largest column list
65
- $ cols = $ colsThisFile ;
65
+ $ cols = get_list_between ( $ contents , ' "cols": ' , ' ] ' ) ;
66
66
}
67
67
}
68
68
}
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ function toDygraphArray(jsonData) {
161
161
162
162
for ( i = 0 ; i < rows . length ; i ++ ) {
163
163
row = [ ] ;
164
- for ( j = 0 ; j < rows [ i ] . c . length ; j ++ ) {
164
+ for ( j = 0 ; j < Math . min ( rows [ i ] . c . length , handlers . length ) ; j ++ ) {
165
165
handlers [ j ] ( j , rows [ i ] . c [ j ] ) ;
166
166
}
167
167
dataArray . push ( row ) ;
You can’t perform that action at this time.
0 commit comments