Personal tools

Template:CategorizedChart: Difference between revisions

From FANTOM5_SSTAR

Jump to: navigation, search
(Created page with "<html> <script language="javascript" type="text/javascript" src="/resource_browser/rb_js/flot/jquery.flot.js"></script> <script language="javascript" type="text/javascript" sr...")
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 21: Line 21:
}
}
var series = { data: []};
var series = { data: []};
var categories ={catalog: {}, score:[]};
var categories ={catalog: [], score:[]};


var tmp_data = [];
var tmp_data = [];
Line 34: Line 34:
var distincs = getDistinctElements(categories_array);
var distincs = getDistinctElements(categories_array);
for(var i=0, l=distincs.length; i<l; i++){
for(var i=0, l=distincs.length; i<l; i++){
categories.catalog[distincs[i]];
var myMap = {};
categories.score[distincs[i]]
myMap[distincs[i]] = [];
categories.catalog[i]=myMap;
categories.score[i]=myMap
}
}


Line 43: Line 45:
var tmp_score= content_array[i];
var tmp_score= content_array[i];


categories.catalog[tmp_motiftype].push(tmp_tfactor);
categories.catalog(tmp_motiftype);
categories.score[tmp_motiftype].push(tmp_score);
categories.score(tmp_motiftype);
}
}
});




Line 68: Line 72:
}
}


function uniq(ary) {
    var prim = {"boolean":{}, "number":{}, "string":{}}, obj = [];


    return ary.filter(function(x) {
        var t = typeof x;
        return (t in prim) ?
            !prim[t][x] && (prim[t][x] = 1) :
            obj.indexOf(x) < 0 && obj.push(x);
    });
}


</script>
</script>
</html>
</html>
<div id="container2" style="margin: 0 auto"></div>

Latest revision as of 17:41, 16 August 2013