2013-02-22 2 views
0

적어도 두 개의 Raphael 차트를 사용하여 웹 페이지를 만들고 있습니다.동일한 페이지의 Raphael 다중 차트

도움을 주시면 감사하겠습니다. 문제를 적절하게 설명했기를 바랍니다.

   <th scope="row">Perl</th> 
       <td>3%</td> 
      </tr> 
      <tr> 
       <th scope="row">C++</th> 
       <td>2%</td> 
      </tr> 
      <tr> 
       <th scope="row">Java</th> 
       <td>2%</td> 
      </tr> 
      <tr> 
       <th scope="row">Objective-C</th> 
       <td>2%</td> 
      </tr> 
     </tbody> 
    </table> 
</div> 
+0

차트를 어떻게 추가 하시겠습니까? 차트 코드를 게시 할 수 있습니까? 한 차트를 다른 차트로 덮어 쓰는 느낌이 들었습니다. – Iwan

+0

답장을 보내 주셔서 감사합니다. Iwan, 위의 g.pie, js 및 g.dots.js 스크립트를 추가했습니다. – TheDarkness

답변

0

문제는 당신이 일을하는

파일 g.pie.js에 있습니다

$("tr").each(function() { 
    // this loops throught all TR tags in the document, which contains two tables... 
    values.push(parseInt($("td", this).text(), 10)); 
    labels.push($("th", this).text()); 
}); 

당신은 일을 할 "해야"무엇 :

var table = $("#holder"); 
    // only select the tr rows that are inside your "holder" div 
$("tr", table).each(function() { 
    values.push(parseInt($("td", this).text(), 10)); 
    labels.push($("th", this).text()); 
}); 

희망이 도움이됩니다. 틀린 데이터 세트를 원형 차트에 밀어 넣고있었습니다.

+0

대접을 받으면서, 나는 비슷한 무엇인가 시도했다. 그러나 couldnt는 그것을 너무나 움직이게한다, soo를 많이 thank : – TheDarkness

+0

어이, 당신은 도트 차트에서 그것을했다;) 다행히 도울 수 있었다 – Iwan