HTML and CSS Reference
In-Depth Information
// Get legend data from table body
chartLegend : function () {
},
// Get highest value for y-axis scale
chartYMax : function () {
},
// Get y-axis data from table cells
yLegend : function () {
},
// Get x-axis data from table header
xLegend : function () {
},
// Sort data into groups based on number of columns
columnGroups : function () {
}
}
We have several functions here, and they are explained in the code's comments. Most of them
are quite similar, so we don't need to go through each one. Instead, let's pick apart one of
them, columnGroups :
// Sort data into groups based on number of columns
columnGroups : function () {
var columnGroups = [];
// Get number of columns from first row of table body
var columns = data . find ( 'tbody tr:eq(0) td' ). length ;
for ( var i = 0 ; i < columns ; i ++ ) {
columnGroups [ i ] = [];
data . find ( 'tbody tr' ). each ( function () {
columnGroups [ i ]. push ( $ ( this ). find ( 'td' ). eq ( i ). text ());
});
Search WWH ::




Custom Search