MediaWiki:Common.js

From FridaV

Jump to: navigation, search
var chart = {
var chart = {
 +
  chart: {},
   init: function() {
   init: function() {
     $('table.flot').each(function(i) {
     $('table.flot').each(function(i) {
-
       console.log(i);
+
      var my_id=$(this).attr('id');
-
       console.log(this);
+
       console.log(id);
 +
      chart.chart[my_id]={cols:{}, ncols:[]};
 +
 
 +
      // get columns
 +
      $('.wdbi-results-header th').each(function(j) {
 +
        var name=this.innerHTML;
 +
        chart.chart[my_id].cols[name]=j;
 +
        chart.chart[my_id].ncols.push(name);
 +
      });
 +
       console.log(chart.chart[my_id]);
     });
     });
   }
   }

Revision as of 21:14, 4 April 2009

/* Any JavaScript here will be loaded for all users on every page load. */

var chart = {
  chart: {},
  init: function() {
    $('table.flot').each(function(i) {
      var my_id=$(this).attr('id');
      console.log(id);
      chart.chart[my_id]={cols:{}, ncols:[]};

       // get columns
      $('.wdbi-results-header th').each(function(j) {
         var name=this.innerHTML;
         chart.chart[my_id].cols[name]=j;
         chart.chart[my_id].ncols.push(name);
      });
      console.log(chart.chart[my_id]);
    });
  }
}

$(document).ready(chart.init);
maps, graphs & data