Commit f46045a0 authored by Penom Nom's avatar Penom Nom
Browse files

Add clever interval for scale.

parent 05ccd28b
......@@ -98,11 +98,13 @@ $(function () {
//Retrieve values
sum_data = new Array();
var max_depth = 0 ;
var counts_data = new Array() ;
$(":checked[id^=chk_sample_]").each(function(){
var index = $(this).attr("id").split("_")[2] ;
var counts = $("#counts_"+index).val().split(",") ;
var depths = $("#depths_"+index).val().split(",") ;
max_depth = Math.max( max_depth, parseInt(depths[depths.length-1]) );
var counts_at_scale = new Array();
for (var i=0 ; i<counts.length ; i++) {
while( counts_at_scale.length < parseInt(depths[i]) ) {
......@@ -117,7 +119,7 @@ $(function () {
);
sum_data[$("#sample_id_"+index).text()] = parseFloat( $("#count_"+index).text() );
});
//Build chart
var chart = new Highcharts.Chart({
chart: {
......@@ -131,7 +133,7 @@ $(function () {
title: {
text: 'Depths'
},
tickInterval: 20
tickInterval: Math.max(1, parseInt(max_depth/20))
},
yAxis: {
title: {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment