2011-09-03 6 views
0

나는이 차트를 Flot으로 그리려고합니다. 0에서 10까지의 평행선이 있습니다 (y = 1에서). x = 2, x = 3, x = 7에서의 점들도 모두 y = 1에있다./I 거의 복사 할 수 있음을, 내가 할 노력하고있어 붙여 넣기 작업을 수행하는 방법에 분명한 예가 있다면Jquery.Flot 또는 이와 유사한 그래픽으로

________O____O_______________O_____________ 

0 1 2 3 4 5 6 7 8 9 10 

나는 또한 FLOT 이외의 다른 어떤 열려있어.

답변

2

아주 쉽게 사용 FLOT :

<div id="placeholder" style="width:600px;height:300px;"></div> 
<script type="text/javascript"> 
$(function() { 

    var someLine = [[0, 1], [10, 1]]; 
    var somePoints = [[2,1],[3,1],[7,1]]; 

    $.plot($("#placeholder"),[ 
    { 
     data: someLine, 
     lines: { show: true} 
    }, 
    { 
     data: somePoints, 
     points: { show: true} 
    } 
    ]); 
}); 
</script> 

enter image description here

관련 문제