2013-03-07 52 views
2

我是Highcharts的新用戶,並在jsFiddle上修改了一下。Highcharts Scatter Plot表現

小提琴獨立的例子看起來是這樣的:

<!DOCTYPE HTML> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<title>Highcharts Example</title> 

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> 
<script type="text/javascript"> 

$(function() { 

var chart; 
$(document).ready(function() { 

chart = new Highcharts.Chart({ 

    chart: { 
     renderTo: 'container', 
      type: 'scatter', 
      zoomType: 'xy' 
    }, 

    xAxis: { 
     type: 'datetime' 

    }, 
    series: [{ 
     color: 'rgba(223, 83, 83, .5)', 
     data: 
     [[Date.UTC(2012,10,15,12,25,47), 90.7000], 
      // Many more data points here, see fiddle for complete list 
     [Date.UTC(2013,2,7,11,37,18), 199.5000], 
     [Date.UTC(2013,2,7,11,37,18), 199.5000]] 
    }] 

}); 
    }); 

}); 
</script> 
</head> 
<body> 
<script src="http://code.highcharts.com/highcharts.js"></script> 
<script src="http://code.highcharts.com/modules/exporting.js"></script> 
<div id="container" style="height: 300px"></div> 
</body> 
</html> 

不管怎麼說,我有一系列由(日期時間,浮點)笛卡爾點的大集合(〜16K),我希望可視的在散點圖上。我得到了我想要的,但它似乎讓我的瀏覽器真的很慢。特別是如果我重新調整窗口大小或將鼠標懸停在工具提示上。尋找任何建議或提示,以優化性能或指出(沒有雙關語意圖)我應該做的其他事情,而不是這種可視化。

回答

-1

你可以做的一些事情是刪除圖表上的動畫和工具提示。同樣,如果你能擺脫它,你只能渲染每10點的工具提示。

http://jsfiddle.net/Jx5n2/3653/

chart: { 
    renderTo: 'container', 
    type: 'scatter', 
    zoomType: 'xy', 
    animation:false 
}, 

tooltip:{ 
    animation:false, 
    formatter:function(){ 
     if(this.x % 10 != 0) return false; 
     return 'The value for <b>'+ this.x + 
       '</b> is <b>'+ this.y +'</b>'; 
    } 
},